PHP
  Home arrow PHP arrow Centralizing the Validation of Data wi...
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 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
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: 5 stars5 stars5 stars5 stars5 stars / 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:
      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


    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


       · This last article of the series is focused on getting the form validation system...
       · I have enjoyed all your articles and continue to read them. I tried to implement...
       · Hello Cranium,Thank you for your commenting on this PHP article. Concerning your...
       · Thank you for replying back so quickly. I changed line 94 to what you showed, but...
       · Hello again Cranium,The error you're getting it's because the $_POST[$formVar]...
       · Hi Alejandro,I appreciate all you help on this. I changed the line to the...
       · Hello again Cranium,It seems that you're having additional problems with the...
       · I have done some testing by watching the flow of the output and printing to screen. ...
       · Hi Cranium again,As I posted above, it's hard to see what's wrong with your...
       · I sent to the e-mail that is listed when clicking on your name by an article; it is...
       · Hi Scot,I emailed you the solution.Regards.
       · Very good series again. Thanks!
       · Hi friend,Thank you for the kind comments om my PHP article.Regards.
       · In regards to the problem anonymous had before and your suggestion:If you...
       · Hello Matthijs agin,Thank you for your feedback concerning this PHP article. The...
       · Alejandro,Thank you for authoring content that I would expect to see in a...
       · Hello Larry,I'd like to thank you for the compliments on my PHP article, as well...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





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