News Feed
Jobs Feed
Sections




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

SitePoint PHP Blog:
Dealing with Dependencies
February 04, 2008 @ 12:09:00

On the SitePoint PHP blog today, Troels Knak-Nielsen has written up an article that talks about dependencies in your applications - those little interconnections your code relies on to do more with less.

In lack of better words, I'll call this compositional programming style. It's a style which is usually more prevalent with experienced programmers. [...] There is, however, a dark side to composition - dependencies.

He starts with a definition to bring everyone up to a level field then moves on to how their used (through a "global symbol" or directly passed in) and how they can "leak" if you're not careful.

To help protect you and your code from any kind of damage down the line, Troels suggests making a container to keep objects where they need to be. He even includes an example with namespace support to make things even easier down the road.

2 comments voice your opinion now!
dependencies tutorial compositional programming container leak namespace


blog comments powered by Disqus

Similar Posts

Dennis Hotson's Blog: PHP Object Oriented Programming Reinvented

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?

PhPL33t Blog: How to Automated Plesk Email Creation

Federico Cargnelutti's Blog: Building a RESTful Web API with PHP and Apify

Josh Adell's Blog: Phar Flung Phing


Community Events











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


performance release database package facebook component install security series podcast language hhvm symfony2 application hack composer framework unittest introduction opinion

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