PHP
  Home arrow PHP arrow Handling Cookies and File Data with th...
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 Cookies and File Data with the Factory Pattern in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2007-07-02

    Table of Contents:
  • Handling Cookies and File Data with the Factory Pattern in PHP 5
  • Saving data using cookies and text files
  • Creating some data saving classes
  • Seeing the factory pattern in action

  • 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 Cookies and File Data with the Factory Pattern in PHP 5


    (Page 1 of 4 )

    Any PHP developer who has been using the object-oriented paradigm for a while for developing web applications knows that the factory design pattern can be really useful when it comes to creating multiple objects across a specific programming context. However, if you're interested in filling some knowledge gaps that you might have about this handy pattern, then this article is possibly what you're looking for.

    Introduction

    Welcome to the second tutorial of the series that began with "Using the Factory Pattern in PHP 5." Made up of three instructive parts, this series walks you through the foundations of developing factory classes with PHP, and also shows you how to implement this popular design pattern in real world situations.

    Now, having properly introduced the subject of this series, let me touch upon what was covered in the preceding article to refresh your memory. As you'll probably recall, I demonstrated in a friendly way how to build a pair of concrete factory classes. These came in useful for spawning different array-processing objects in accordance with the specifications of their corresponding contexts.

    Of course, defining the aforementioned factory classes was merely an introduction to exploring the remarkable functionality provided by the homonymous pattern, and it should be admitted that there are many other cases in which the pattern can be used successfully. Nevertheless, I do think that all the hands-on examples shown in the first article of the series were explicit enough to illustrate how a concrete factory class works and how it can be called statically within a specific programming environment.

    So far, so good right? At this stage you should have a more accurate idea of how to include the factory pattern into your own PHP applications, at least at a very basic level. But don't you worry because this scenario is going to change quickly, since in this second tutorial I'm going to teach you how to take advantage of the capacity offered by the pattern to create objects that are capable of saving data to different locations, including files and cookies.

    Hopefully, this experience will be educational and serve to expand your existing skills on pattern-based programming with PHP 5 even more.

    So, are you ready to start reading? Let's go!

    More PHP Articles
    More By Alejandro Gervasio


       · In this second part of the series, you’ll learn how to apply the factory pattern in...
       · Thanks!
       · Thank you for the kind comments on my PHP article. It's good to know it's been...
     

       

    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 5 hosted by Hostway