PHP
  Home arrow PHP arrow The Singleton and Factory Patterns in ...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

The Singleton and Factory Patterns in PHP: designing an object factory
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2005-11-09

    Table of Contents:
  • The Singleton and Factory Patterns in PHP: designing an object factory
  • The first step within the development process: coding form element classes
  • Finishing the round: listing the rest of form element classes
  • The Factory Pattern in action: developing the "formElementFactory" class
  • Instantiating form element objects: a simple use of the form element factory

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Singleton and Factory Patterns in PHP: designing an object factory


    (Page 1 of 5 )

    This article, the second part of a series, is focused on implementing the Factor Pattern by designing a form element factory.

    Introduction

    This is the second part of the series "The Singleton and Factory Design Patterns in the real world." Welcome back. Throughout the first part of the series, I provided you with an overview of building object-oriented forms using two popular design patterns: the Singleton and the Factory patterns.

    At this point, I assume that these aren't foreign concepts to you, since they were reviewed in the first part. Just in case  you don't feel very seasoned with patterns, you should start by reading my previous article, where I offered a friendly introduction to them.

    If you're used to writing a lot of repetitive code to build your web forms, probably you've found the technique that I previously explained to create forms, based on an object-oriented approach, quite interesting. Due to the advantages inherent in this method, form generation can be translated into a flexible and straightforward process that strongly encourages code re-use.

    Focusing again on the objective of this series, this second part is aimed specifically at implementing the Factory Pattern, by designing a form element factory, which will be tasked with building regular form components, in this way abstracting the rendering process for each element.

    Essentially, the article is intended to provide a practical step-by-step guide to apply design patterns in real world conditions, such as form design an implementation, by attending the requirements that most developers must face on a frequent basis.

    Thus, it's time to go deeper into the object-oriented form generation method. Let's go!

    More PHP Articles
    More By Alejandro Gervasio


       · The second installment of the series goes one step futher into the explanation of...
       · Please provide a link (URL) to the first part of the 2 part...
       · You can find the first part here:...
       · Hello David,Thank you for reading the article. You can read the first tutorial by...
       · Your textarea class is lacking a closing tag.Your textarea tag looks like this:...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT