PHP
  Home arrow PHP arrow Handling File Data with the Facade Pattern in PHP 5
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? 
PHP

Handling File Data with the Facade Pattern in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      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


    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
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT