News Feed
Sections




News Archive
feed this:

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

PHPMaster.com:
Introduction to the Law of Demeter
October 26, 2012 @ 12:13:35

On PHPMaster.com today they've posted an introduction to the Law of Demeter, an idea that promotes loose coupling between objects that each do their own work. This makes it simpler to make pieces interchangeable and more able to focus on their job.

With so many heuristics stating how and why software systems should cling to a specific approach, it's pretty disappointing not seeing a broader implementation of them in the world of PHP. For example, the Law of Demeter is probably one of the most underrated in the language's realm. Effectively, the law's "talk to your closest friends" mantra still seems to be in a pretty immature state in PHP, something that contributes to rot in the overall quality of several object-oriented code bases.

They look at how keeping the functionality of each object focused and not "knowing too much" is a good thing and include some examples of working with a service locator, serializer and file storage classes.

0 comments voice your opinion now!
lawofdepeter introduction object loose coupling


Lukas Smith's Blog:
Loose interface coupling
December 06, 2011 @ 11:02:18

In a new post to his blog Lukas Smith proposes an idea for a loosely coupled interface setup that would allow for easier integration between third-party libraries and other applications.

Especially as for different libraries a different subset of the community could end up collaborating. Here I see 3 options: 1) each library bundles the interfaces (even though they sit in some common namespace), 2) each project asks their users to fetch the common interfaces from some other place 3) runtime "coupling". Option 3) doesn't exist today and is what this blog post is about.

He introduces the idea of a "spl_register_compatible_interface" method that would let you compare interfaces to see if they'd mesh. There'd still have to be a lot of communication between developers to make things match, though. He suggests three "practical issues" that libraries/tools would have to overcome to use a system like this - each framework has their own interface setup, the lead time for collaboration could be too much to be worthwhile, a lack of interest from some about collaboration and the idea of competing interface methods.

He's looking for feedback from the community on the idea(s) though, so go and leave a comment with your thoughts!

0 comments voice your opinion now!
interface coupling loose opinion collaboration


PHPImpact Blog:
Analysis of coupling within the Zend Framework
June 09, 2008 @ 07:56:00

As the PHP:Impact blog points out there's a new post from Neil Garb talking about the (loose) coupling going on inside the Zend Framework.

One of the Zend Framework's strongest drawing cards, as I see it, is its loosely-coupled structure. The name Zend Framework may be a misnomer, in fact, as ZF is more a set of reusable libraries than an actual application framework. I won't go into detail about the advantages of loose coupling, but a recent discussion on the ZF mailing list prompted me to investigate just how loosely coupled the framework is.

He's created a few graphs to show the extent of the coupling - a directed graph, the density of it and example code showing deep and shallow coupling. Here's his results.

0 comments voice your opinion now!
analysis coupling zendframework graph deep shallow



Community Events





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


community opinion laravel refactor code podcast language introduction testing series wordpress framework release threedevsandamaybe developer list configure interview unittest install

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