News Feed
Sections




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

Paul Jones:
Quicker, Easier, More Seductive Names, Usage, and Intent
December 18, 2013 @ 10:39:05

Paul Jones has updated his "service locators vs dependency injection containers" series with another post to his site today, this time he focuses on implementation not names. He suggests that the difference in naming makes it easy to think they're very different things, so he focuses on implementation rather than just the names.

As the disucussion progressed, it became more clear to me that there really is no significant difference in how Dependency Injection containers and Service Locator containers are written. They are both Inversion of Control (IOC) containers, and are not distinguishable by their code, API, features, etc. (although some may have more or fewer features than others).

As such, the terms Dependency Injection and Service Locator appear to be interchangeable in the sense that a container is a container is a container. The difference in naming comes from how the container is used, not how the container is implemented.

He suggests that one of the main differences is where they are, either inside or outside of a non-Factory object. He circles back around to the names, though, and points out that when developers talk to one another, they need to be speaking the same language. As such, he tries to set this vocabulary for the implementations, separati

0 comments voice your opinion now!
dependency injection service locator implementation naming

Link: http://paul-m-jones.com/archives/5853

blog comments powered by Disqus

Similar Posts

Jakub Zalas' Blog: Managing object creation in PHP with the Symfony2 Dependency Injection component

Ralph Schindler's Blog: Learning About Dependency Injection and PHP

Zend Developer Zone: Consuming WebThumb's API in PHP

Nils Adermann: Composer: Replace, Conflict & Forks Explained

Kevin Schroeder's Blog: ZF2 Dependency Injection - Multiple Object Instances


Community Events





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


introduction list code wordpress release application interview library bugfix laravel language series podcast threedevsandamaybe developer configure install community framework api

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