News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Benjamin Eberlei:
Doctrine and SOLID
February 05, 2013 @ 11:09:33

Benjamin Eberlei has a new post to his site today answering a question he sometimes gets about using Doctrine2 in a SOLID context (more on SOLID development here) as it seems difficult to follow the Single Responsibility Principle with how the tool is used.

These problems are related to the inability to share behavioral code through aggregation and the complexity of state transformations. Combining both, your average entity with 5-15 fields can end up with hundrets or thousands lines of code. The solutions to both problems boil down to minimizing duplication and maximizing clarity.

He looks at two different kinds of objects Doctrine uses in its setup, the value objects and method objects, and "maximize clarity" on them by dividing them up into more functional-related objects, passed into each other via method injection.

0 comments voice your opinion now!
doctrine value method objects clarity solid development principles


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Liskov Substitution Principle...attempted

Gonzalo Ayuso: Talk about SOLID and Symfony at the deSymfony 2014 conference.

PHPMaster.com: Code Templates, AutoHotKey, and Ditto: Speeding Up Development

Ruben Vermeersch's Blog: Integrating Zend Framework and Doctrine

ServerGrove Blog: Creating indexes for your Doctrine ODM documents with Symfony 2


Community Events





Don't see your event here?
Let us know!


framework list symfony introduction install voicesoftheelephpant community laravel deployment opinion library tips language interview package bugfix podcast series release api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework