PHP
  Home arrow PHP arrow Using Abstract Factory Classes in PHP 5 to Work with Online 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? 
Google.com  
PHP

Using Abstract Factory Classes in PHP 5 to Work with Online Forms
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    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:
      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


    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
     

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek