News Feed
Sections




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

Zend Developer Zone:
Quick Start Symfony DI (Dependency Injection) Tutorial
August 30, 2010 @ 12:59:46

On the Zend Developer Zone there's a recent post from Steven Lloyd Watkin giving you a quick start to a technique becoming more popular in the PHP development community - dependency injection.

Dependency injection is a technique that allows for loosely coupled objects within a software application. Generally if an object requires access to the functionality of another it would be instantiated internally leading to tightly coupled systems. By implementing dependency injection we inject the required objects ready for use (sometimes also referred to inversion of control - IOC).

He illustrates with an example showing the injection of DecisionParameters into a DecisionMaker object (rather than just passing the parameters in manually). He looks at frameworks and how it's handled there, specifically with the Symfony DI container. He includes example code of how to use it, configure it, pull information back out and, of course, how it can help in unit testing your code.

0 comments voice your opinion now!
dependency injection symfony tutorial framework container


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Mobile App Development with Zend Studio

Codewalkers.com: The PAVISE of Security

CodeSnipers.com: Stupidly Easy MVC in PHP or \"We don\'t need no stinking framework!\" (Part 2)

Marcelo Gornstein's Blog: Advanced telephony applications with PHP and PAGI using call flow nodes

DZone.com: PHPUnit_Selenium


Community Events

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


voicesoftheelephpant part2 php7 project composer list community yii2 symfony example interview opinion podcast framework laravel application api introduction series language

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