PHP, Collections and You 🫵
, tagged:
programming
php

Collections, like Value and Domain objects, allow you to push logic relating to a concept to the object representing that concept - in this case a collection of items - the items themselves could be value objects, entities, domain objects, or whatever you like. They contribute to a rich domain model and will make your code far easier to understand and maintain.
I use collections all the time. In other posts in this series I’ve reflected on how certain categories of classes are, to my mind, misused.
Read more...








