Flyweight pattern in PHP

The flyweight pattern is todays structural pattern of the day. Put simply, the flyweight pattern is used for breaking down a large domain model into a smaller domain model and a collection of tiny object-value classes called flyweights.

Flyweights can be useful when you have a collection of objects, that contain repetitive attributes and you want to share these attributes, the end goal being to save on memory usage.

Continue reading