<?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>Wed, 19 Jun 2013 02:18:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Eric Hogue's Blog: Late Static Binding]]></title>
      <guid>http://www.phpdeveloper.org/news/16235</guid>
      <link>http://www.phpdeveloper.org/news/16235</link>
      <description><![CDATA[<p>
<i>Eric Hogue</i> has a <a href="http://erichogue.ca/2011/04/14/late-static-binding/">recent post to his blog</a> looking at one of the more tricky aspects of the latest versions of PHP (the 5.3.x series) - late static binding. In a nutshell, late static binding (LSB) lets static classes and methods work more correctly than before. <i>Eric</i> gets into a bit more detail than that:
</p>
<blockquote>
It came out almost 2 years ago, but it to me that many programmers around me have no idea about it. Myself, I have learned about it around 6 months ago. The PHP documentation defines late static binding as a way to "reference the called class in a context of static inheritance." This definition didn't really help me the first time I read it. Fortunately, there are more explanations in the documentation, and there are good examples. If you haven't, you should read it.
</blockquote>
<p>
To clarify, he includes a code snippet showing the use of the "static" keyword to correctly reference a static method. He also includes in interesting bit about when's a good time to use it.
</p>]]></description>
      <pubDate>Fri, 22 Apr 2011 09:14:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[P&aacute;draic Brady's Blog: The Factory and Abstract Factory patterns in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5657</guid>
      <link>http://www.phpdeveloper.org/news/5657</link>
      <description><![CDATA[<p>
Recently, P&aacute;draic Brady had to explain some of the design patterns, specifically the Factory and Abstract Factory patterns, to someone (or a group of someones) in his day to day business. To help make it easier for other people out there looking for the same information, he's <a href="http://blog.quantum-star.com/index.php?/archives/215-The-Factory-and-Abstract-Factory-patterns-in-PHP.html">posted what he said</a> on his blog today.
</p>
<p>
First, he talks about the Factory pattern:
</p>
<blockquote>
At some point in developing, developers will discover a need to support switching among various methods of performing an action. The example I used in a forum post earlier was Database Abstraction. Say for a moment you want to separate all the logic needed to create an Abstraction object (say using ADOdb Lite) into a central place for easier control. At this point the Factory Pattern starts rearing its head.
</blockquote>
<p>
Of course, a bit of sample code is given to illustrate the point, creating the instance of an ADOdb object.
</p>
<p>
Next up is the Abstract Factory pattern - the difference being that these make it easy to switch between Factories using different resource (such as his example to switch between ADODB and PDO).
</p>
<blockquote>
In these cases, we will have multiple Factories. However instead of one generically named Factory, we will have several specific Factories. This should (eventually) lead us to impose a parent class, which will allow duplicated code from each specific DatabaseAbstractionFactory to be moved up to the common parent class.
</blockquote>
<p>
Just as before, they <a href="http://blog.quantum-star.com/index.php?/archives/215-The-Factory-and-Abstract-Factory-patterns-in-PHP.html">provide example code</a> to illustrate the use of this slightly different pattern.
</p>]]></description>
      <pubDate>Thu, 22 Jun 2006 07:25:51 -0500</pubDate>
    </item>
  </channel>
</rss>
