Zend
  Home arrow Zend arrow Build Database Interfaces
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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? 
ZEND

Build Database Interfaces
By: Zend
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 10
    2004-01-04

    Table of Contents:
  • Build Database Interfaces
  • Replacement Example
  • Lessen the Impact
  • Autonomous

  • 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

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Build Database Interfaces
    (Page 1 of 4 )

    This article is about using and building Database Interfaces (DB interfaces). DB interfaces make application development faster and easier. This is accomplished by relocating scattered DML (Insert, Update, Delete) statements into a single shared tool, the Class. A Class encapsulates data post processing, integrity, and security into a single tool that can be accessed throughout the application.

    Over the past couple of years many tools have been developed to address the limitations of PHP when building large database applications. These tools can be divided into two categories:

    • Database Abstraction
    • HTML Generation

    DB Interfaces are a new category of tools that sits between the application logic and the database logic.

    The Big Picture
    PHP was designed to be a “quick and simple” tool for making web pages dynamic. However, it does not scale well to building full-blown applications without a lot of planning and design. While PHP can make building a solitary web page “quick and simple”, applications often become ‘quick and dirty’.

    When an application reaches a certain size, the rules change about how it should be built. The design rules for a single HTML page with some embedded PHP are much different from a 15,000 line PHP application. As the complexity of an application grows, manageability decreases. Although PHP is designed to be embedded into HTML, this ability becomes inhibiting as the application becomes more complex.

    Embedded SQL suffers from the same limitations as imbedded PHP. As application size grows, maintainability becomes more difficult.

    The Solution
    Separating the three common components of PHP applications is the best solution. The common components are:

    • A database
    • The PHP logic
    • The layout (in HTML)
    Tools such as ADODB and Smarty are commonly used to aid this separation. ADODB makes it easier for applications to support different databases systems. Smarty separates the display logic and HTML from the application logic.

    A more manageable solution is using a Database interface to communicate with the database. DB Interfaces separate the database logic from the application logic. By using a DB interface, DML operations are separate from the logic flow, which makes code easier to work with.

    It is best to use a database interface to handle the DML operations on a table. By using a database interface to provide a single point of data modification, a finer level of security and data integrity can be achieved.

    More Zend Articles
    More By Zend


     

       

    ZEND ARTICLES

    - Taking the Zend Certified PHP Engineer Exam:...
    - Quick Introduction to PHP 5
    - PHP SOAP Extension
    - Improving Performance
    - PDFs with PHP part 2
    - PDFs with PHP part 1
    - PHP at Lycos
    - Build Database Interfaces

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway