Zend
  Home arrow Zend arrow Build Database Interfaces
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  
ZEND

Build Database Interfaces
By: Zend
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      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


    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





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek