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

PHPMaster.com:
Living Apart Together Decoupling Code and Framework
November 29, 2012 @ 09:32:21

On PHPMaster.com today there's a new post (by Remi Woler) that looks at abstraction and keeping functionality out of the framework and more decoupled in case the need for switching environments/frameworks comes up.

Of course you develop using the latest technologies and frameworks. You've written 2.5 frameworks yourself, your code is PSR-2 compliant, fully unit-tested, has an accompanying PHPMD and PHPCS config, and may even ship with proper documentation (really, that exists!). When a new version of your favorite framework is released, you've already used it in your own toy project and submitted a couple of bug reports, maybe even accompanied with a unit test to prove the bug and a patch that fixes it. If that describes you, or at least the developer you want to be: reconsider the relationship your code has with the framework.

He talks some about the dependencies most code written today has on the frameworks it lives in and how a good project design can make it easier to decouple this relationship. He suggests using things like wrapper classes (think "services") to abstract out the functionality to custom components. It's these components that handle the work, just reporting back the results to the controller/model that called them.

0 comments voice your opinion now!
decouple code framework tutorial module wrapper


blog comments powered by Disqus

Similar Posts

Tutorial: An Introduction to PHPIDS (PHP-Intrusion Detection System)

Steven Macintyre's Blog: Building a Modular Zend Framework CMS

SitePoint PHP Blog: Rasmus Lerdorf - PHP frameworks? Think again.

Felix Geisendorfer's Blog: Two Tutorials - Title to Slug & Dependencies with If

PHP-GTK Community Site: Extending GtkMenu class for Popup menu dialog


Community Events











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


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

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