I am a little confused about being an anemic area model in OOP. It is a kind of bunch of simple ordinary object X (where X denotes the language you prefer), without behavior (and responsibilities).
class AnemicDomainClass { private $property; public function getProperty() { return $this->property; } public function setProperty($property) { $this->property = $property; } }
... where is all the logic inside some services?
class SomeStuffService { public static function doSomething(AnemicDomainClass $class) { $class->setProperty(42); } }
This appears at the end of AnemicDomainModel by Martin Fowler
In general, the more you find in services, the more likely you are to rob yourself from the benefits of a domain model. If all your logic is in services, you have deprived yourself of a blind person.
What does it mean? It is better to prefer a smart object over smart services.
oop anemic-domain-model
sensorario Feb 10 '15 at 12:54 2015-02-10 12:54
source share