PHP
  Home arrow PHP arrow Developing a Form Validation System with the Observer Pattern in PHP
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

Developing a Form Validation System with the Observer Pattern in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2006-07-24


    Table of Contents:
  • Developing a Form Validation System with the Observer Pattern in PHP
  • Validating input data: constructing some useful data validation classes
  • Extending the scope of data validation: defining some additional data checking classes
  • Getting the whole picture: listing the full source code for the data checking 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


    Developing a Form Validation System with the Observer Pattern in PHP
    ( Page 1 of 4 )

    Want to gain a good grounding in how to apply the Observer pattern in PHP? Then you’re in the right place! Welcome to the second part of the series “The Observer Pattern in PHP.” Composed of three tutorials, this series teaches you the key concepts of the popular Observer design pattern, and shows you how to apply it in the context of real-world PHP applications.

    Introduction

    Okay, after introducing the topics treated over the course of this series, let’s quickly recapitulate the concepts that I deployed in the first tutorial so you can understand this second article more easily.

    As you’ll hopefully remember, in the previous part I went through the implementation of the Observer pattern in PHP 5 by coding a basic example. The example demonstrated in an easygoing fashion how the different objects that make up a specific program can be decoupled from the rest of the application, in this way clearly delineating their scope.

    Regarding this particular example, the implementation of the Observer pattern allowed me to develop a message handling system capable of reflecting certain changes generated by independent objects at the application’s core level. Indeed, the application of this pattern is one of the best approaches available today for constructing truly independent objects, as well as building systems that expose a centralized mechanism for making decisions according to the changes introduced by disparate components.

    Well, after refreshing some of the most important points regarding the creation of observer objects, let’s focus our attention on the subject of this second tutorial. Over the next few lines, I’ll be demonstrating how to apply the Observer pattern during the development of a real-world application: a form validation system.

    Based on this approach, hopefully you’ll learn quickly how to validate input data by using the Observer pattern. Are you interested in learning how this can be achieved with PHP? Fine, start right now reading the next section!



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

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - 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





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