News Feed
Sections




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

Freek Lijten:
SOLID - The D is for Dependency Inversion Principle
January 02, 2013 @ 10:25:46

Freek Lijten has posted the last article in his series looking at the SOLID development principles, this time looking at "D", the Dependency Inversion Principle.

The DIP deals with avoiding mixing different levels of abstraction in your code. In this article we will explore the last of these principles in depth. [...] I want to show you how depending on abstractions makes our lives easier in a larger example. Since we're going to be loading, updating and storing bikes a lot in our application I would like an Api for that. It would not be such a good idea to write the same queries or perform the same validation over and over.

He includes two examples - one a bit simplistic involving bike storage and another more complex that uses interfaces to define structure and object injection rather than passing data around. He also tries to help clear up some of the confusion that might happen around dependency inversion and dependency injection.

0 comments voice your opinion now!
solid development principle dependency inversion introduction


blog comments powered by Disqus

Similar Posts

Scott Mattocks' Blog: PHP-GTK 2 Alpha Released

Padraic Brady's Blog: Zend Framework: Surviving The Deep End Book - Chapters 4, 5, 6, 7 and Appendix

PHPBuilder.com: Smarty PHP Template Engine: Building PHP Apps in a Flash

Federico Cargnelutti's Blog: Symfony 1.3 Web Application Development

Etienne Kneuss' Blog: Late Static Bindings Explained


Community Events





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


library developer release threedevsandamaybe podcast interview introduction community project api list laravel bugfix wordpress application series language framework configure code

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