News Feed
Sections




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

Chris Morrell's Blog:
Introducing Zit, an object-oriented dependency injection container
March 23, 2012 @ 12:57:43

In his latest post Chris Morrell introduces a project he's been working on to help with his dependency injection needs - Zit, an object-oriented dependency injection container similar to the Pimple DIC from Fabien Potencier.

I'll admit right now that I'm fairly new to the world of dependency injection containers. I usually do my dependency injection "manually" and have always thought that there must be a better way. Then I came across Pimple, which is a wonderfully simple solution to the problem. The only thing about it is that I hate its array-oriented interface. Something about $container['session_storage'] rubs me the wrong way.

The Zit tool should be very familiar to any user of Pimple, as it implements similar functionality, just in an OOP kind of way. He includes some example code in the post showing how to create a database connection object and inject it into the Zit container. You can find the latest code for the tool over on github.

0 comments voice your opinion now!
dependency injection container zit objectoriented


blog comments powered by Disqus

Similar Posts

Paul Jones: Quicker, Easier, More Seductive: How To Tell A DI Container From A Service Locator

DreamInCode.com: Preventing PHP Mail(...) Header Injections

Ibuildings techPortal: DPCRadio: Real World Dependency Injection

Kevin Schroeder: (Basic) Configuring the Magento 2 Dependency Injection Container

PHPBuilder: Pro PHP Security / Preventing SQL Injection, Part 2


Community Events





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


tool version composer opinion package symfony introduction release update security library interview framework podcast mvc laravel voicesoftheelephpant community series language

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