PHP
  Home arrow PHP arrow The Singleton and Factory Patterns in PHP: Building object-oriented forms
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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: Building object-oriented forms
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 29
    2005-11-02


    Table of Contents:
  • The Singleton and Factory Patterns in PHP: Building object-oriented forms
  • When one is better than many: a quick look at the Singleton Pattern
  • Object-oriented forms: applying the Factory pattern to a real application
  • The first approximation to object-based forms: building form element classes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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: Building object-oriented forms
    ( Page 1 of 4 )

    Experienced PHP programmers know that web development problems are often tackled by using widely known design patterns within the context of an application. This article is the first in a series that will demonstrate how the Singleton and Factory patterns can be implemented in a real-world application.

    Introduction

    Many web developers around have started to use extensively object-oriented programming in PHP applications. Due to the fact that this approach requires a radical change in the way that situations are solved within a program, it takes a while to get an intimate grounding in this paradigm.

    Going one step further, for PHP programmers with a certain level of experience, the use of widely known design patterns within the context of an application is definitely a common method for tackling many problems inherent in web development. Since design patterns are key concepts involved in software engineering, mastering them directly implies having a strong knowledge about their theory and practical implementation.

    Of course, through this series, I'm not going to offer a detailed definition of the most used design patterns, since there's all sorts of clever information on the subject in many good books and rich-content articles that thoroughly cover the topic. Instead, the primary goal of this series is to demonstrate how the Singleton and Factory patterns can be implemented in a real-world application, without the need to incur in the use of rather impractical examples.

    If you've read the article's title, surely know what I'm talking about. I'll apply the above mentioned design patterns to building web forms, by utilizing an object-oriented approximation. Hopefully, the overall experience will be useful enough to teach how (X)HTML forms can be created by relying strongly on these two familiar patterns.

    However, if you're just starting to learn about the topic, don't feel concerned. I'll cover briefly the corresponding definition for the Singleton and Factory Patterns, in order to help you clearly understand how they are used. 

    All right, once we've introduced ourselves to the field of design patterns in PHP, it's time to learn more about them. Thus, let's get started.



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





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