<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Mon, 20 May 2013 04:14:35 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[NetTuts.com: How to Write Code That Embraces Change]]></title>
      <guid>http://www.phpdeveloper.org/news/19132</guid>
      <link>http://www.phpdeveloper.org/news/19132</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a great new article about how to <a href="http://net.tutsplus.com/tutorials/how-to-write-code-that-embraces-change/">write code that embraces change</a> and can be easily updated and reconfigured due to a decoupled nature and use of good OOP concepts.
</p>
<blockquote>
Writing code, which is easy to change is the Holy Grail of programming. Welcome to programming nirvana! But things are much more difficult in reality: source code is difficult to understand, dependencies point in countless directions, coupling is annoying, and you soon feel the heat of programming hell. In this tutorial, we will discuss a few principles, techniques and ideas that will help you write code that is easy to change.
</blockquote>
<p>
He covers some of the good OOP principles to think about when developing - like cohesion, orthogonality and coupling (via class methods, polymorphism, dependency injection or interfaces). He spends some time looking at the <a href="http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)">SOLID</a> development principles and how you can implement each of them in some sample code. He also talks some about high level design and how the separation of concerns can help make your code easier to maintain and change.
</p>]]></description>
      <pubDate>Mon, 04 Feb 2013 13:18:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Living Apart Together: Decoupling Code and Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/18818</guid>
      <link>http://www.phpdeveloper.org/news/18818</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post (by <i>Remi Woler</i>) that looks at abstraction and <a href="http://phpmaster.com/living-apart-together-decoupling-code-and-framework/">keeping functionality out of the framework</a> and more decoupled in case the need for switching environments/frameworks comes up.
</p>
<blockquote>
Of course you develop using the latest technologies and frameworks. You've written <a href="http://www.brandonsavage.net/why-every-developer-should-write-their-own-framework/">2.5 frameworks yourself</a>, your code is <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">PSR-2 compliant</a>, fully unit-tested, has an accompanying <a href="http://phpmd.org/">PHPMD</a> and <a href="http://pear.php.net/package/PHP_CodeSniffer">PHPCS</a> 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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Thu, 29 Nov 2012 09:32:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Decoupling models from the database: Data Access Object pattern in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11675</guid>
      <link>http://www.phpdeveloper.org/news/11675</link>
      <description><![CDATA[<p>
In <a href="http://codeutopia.net/blog/2009/01/05/decoupling-models-from-the-database-data-access-object-pattern-in-php/">this new post</a> to his blog <i>Jani Hartikainen</i> looks at implementing the Data Access Object pattern in your PHP applications.
</p>
<blockquote>
The advantage of this is that you can easily implement different methods to persist objects without having to rewrite parts of your code. I'm again going to use the programming language quiz game I wrote as an example. Since I initially wrote it to use Doctrine ORM directly, and both the old and new code are available, you can easily see how the code was improved.
</blockquote>
<p>
He starts off with a look at the pattern itself (including a diagram of how an example would work with Doctrine) followed by the creation of the models for his Questions example. Add in the factory to create an instance and an exmaple of it in action and you're there.
</p>]]></description>
      <pubDate>Mon, 05 Jan 2009 21:22:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Decoupling the Validation of Data with Bridge Classes in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/7074</guid>
      <link>http://www.phpdeveloper.org/news/7074</link>
      <description><![CDATA[<p>
DevShed has posted <a href="http://www.devshed.com/c/a/PHP/Decoupling-the-Validation-of-Data-with-Bridge-Classes-in-PHP-5/">part two</a> of their look at working with bridge classes in PHP5, looking in detail at the decoupling of the data validation from an input form.
</p>
<blockquote>
In the course of this second tutorial, I'm going to show you how to create a bridge class which will come in handy for decoupling the validation of user-supplied data. There will be a class that defines generically how certain data must be verified, while others will implement different validation methods.
</blockquote>
<p>
They start with building a simple bridge class, a validator class that defines methods to check strings, numbers, alphabetic, and email values. For each of these types, they create the corresponding bridge class that validates the input. Finally, they tie it all together, validating an example of each, handled inside of try/catch blocks to watch for the errors that might be thrown.
</p>]]></description>
      <pubDate>Wed, 10 Jan 2007 14:03:00 -0600</pubDate>
    </item>
  </channel>
</rss>
