Type-safe data structures and bananas without gorillas in PHP
Leo Cavalcante
173

Exactly same thing could be accomplished with stateless service objects. Difference is that functions cannot be passed around like objects, so no composition, polimorfism and other goodies. IMHO splitting behaviour and data is usually a bad thing because it breaks encapsulation, also swimmer and other objects became now “dumb” data structures not objects. I’m not saying that this is always wrong but I don’t really see how this is better than simply extracting behaviour to a stateless service ( which could be extended , composed etc. )

Show your support

Clapping shows how much you appreciated Mieszko Malawski’s story.