News Feed
Sections




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

PHP Thinktank Blog:
Dependency injection in PHP5
May 22, 2006 @ 05:48:59

On the PHP Thinktank Blog, there's a new post that deals with dependency injection in PHP5 - a sort of tutorial on the topic, demonstrating with a simple example.

Several months ago I started using Spring Framework. That is how I faced the dependency injection. As my programming skills mostly originated from web development with PHP, I found out that I've missed a great technique, which is as usually common in Java land, but rare in PHP. I ended up with a research of dependency injection libraries for PHP.

However, all these solutions made you to define your dependencies within the code of your application, and were quite minimalistic. That made my mind - I started working on Garden - the dependency injection container for PHP5, which would use XML definitions with syntax as similar as possible to the Spring.

The example provided performs an injection to "put a collar on a dog", including the complete implementation, down to the output of the var_dump. He hints at some much more complex functionality than just this, though - potential for growth of the Garden library.

0 comments voice your opinion now!
dependency injection php5 garden library bean dependency injection php5 garden library bean


blog comments powered by Disqus

Similar Posts

DevShed: Decoupling the Validation of Data with Bridge Classes in PHP 5

DevShed: Introducing Bridge Classes with PHP 5

International PHP Magazine: Poll Question: The Rules of PHP Throwdown Include

PHPBuilder.com: Implementing User Defined Interfaces in PHP 5

DevShed: Fetching Search Results as Serialized Arrays with Yahoo Web Services and PHP 5


Community Events

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


opinion laravel wordpress extension interview laravel5 voicesoftheelephpant podcast threedevsandamaybe framework api library development language community introduction unittest series release feature

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