News Feed
Sections




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

DZone.com:
Factory patterns Collaborators Map
October 24, 2012 @ 09:43:02

On DZone.com Giorgio Sironi has a new tutorial looking at the Factory design pattern, specifically the use of a "collaborators map" to create them inside of a dependency injection container.

Like for every library, you should first evaluate if the costs and benefit of integrating [a dependency injection container] are worth it. The alternative is to write your own factory classes, methods and closures: this article explains one of the patterns for building dynamic Factory objects, and as such lowers the cost of the second option. What you know how to do has a lower cost than what you still have to learn, considering risk and implementation time.

He talks about the "old way" of making your own factories to create objects and how the collaborators mapping can replace that. The collaboration mapping is passed in when the object is created and a "create" method is called when the objects (or sub-objects) are needed. He also mentions some of the "easy" and "hard" changes you could make to this setup to expand its functionality.

0 comments voice your opinion now!
factory designpattern collaborator map object create


blog comments powered by Disqus

Similar Posts

Sebastian Bergmann's Blog: Hamcrest

PHPBuilder.com: PHP Form Validation System: An Object-Oriented Approach

Jani Hartikainen's Blog: Zend_Acl part 3: creating and storing dynamic ACLs

CodeSnipers.com: Perl vs. PHP - Datatypes[arrays|lists|hash|map]

ActsAsFlinn Blog: PHP and ActiveRecord


Community Events

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


framework introduction threedevsandamaybe language community api version interview laravel5 laravel series symfony extension unittest voicesoftheelephpant security podcast release library opinion

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