PHP
  Home arrow PHP arrow Factoring Content Boxes with the Facto...
Click Here
Dev Shed Forums 
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
SunQuest
 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

Factoring Content Boxes with the Factory Pattern in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2007-07-09

    Table of Contents:
  • Factoring Content Boxes with the Factory Pattern in PHP 5
  • Factoring web page content boxes
  • Building different types of content boxes
  • Displaying web page content boxes via the factory pattern

  • 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

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Factoring Content Boxes with the Factory Pattern in PHP 5


    (Page 1 of 4 )

    Working with factory classes is a rather common process for many PHP developers who build object-based applications on a frequent basis. If you want to find out how to make this helpful class work for you, then this group of articles might be what you need. Welcome to the final installment of the series that began with "Using the Factory Pattern in PHP 5." In three parts, this series goes through the key concepts of implementing the factory pattern with PHP, and complements theory with numerous and educational code samples.

    Introduction

    Now that I have introduced the subject of this series, let me remind you of some of the most important topics covered in the previous tutorial. As you learned earlier, implementing the factory pattern using an extremely friendly scripting language like PHP is actually a no-brainer process that can be performed with minor hassles.

    Creating a simple yet effective factory class, which can be easily provided with the capacity for spawning multiple objects across a given application, is a procedure reduced to something as basic as defining a method for the class in question that has the ability to return to client code a certain type of object, according to the specifications of a determined context.

    Besides, as I clearly demonstrated by the copious hands-on examples included in the two previous tutorials of the series, working with only one instance of the factory class is an issue that can be addressed by different approaches. These include applying the Singleton pattern, or even better, calling statically its factory method.

    Now that I mentioned it, I used this last approach with all the code samples shown so far; it's one of the most effective techniques utilized by many PHP programmers. It allows you to create specific objects without having to deal with a concrete instance of a factory class.

    However, I'd like to put the tiny details of the factory pattern to the side (at least momentarily) and introduce the topics that I plan to cover in this final article of the series. In this last tutorial I'm going to teach you how to implement this useful pattern to build a bunch of highly-customizable content boxes, which can be quickly included into any web page.

    Now that you know what this article is about, let's move on together and learn how to build these popular and handy elements of today's web development by using the functionality provided by the factory pattern. Let's get started!

    More PHP Articles
    More By Alejandro Gervasio


       · In this final part of the series, the popular factory pattern is used to create...
       · Short and Simple! Thanks!However, I would like to point out that since all...
       · First off, I'd like to thank you for commenting on my PHP article. Now, with regard...
       · Thank you for commenting on my PHP article, as well as for all the useful sugestions...
     

       

    PHP ARTICLES

    - Viewing and Editing Tasks for a Project Mana...
    - More on Private Methods with PHP 5 Member Vi...
    - Adding Tasks to a Project Management Applica...
    - Utilizing Private Methods with PHP 5 and Mem...
    - Making Changes in a Project Management Appli...
    - Defining Public and Protected Methods with M...
    - HTML for a Project Management Application
    - Using Subclasses and Accessors with Member V...
    - Implementing Internet Protocols with PHP
    - Project Management: The Application
    - Working with Private Properties to Protect P...
    - Protecting PHP 5 Class Data with Member Visi...
    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery

    SunQuest




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