PHP
  Home arrow PHP arrow Handling File Data with the Facade Pat...
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

Handling File Data with the Facade Pattern in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2007-01-23

    Table of Contents:
  • Handling File Data with the Facade Pattern in PHP 5
  • Using the facade pattern to handle file data
  • Applying the facade pattern to a string processor
  • 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


    Handling File Data with the Facade Pattern in PHP 5


    (Page 1 of 4 )

    Are you interested in learning the foundations of different structural patterns in PHP 5? If your answer is affirmative, then you should start reading this article immediately! Welcome to the last installment of the series “Introducing the Facade Pattern in PHP 5.” In two consecutive articles, this series shows you how to create and use facade classes in PHP-based development environments.

    Introduction

    As you know, PHP 5 allows you to create web applications that implement a diverse range of design patterns, logically including that one called “facade.” If you’ve not yet read the first part of this series and don’t know what this pattern is about, then let me offer you a brief introduction.

    Essentially, in the facade pattern a class is created in such a way that it’s able to hide all the complexity inherent to a given mechanism, in order to perform a specific task. This mechanism (usually comprised of one or more classes) is completely independent from the calling class, and knows nothing about it. As you might guess, even though this theoretical definition may sound a bit complex, the truth is that creating facade classes with PHP 5 is an easy process.

    To clarify possible questions on how this pattern works, in the first part of the series I worked in a step-by-step format to define a simple façade class. The class was capable of compressing a diverse range of contents, including all the source code created by a web page generator class.

    The most important part of this facade class was logically the one related to hiding all the complexity involved in compressing the (X)HTML output of different web documents by using a pair of additional classes. In accordance with the logic dictated by the pattern, these supporting classes were entirely independent of the facade. They were tasked only with compressing any number of input strings passed as parameters to a specific method.

    Now that you hopefully recalled the topics covered in the preceding article, it’s time to pay attention to the subject of this one. I’m going to continue demonstrating the application of the facade pattern, this time by developing yet another illustrative application. It will take care of processing the contents of a selected data file in different ways.

    So how does a facade class fit into this schema? Start reading to find out!

    More PHP Articles
    More By Alejandro Gervasio


       · In this final article of the series, another example on how to implement the facade...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - 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





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