News Feed
Jobs Feed
Sections




News Archive
NetTuts.com:
Dependency Injection Huh?
September 05, 2012 @ 08:16:33

On NetTuts.com today there's a new tutorial introducing dependency injection and how it compares to other injection types (like setter and constructor). It shows how to apply the "Inversion of Control" methodology to create a container that can be reused across the entire application.

Chances are, at some point in your learning, you've come across the term, "dependency injection." If you're still relatively early in your learning, you likely formed a confused expression and skipped over that part. Still, this is an important aspect of writing maintainable (and testable) code. In this article, I'll explain it in as simple a way as I'm capable of.

He starts with an example of setter/constructor injection and talks about how they can make it difficult to use the class as things get more complex. His solution is to create a simple DIC (dependency injection container) that stores instances of objects or closures that can be extracted an reused.

0 comments voice your opinion now!
dependency injection tutorial setter controller dic


blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: Example Zend Framework Blog Application Tutorial: Parts 1-8 Revisited

SitePoint PHP Blog: How to Split WordPress Content Into Two or More Columns

DevShed: Developing a Form Validation System with the Observer Pattern in PHP

Smackdown Blog: Rackspace Hacked Clients, Check Your Databases: Wordpress "wp_optimize" Backdoor

ProDevTips.com: Writing a CMS/Community with Smarty and the Zend Framework: Part 9


Community Events











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


code composer series introduction community framework functional language release podcast tool zendframework2 conference testing development example interview opinion object unittest

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