PHP
  Home arrow PHP arrow Using Abstract Factory Classes in PHP ...
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
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

Using Abstract Factory Classes in PHP 5 to Work with Online Forms
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 7
    2007-02-07

    Table of Contents:
  • Using Abstract Factory Classes in PHP 5 to Work with Online Forms
  • Defining an abstract form element factory class
  • Creating context-driven form objects
  • Understanding how the abstract factory pattern works

  • 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


    Using Abstract Factory Classes in PHP 5 to Work with Online Forms


    (Page 1 of 4 )

    Any PHP developer who has worked with pattern-based programming in PHP for a while knows that the abstract factory pattern is useful for building classes that return (to client code) objects whose type depend on the content where they're used. Welcome to the final installment of the series "Using abstract factory classes in PHP 5." If you're interested in learning the key concepts of this helpful pattern, this three-part series will teach you how to apply it by developing numerous educational examples.

    Surely, you'll remember that in the course of the previous article, I demonstrated how to implement the logic that drives the abstract factory pattern to create diverse types of AJAX objects (commonly known as XML HTTP request objects), by defining two concrete factories.

    Naturally, in accordance with the programmatic model established by the pattern in question, this pair of concrete factories would make sure that the correct type of HTTP requester objects would be returned to client code, depending on the context where they'd be used. More specifically speaking, the scenario that I just described demonstrates the remarkable functionality offered by the pattern when it comes to spawning objects that only work correctly in predefined environments.

    So far, I think that all the practical examples that you learned during the two previous articles of the series should give you a more accurate idea not only of how this pattern works, but also how it can be applied in different situations that may be familiar to you.

    However, I wouldn't like to stop here, since the pattern's capacity and functionality really deserve another close look. Therefore, 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.

    Having established the objectives for this final part of the series, let's discover together how to use the abstract factory pattern in PHP 5 to generate web form elements. Let's get started now!

    More PHP Articles
    More By Alejandro Gervasio


       · In this last installment of this series, you'll learn you how to use an abstract...
       · Hi, I am fairly new to PHP. I read the tutorial and I like the use of abstraction...
       · Thank you for posting your comments on my PHP article. Now, concerning your...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway