News Feed
Sections




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

Padraic Brady's Blog:
Interfacing The PHP World Would Be Good
October 27, 2011 @ 11:36:30

Padraic Brady has posted his own response to some of the recent talk about making standard interfaces in PHP applications. His perspective focuses on interfaces and coupling as related to the Zend Framework.

Every PHP framework has it's own unique set of interfaces for common operations such as logging, caching, http clients, filtering, validation, etc. This creates a situation where a framework tends to be loosely coupled but only within the scope of its own interfaces. [...] Loose coupling is therefore a bad joke. It is a narrowly defined concept usually described within the scope of one particular application. We never really apply the concept across multiple applications written with different frameworks because, at that point, the disparate interfaces of both frameworks would immediately make loose coupling unobtainable.

He goes on to talk about a simple example, ZendFeedReader, and how it's very difficult to swap something as simple as the HTTP client out for one from another framework. He mentions the common scapegoat for over-interfacing - Java - and how PHP's is a bit more "practical and flexible" in that department (a good and bad thing).

So yes, common interfaces would benefit PHP and would make framework libraries more interoperable and thus usable within competing frameworks. Hey, if you can't beat them at least make sure you can inject your classes into them. Hmm, still sounds dirty.
0 comments voice your opinion now!
interface discussion common opinion zendframework symfony2


blog comments powered by Disqus

Similar Posts

Rob Allen's Blog: A Tutorial Update & Extending ViewRenderer to Support Layout Templates

Matthew Weier O'Phinney's Blog: Module Bootstraps in Zend Framework: Do's and Don'ts

Indra Dutta's Blog: Top 5 reasons why PHP is a better choice than java & .NET for most websites

Market Day: At A Glance: ASP.net vs. PHP

Fabien Potencier's Blog: Create your own framework...on top of the Symfony2 Components (parts 3 & 4)


Community Events

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


install php7 release symfony2 api performance introduction example series community laravel conference framework application podcast interview library opinion configure language

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