News Feed
Sections




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

Devis Lucato's Blog:
Select Inversion of Control
December 14, 2011 @ 13:34:53

In a recent post to his blog Devis Lucato introduces the "Inversion of Control" design pattern and shares an implementation he's created as an illustration - a Service Locator called Select.

[In a Service Locator] all the dependencies are provided by a builder, which serves as a registry of dependencies and/or service definitions. The service locator knows how to instantiate each dependency. Such service exposes methods like 'getMailer()', 'getLogger()' etc. A service locator centralises the configuration detailing classes and parameters involved on objects instantiations.

He includes some sample code showing the structure of a Select implementation using a "Mailer" identifier and definitions of the classes to load for it. He also includes a bit of documentation of the (simple) API you can use to work with the tool - setting namespaces, replacing class definitions, creating definitions and finding the resource associated with a definition (to name a few).

0 comments voice your opinion now!
inversion control designpattern select implementation


blog comments powered by Disqus

Similar Posts

DevShed: Handling Cookies and File Data with the Factory Pattern in PHP 5

Michael Girouard's Blog: One Step Closer to an Abstract Singleton

Reese Wilson: Using the ServiceManager as an Inversion of Control Container (Part 1)

Pádraic Brady's Blog: Complex Views with the Zend Framework - Part 3: Composite View Pattern

DevShed: Implementing the Stage Pattern in PHP 5


Community Events





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


release opinion community version laravel artisanfiles symfony list tool composer framework voicesoftheelephpant conference interview library language podcast series introduction security

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