PHP
  Home arrow PHP arrow Using Self-Saving Objects with Command...
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 
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

Using Self-Saving Objects with Command Objects in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 7
    2006-12-26

    Table of Contents:
  • Using Self-Saving Objects with Command Objects in PHP 5
  • Defining a core module of the command pattern
  • Storing and loading self-saving objects
  • Completing the command pattern
  • Seeing the command 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


    Using Self-Saving Objects with Command Objects in PHP 5


    (Page 1 of 5 )

    If you were looking for an approachable guide on how to create and use command objects with PHP 5, then look no further, because your search is over. Welcome to the final part of the series “Creating command objects with PHP 5.” Comprised of three comprehensive tutorials, this series walks you through the basics of how to apply the command pattern in PHP, and it accompanies its corresponding theory with numerous code samples.

    Certainly, one of the things that you’ll surely recall from the preceding article is the fact that implementing the command pattern with PHP is a quite straightforward process which can be carried out with minor problems. As you learned before, the procedure is only limited to defining a specific class, dubbed “commanded,” which will expose a method capable of encapsulating all the logic required for execution in another object. Lastly, this second object involved in the relationship is called a “commander,” and it will take care of invoking the mentioned method inside of its own scope. That's fairly understandable, right?

    Of course, one of the best courses of action to take when it comes to explaining the logic that stands behind the command pattern is to develop some concrete examples. In this way you can see how these objects interact with each other, as well as the neat functionality of this pattern.

    Now, and focusing my attention specifically on the topics that I plan to discuss in this final part of the series, I’m going to extend the creation and use of command objects to use the pattern in a more helpful fashion. Essentially, I’m going to explain how to utilize command classes for defining and handling self-saving objects, that is objects capable of storing a copy of themselves on a database, text file, etc.

    By doing so, I'll give you a much clearer idea of how the command pattern can be used in real-world applications, and at the same time you’ll expand your existing background in using design patterns with PHP 5 as well.

    With the preliminaries out of our way, it’s time to find out together how to use commanders in the creation of self-saving objects. The experience will be really educational, so let’s get started!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this article of the series, some command classes are utilized for...
     

       

    PHP ARTICLES

    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter
    - Building Your Own System Tray Application Us...
    - Structuring Your Projects for Web Applicatio...
    - Inserting, Updating and Deleting Database Ro...
    - Building Your Own Desktop Notepad Applicatio...
    - Web Application Security Overview
    - Working with the Active Record Class in Code...
    - Generate PDF Documents with PHP on the Windo...
    - Sending Email with PHP Networking
    - Performing Strict Validation with the Code I...
    - The preg_replace_callback() function in PHP
    - PHP Networking
    - Validating Web Forms with the Code Igniter P...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT