PHP
  Home arrow PHP arrow Working with Strings and the Composite...
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 
Moblin 
JMSL Numerical Library 
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

Working with Strings and the Composite Pattern in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-03-14

    Table of Contents:
  • Working with Strings and the Composite Pattern in PHP 5
  • Handling strings of data
  • Defining the SingleStringProcessor and MultipleStringProcessor classes
  • 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


    Working with Strings and the Composite Pattern in PHP 5


    (Page 1 of 4 )

    Are you a PHP developer who wants to improve your skills in pattern-based programming in PHP? If the answer to this question is an emphatic yes, then you should begin reading this article now! Welcome to the final part of the series “Implementing the composite pattern with PHP 5.” Comprised of two instructive tutorials, this series walks you through the basic concepts of this important design pattern, and shows you how to apply it with some educational examples.

    Introduction

    Before I move forward and tell you about the topics that I plan to cover in this final installment of the series, first I’d like to revisit briefly the concepts deployed in the preceding article. This will give you a better idea of how both tutorials are linked to each other.

    As you’ll certainly remember, in the first part of the series I introduced the foundations of the composite pattern, and also explained in detail how it could be applied. To quickly review its theoretical definition, in the composite pattern, one object or a set of objects will behave similarly across an application, regardless of the context where they will be used.

    Of course, bearing in mind that the previous definition is in fact quite confusing, I demonstrated the application of the pattern in question by setting up a testing example. The example showed how two different file reading classes were able to generate nearly identical outputs, regardless of whether they used one or multiple file handling objects.   

    However, I believe that the example that I mentioned previously isn’t good enough to give a reader a decent background on how this pattern works. Thus, since this series is aimed at mastering the basic concepts of the composite pattern, in this final article I’m going to demonstrate how to use it to handle strings of data.

    By the end of this article, you should have a more solid foundation on how to apply the pattern in question as part of your own PHP applications.

    With the preliminaries out of the way, let’s continue learning more about the composite pattern. Let’s get going!

    More PHP Articles
    More By Alejandro Gervasio


       · In this second (and final) article of the series, the composite pattern is...
     

       

    PHP ARTICLES

    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application





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