PHP
  Home arrow PHP arrow Decoupling the Validation of Data with Bridge Classes in PHP 5
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

Decoupling the Validation of Data with Bridge Classes in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2007-01-10


    Table of Contents:
  • Decoupling the Validation of Data with Bridge Classes in PHP 5
  • Building a bridge validator class
  • Defining a set of bridged classes
  • Putting all the classes 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


    Decoupling the Validation of Data with Bridge Classes in PHP 5
    ( Page 1 of 4 )

    Are you interested in expanding your existing knowledge of different structural design patterns with PHP 5? Then look no further because you’ve come to the right place. Welcome to the second installment of the series “Using Bridge Classes with PHP 5.” This group of three articles walks you through the basics of how to apply the bridge pattern in PHP-based applications, and it also teaches you how to use bridge objects in real world development environments.

    Provided that you already went through the first tutorial of the series, and learned how to create bridge classes with PHP 5, then I’ll assume that the logic that drives the mentioned pattern is quite familiar to you. However, if you’re taking the first steps on this topic, let me give you a brief introduction to how this pattern works, thus the upcoming examples that I plan to include in this article will be much easier to understand.

    Essentially, in the bridge design pattern, a specific class and its respective implementation reside on different class hierarchies, which is accomplished without using an abstract class. As you’ll possibly imagine, this model is very convenient for decoupling the generic structure of the class in question from its concrete definition, since the corresponding implementation is achieved by one or more “bridged” classes.

    To clarify the previous definition, in the preceding article I developed a concrete example in which a bridge class behaved as an intermediate entity for saving a target object to different storage locations. Even when this example didn’t have an immediate application in real situations, it was really useful for demonstrating how the bridge pattern can be applied in PHP 5.

    However, this instructive journey has just started. In the course of this second tutorial, I’m going to show you how to create a bridge class which will come in handy for decoupling the validation of user-supplied data. There will be a class that defines generically how certain data must be verified, while others will implement different validation methods.

    Having explained what this article is about, let’s go ahead and continue learning more about this powerful pattern. Let’s go!



     
     
    >>> 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 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek