PHP
  Home arrow PHP arrow Introducing Builder Objects in PHP 5
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

Introducing Builder Objects in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2006-10-04

    Table of Contents:
  • Introducing Builder Objects in PHP 5
  • Building basic XML documents: definition of the target object
  • Of builders and XML pages: the programmatic creation process
  • Taking control of the process: a director class
  • Putting all the classes to work together

  • 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


    Introducing Builder Objects in PHP 5


    (Page 1 of 5 )

    In this article, the first of a three-part series, you will be introduced to the basics of creating directors and builder objects with PHP 5. As usual, there will be copious examples to help you quickly start using the builder pattern in your own PHP projects.

    Introduction

    In PHP, as with many other trusted programming languages out there, there are many ways to establish diverse relationships between objects during the development of an application. This concept has an immediate implementation in well-known circumstances within the context of object-based programming, particularly in those cases where both aggregation and composition play a relevant role.

    More specifically, if you’ve been using classes inside your PHP applications for a while, then you’ll know that there are several programming environments where a particular object isn’t completely independent. It requires the “assistance” of one or many additional objects to perform a given task.

    As I expressed earlier, composition and aggregation are clear examples of well-defined object interaction, but they're definitely not the only ones that exist in the object-based universe. Even without having a thorough theory that backs you up (using only your common sense), certainly you can conceive of numerous ways for two or more objects to perform a mutual (and productive) interaction, with no need to read thick books on object-oriented programming.

    Now, and particularly when using PHP 5, I’d like to introduce a concept that’s strongly related to a specific interaction between multiple objects. In this case, I’m talking about directors and builder objects, which when evaluated in conjunction, conform to what is commonly known as the “builder” pattern. But right now you’re probably wondering how the builder pattern works.

    Well, to put things in a simple perspective, when the builder pattern is applied, two objects are put into action to create a third one. First, these two objects create a director; as its name suggests, the director controls all aspects of the creation process and determines what pieces and modifications will be introduced into the target object. Finally, a builder is tasked with constructing the third object in question, in accordance with particular specifications. Sounds fairly simple, doesn’t it?

    Since you might have to address specific issues by applying the mentioned builder pattern eventually, in this series you’ll learn how to use it, and of course how to get the most out of it.

    Are you ready to learn more on how to use directors and builder objects in PHP? Let’s get started!

    More PHP Articles
    More By Alejandro Gervasio


       · In this first article of the series, you will learn the basics of working with...
     

       

    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 1 hosted by Hostway
    Stay green...Green IT