PHP
  Home arrow PHP arrow Creating a MySQL Abstraction Layer wit...
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

Creating a MySQL Abstraction Layer with Bridge Classes in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-01-17

    Table of Contents:
  • Creating a MySQL Abstraction Layer with Bridge Classes in PHP 5
  • Creating the first abstraction layer for MySQL
  • Creating a bridge class with PHP 5
  • Putting the MySQL abstraction layer 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


    Creating a MySQL Abstraction Layer with Bridge Classes in PHP 5


    (Page 1 of 4 )

    If learning how to incorporate creational design patterns into your own PHP 5 applications is a high-priority topic for you, then this set of comprehensive articles might be what you’re looking for. Welcome to the concluding installment of the series “Using Bridge Classes with PHP 5.” These tutorials will teach you how to implement the bridge pattern in PHP by providing you with many hands-on examples that can be included in your existing and future web projects.

    Before I move on and pay attention to the subject of this final article, first I'd like to refresh, at least quickly, some topics that were covered with detail in the preceding part of the series. As you'll certainly recall, in the previous tutorial I extended the implementation of the bridge pattern with PHP 5, by defining a bunch of straightforward classes, which when used in conjunction, followed the principles dictated by the mentioned pattern.

    Speaking more specifically, I created a bridge class called "BridgeDataValidator" which defined the generic structure of a data validation object. This is handy for checking different types of user-provided input. However, the most relevant aspect of this schema rested on the capacity offered by the referenced class to create distinct data validator objects. These objects implemented concretely the required logic for checking numbers, alphabetic values, and email addresses.

    Naturally, the data validation objects were conceived as independent structures, which resulted in the complete decoupling of the "BridgeDataValidator" class from its own implementation. Of course, if you're familiar with how the bridge pattern works, then you'll realize that all the classes that I developed in the previous tutorial precisely followed that model.

    Now that I hopefully refreshed the topics that were treated in the preceding article of the series, it's time to focus your attention on the current one. The question that comes up now is the following: is there anything else that can be said about the bridge pattern? Of course there is! In this final tutorial I'm going to show you how to create a highly expandable abstraction layer that will allow you to work with MySQL using different libraries. This sounds interesting, right?

    Having introduced the subject of this installment, let's leap forward and discover together how to build a MySQL abstraction layer, in this case using the bridge pattern. Let's get going!

    More PHP Articles
    More By Alejandro Gervasio


       · In this article of the series, you'll learn how to use the bridge pattern to build...
       · OR you can save your time and effort and use something already...
       · Thank you for commenting here, but certainly the goal of the article is to...
       · Hi AlejandroThanks again not only can I see clearly how you implemented this...
       · Hi Jon,Thank you again for posting your comments on my PHP article, since I find...
     

       

    PHP ARTICLES

    - 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
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





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