<?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>Fri, 21 Nov 2008 21:28:31 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DotNetButchering: Design Patterns you use without knowing them]]></title>
      <guid>http://www.phpdeveloper.org/news/11133</guid>
      <link>http://www.phpdeveloper.org/news/11133</link>
      <description><![CDATA[<p>
From the DotNetButchering blog there's <a href="http://dotnetbutchering.blogspot.com/2008/02/design-patterns-oop-php-design-patterns.html">a recent post</a> looking at design patterns, more specifically ones you might be using and you don't even know it.
</p>
<blockquote>
Rise your hands if time ago (or even now) you stood literally in trance listening to your friends or colleagues talking about design patterns. [...] Anyway I felt better (and also my ego did) when I found those Design Patterns were no more than ways to solve common programming problems, and as I was programming since 2 or 3 years, I had already discovered some of them myself.
</blockquote>
<p>
He points out two patterns - the strategy and factory patterns - and gives code examples (and UML diagrams) to show how they work.
</p>]]></description>
      <pubDate>Thu, 02 Oct 2008 10:28:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImpact Blog: Static Factories vs Public Constructors]]></title>
      <guid>http://www.phpdeveloper.org/news/10638</guid>
      <link>http://www.phpdeveloper.org/news/10638</link>
      <description><![CDATA[<p>
On the PHP::Impact blog <i>Federico Cargnelutti</i> has <a href="http://phpimpact.wordpress.com/2008/07/17/static-factories-vs-public-constructors/">posted a comparison</a> of using static factory methods to create an instance of a class versus making an object, calling the constructor.
</p>
<blockquote>
Normally, creating an instance of a class is done by calling new, which calls the constructor. Static factory provides a static method that returns an instance of the class. So, you are using static factory instead of the constructor. Providing a static factory method instead of a public constructor has both advantages and disadvantages.
</blockquote>
<p>
He includes some of the advantages of the factory method and others for the normal call to create an object. He also mentions some comments made by <i>Dagfinn Reiersol</i> in <a href="http://www.reiersol.com/blog/1_php_in_action/archive/34_public_constructors_considered_harmful.html">a blog post</a> about public constructors.
</p>]]></description>
      <pubDate>Fri, 18 Jul 2008 12:58:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kurt Schrader's Blog: Ruby is a Playground, PHP is a Factory ]]></title>
      <guid>http://www.phpdeveloper.org/news/10255</guid>
      <link>http://www.phpdeveloper.org/news/10255</link>
      <description><![CDATA[<p>
In a <a href="http://kurt.karmalab.org/articles/2008/05/21/ruby-is-a-playground-php-is-a-factory">new post</a> to his blog, <i>Kurt Schrader</i> suggests that the Ruby language feels more like a playground to him and PHP, more of a factory. (note: pro-Ruby article)
</p>
<blockquote>
While reading yet another article on why <a href="http://www.codinghorror.com/blog/archives/001119.html">PHP Sucks (today's witty twist, "but It Doesn't Matter")</a> I realized yet another reason that I'm glad to be programming in Ruby.
</blockquote>
<p>
He sees Ruby as a "big open playground" and languages like PHP as big industrial factories that are more efficient for some things but can also "suck the creativity and life out of the people working in them". He compares a simple bit of Ruby code to PHP code that do essentially the same ask asks why you'd want to do one over the other.
</p>
<p>
There's plenty of <a href="http://kurt.karmalab.org/articles/2008/05/21/ruby-is-a-playground-php-is-a-factory#comments">comments</a> supporting things both ways ranging from "that's a bad example" to "I think PHP is more of a playground - a disorganized mess".
</p>]]></description>
      <pubDate>Fri, 23 May 2008 10:22:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Handling Static Data with PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/8633</guid>
      <link>http://www.phpdeveloper.org/news/8633</link>
      <description><![CDATA[<p>
On DevShed, there's a <a href="http://www.devshed.com/c/a/PHP/Handling-Static-Data-with-PHP-5/">new tutorial</a> that talks about the other half of working with dynamic websites - working with the static content:
</p>
<blockquote>
It's pretty common when using PHP to develop dynamic, object-oriented applications. Every so often, though, you need to work with static data. This article will explain how to work with static data and static properties, and show you how this ability can be useful in real-world situations.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Handling-Static-Data-with-PHP-5/">show how</a> to create dynamic divs for your content, "factoring" them (creating them with a Factory design pattern) and an example of it all working together.
</p>]]></description>
      <pubDate>Tue, 11 Sep 2007 14:33:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Factoring Content Boxes with the Factory Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/8206</guid>
      <link>http://www.phpdeveloper.org/news/8206</link>
      <description><![CDATA[<p>
DevShed finishes off their look at using the Factory design pattern in a PHP5 application with <a href="http://www.devshed.com/c/a/PHP/Factoring-Content-Boxes-with-the-Factory-Pattern-in-PHP-5/">this last part</a> of the series - using the pattern in factoring content boxes on your site.
</p>
<blockquote>
I'd like to put the tiny details of the factory pattern to the side (at least momentarily) and introduce the topics that I plan to cover in this final article of the series. In this last tutorial I'm going to teach you how to implement this useful pattern to build a bunch of highly-customizable content boxes, which can be quickly included into any web page.
</blockquote>
<p>
Building on the foundation from <a href="http://www.phpdeveloper.org/news/8164">previous</a> <a href="http://www.phpdeveloper.org/news/8126">parts</a> of the series, they create the different boxes with different types (like GreyContentBox and BlueContentBox based on ContentBox) and displaying them to a page via calls to their Factory interfaces.
</p>]]></description>
      <pubDate>Mon, 09 Jul 2007 14:36:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Handling Cookies and File Data with the Factory Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/8164</guid>
      <link>http://www.phpdeveloper.org/news/8164</link>
      <description><![CDATA[<p>
Continuing on with their look at the Factory Pattern (<a href="http://www.phpdeveloper.org/news/8126">part one</a>), DevShed has <a href="http://www.devshed.com/c/a/PHP/Handling-Cookies-and-File-Data-with-the-Factory-Pattern-in-PHP-5/">part two</a> posted - a look at applying what was learned previously into a simple cookie-handling and file manipulation script.
</p>
<blockquote>
At this stage you should have a more accurate idea of how to include the factory pattern into your own PHP applications, at least at a very basic level. But don't you worry because this scenario is going to change quickly, since in this second tutorial I'm going to teach you how to take advantage of the capacity offered by the pattern to create objects that are capable of saving data to different locations, including files and cookies.
</blockquote>
<p>
<a href="http://www.devshed.com/c/a/PHP/Handling-Cookies-and-File-Data-with-the-Factory-Pattern-in-PHP-5/">The tutorial</a> starts off by creating the classes needed to save strings and objects based off of the abstract DataSaverFactory class. On top of this, they build the classes to save the cookies and work with the files using the Factory objects.
</p>]]></description>
      <pubDate>Mon, 02 Jul 2007 12:56:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: The Basics of Using the Factory Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/8126</guid>
      <link>http://www.phpdeveloper.org/news/8126</link>
      <description><![CDATA[<p>
DevShed revisits its series on using design patterns in PHP applications with <a href="http://www.devshed.com/c/a/PHP/The-Basics-of-Using-the-Factory-Pattern-in-PHP-5/">this new tutorial</a>, a look at implementing the Factory pattern in PHP 5.
</p>
<blockquote>
Summarizing, the factory pattern can be really useful when it comes to creating multiple objects that belong to the same family. In this three-part series I'm going to take a close look at it, and also demonstrate its remarkable functionality by showing you a decent variety of code samples, so you can start quickly including this pattern into your own PHP applications.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/The-Basics-of-Using-the-Factory-Pattern-in-PHP-5/">lay the foundation</a> by creating some basic factory classes for working with numeric and associative arrays. On top of this, they create the processing classes to create things like uppercase numeric arrays and lowercase associative arrays. Finally, they give examples of how to put it to use making several different sorts of arrays, including their output.
</p>]]></description>
      <pubDate>Tue, 26 Jun 2007 11:07:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Hasin Hayder's Blog: Using ActiveRecord Library Separately from CodeIgniter]]></title>
      <guid>http://www.phpdeveloper.org/news/8039</guid>
      <link>http://www.phpdeveloper.org/news/8039</link>
      <description><![CDATA[<p>
On his blog today, <i>Hasin Hayder</i> has a <a href="http://hasin.wordpress.com/2007/06/13/using-activerecord-library-separately-from-codeigniter/">quick tutorial</a> on using one of the features of the CodeIgniter framework outside of it - the ActiveRecord library.
</p>
<blockquote>
CodeIgniters ActiveRecord library is a nice implementation (though modified) of ActiveRecord design pattern. It comes bundled with CodeIgniter. So if you want to use Just this library in your application individually instead of using full CodeIgniter framework, what to do?
</blockquote>
<p>
<a href="http://hasin.wordpress.com/2007/06/13/using-activerecord-library-separately-from-codeigniter/">His solution</a> uses an abstraction layer (ActiveRecordFactory) to handle any issues with interfacing to CodeIgniter's class. He's also included the code (and <a href="http://hasinhayder.net/ActiveRecord.zip">a download</a) in the post as well as an example of it in use.
</p>]]></description>
      <pubDate>Wed, 13 Jun 2007 11:53:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[P&aacute;draic Brady's Blog: Complex Views with the Zend Framework - Part 4: The View Factory]]></title>
      <guid>http://www.phpdeveloper.org/news/7756</guid>
      <link>http://www.phpdeveloper.org/news/7756</link>
      <description><![CDATA[<p>
<i>P&aacute;draic Brady</i> continues his look at complex views in <a href="http://blog.astrumfutura.com/archives/285-Complex-Views-with-the-Zend-Framework-Part-4-The-View-Factory.html">a new blog post</a> today (carrying on from parts <a href="http://www.phpdeveloper.org/news/7662">one</a>, <a href="http://www.phpdeveloper.org/news/7674">two</a>, and <a href="http://www.phpdeveloper.org/news/7724">three</a>. This time, the focus is on creating multiple objects on the page via Zend_View (encapsulation).
</p>
<blockquote>
<p>
Zend_View is rather a complex class to instantiate. Not only does it have optional settings, it also requires path information in order to locate it's templates, helpers and filters.
</p>
<p>
[...] In this blog entry I'll present a class (the Factory) dedicated to churning out any number of Zps_View (subclass of Zend_View) objects using a class called Zps_View_Factory. To make things more interesting we'll also centralise all those default settings a View might require into a configuration file which our Factory will be able to use.
</p>
</blockquote>
<p>
He <a href="http://blog.astrumfutura.com/archives/285-Complex-Views-with-the-Zend-Framework-Part-4-The-View-Factory.html">start with</a> the UML diagram of how things will fit together once the system is in place (Zps_View_Factory, Zps_View_Factory_Interface, and Zps_View). Then it's on to the sample code - creating the factory in the bootstrap file and making some simple objects.
</p>]]></description>
      <pubDate>Wed, 02 May 2007 11:45:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Using Abstract Factory Classes in PHP 5 to Work with Online Forms]]></title>
      <guid>http://www.phpdeveloper.org/news/7242</guid>
      <link>http://www.phpdeveloper.org/news/7242</link>
      <description><![CDATA[<p>
DevShed has posted the <a href="http://www.devshed.com/c/a/PHP/Using-Abstract-Factory-Classes-in-PHP-5-to-Work-with-Online-Forms/">final installment</a> of their series looking at the creation and use of the Abstract Factory pattern. In this new part, they focus on the creation of online forms and their handling as the pattern is applied.
</p>
<blockquote>
In this last installment of the series, I'm going to show you how to use an abstract factory class to create distinct types of form objects, logically depending on the context where they will be utilized. The idea not only sounds interesting, but it can provide you with a better understanding of how this handy pattern can be used in a real situation.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Using-Abstract-Factory-Classes-in-PHP-5-to-Work-with-Online-Forms/">start by defining</a> their abstract factory form class and extending it to create a required form element and a normal form element. They make input functions for each - required input box, required radio button, required check box - and their "Normal" counterparts. Finally, they tie these all together to create a simple form with sets of an input box, radio set, and checkboxes both required and normal.
</p>]]></description>
      <pubDate>Thu, 08 Feb 2007 08:28:00 -0600</pubDate>
    </item>
  </channel>
</rss>
