PHP
  Home arrow PHP arrow Centralizing the Validation of Data 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? 
PHP

Centralizing the Validation of Data with the Observer Pattern in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 8
    2006-07-31


    Table of Contents:
  • Centralizing the Validation of Data with the Observer Pattern in PHP
  • Going backward: listing the full source code for the form validation classes
  • Notifying the application's core level of validation errors: defining a form observer class
  • Validating forms: putting the form observer class to work

  • 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


    Centralizing the Validation of Data with the Observer Pattern in PHP
    ( Page 1 of 4 )

    Are you looking for an easygoing article that teaches you how to implement the Observer design pattern inside your PHP 5 applications? Your search is finished! Welcome to the last part of the series "The Observer Pattern in PHP." Made up of three articles, this series will show you how to create and work with observer objects, without making you scratch your head while looking at complex code samples.

    Introduction

    For those of you who didn't (yet) read the previous installment of this series, let me explain quickly the topics it covered. To begin with, I gave an accessible explanation of what the Observer pattern is about, and accompanied all the corresponding theory with a straightforward practical example, to help you easily understand how to apply this popular design pattern in your own PHP 5 applications. I'm don't mean to say that you're going to grasp the logic of observer objects in no time, but I firmly believe that a simple example will help you out by pointing you in the right direction.

    Provided that you already know what an observer object is, you'll realize that this pattern is indeed helpful for decoupling disparate objects from the rest of the application. Besides, the pattern will assist you in the development of programming mechanisms aimed at reflecting specific changes produced by several components at the application's core level. This is a highly desired feature, particularly if you're building PHP programs that require the implementation of truly independent objects.

    Right, I hope the concepts that I touched on above are fresh in your mind now, because it's time to continue exploring the advantages of using the Observer pattern in PHP 5. Now, surely you're wondering: how does this story continue? Well, over the course of this last tutorial, I'll be moving the application of observer objects toward the real world, in this case by showing you how to include these objects within a set of form-validation classes. After reading this article, you should be equipped with a decent knowledge of how a form checking application can use the powerful features of this widely-known design pattern.

    Having established the goals for this last installment of the series, it's time to continue learning about observer objects. Let's do it together!



     
     
    >>> 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 1 hosted by Hostway
    Stay green...Green IT