News Feed
Jobs Feed
Sections




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

Lars Strojny's Blog:
Dependency Injection Container Refactorings, Part One
April 20, 2011 @ 10:27:12

New on his blog today Lars Strojny has posted the first part of his look at dependency injection and how he's been using it to do some refactoring in his applications. He uses the Symfony DI container in his examples, but really you can apply the principles to just about any of the other current DI offerings.

Working heavily with the Symfony2 Dependency Injection Container, I feel that we found some typical refactorings towards a DI container that emerge during the introduction of such a component. I want to write down the preliminary results of trying to systematize more or less as a draft. I will use the Symfony2 DI container configuration as an example but most of the refactorings should be applicable to other containers as well, some of them even to dependency injection without a container.

He's broken it up into a few different sections:

  • Making a dependency explicit
  • Introducing interface injection
  • Exposing the service
0 comments voice your opinion now!
dependency injection di refactor container tutorial


blog comments powered by Disqus

Similar Posts

DotKernel.com: Installing GeoIP extension in Zend Server 5.6 on Windows

Kevin Schroeder's Blog: ZF2 Dependency Injection: Managing Configuration - Part 2

PHPBuilder.com: Using the Factory Pattern in PHP Applications

Engrowe.com: How-to - Convert a RSS feed to JSON in PHP

DevShed: Building a Data Validation System with the Prototype Pattern with PHP 5


Community Events











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


introduction code install application facebook threedevsandamaybe symfony2 framework podcast composer series component security release hack unittest hhvm opinion language package

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