I was trying to separate my DAL from my Business Layer, and in doing so, I decided to eschew any ActiveRecord approach and go for a DataMapper approach. In other words, my domain objects would not take care of persisting themselves. In doing so, I seem to be encroaching on the "anemic domain model" anti-pattern. For instance, one of the entities in my program is an Organization.
An organization is represented as something like this:
class Organization {
private $orgId;
private $orgName;
// getters and setters
}
So basically this organization does nothing other than act as "bag" (as Martin Fowler says) for some data. In the PHP world it is nothing more than a glorified array. There is zero behaviour associated with it.
And behaviour in the program, I've been sticking in "service level" class like an OrganizationService which mostly serves as an intermediary between these objects and the DAL.
Other than potential scaling issues with PHP (I do have other reasons why I insist on "bagging" my data in these objects), is this approach totally off?
How do you handle your domain models in these situations? Perhaps an organization isn't part of my domain in the first place?