PHP
  Home arrow PHP arrow Object Interaction and Mediator Classe...
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 
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

Object Interaction and Mediator Classes in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2007-03-20

    Table of Contents:
  • Object Interaction and Mediator Classes in PHP 5
  • Expanding the initial mediator class
  • Building some additional file handling classes
  • Implementing the mediator pattern

  • 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


    Object Interaction and Mediator Classes in PHP 5


    (Page 1 of 4 )

    Are you looking for an approachable guide on how to use the mediator design pattern in PHP 5? If you answered "yes," then you should take a look at this group of articles. Welcome to the final part of the series that began with “Introducing Mediator Classes in PHP 5.” This series takes you through building mediator classes with PHP, and shows you how to use this useful pattern with copious code samples.

    If you already went through the first tutorial of the series, then quite possibly the mediator pattern will be quite familiar to you. However, if it doesn't ring any bells, let me offer you a quick introduction to how it works. This will let you can grasp more easily the purpose of the hands-on examples that I plan to include in this final article of the series.

    Essentially, when the mediator pattern is implemented in the context of a given PHP application, there's a class (the mediator) which behaves as a centralized mechanism that maintains a complete synchronization between two or more additional classes. These classes are structured in such a way that all the tasks that they perform are handled via the respective mediator.

    Logically, the rather confusing character of the previous definition implies that the topic must be complemented with a decent number of practical examples. These will hopefully serve to help you understand the logic that drives the mediator pattern more easily.

    Therefore, keeping in mind the strong educational sense that the subject really deserves, in the first article of the series I built a mediator class which was provided with the ability to keep a couple of data file handling classes entirely synchronized. This meant that when one class changed the case of the data it handled, the other one also reflected this modification via the mediator. Quite good, right?

    Okay, at this stage I believe that implementing the mediator pattern with PHP 5 should be a pretty painless process to you, but if the examples that I showed you in the first article weren't enough to help you completely grasp this pattern, over the course of this last tutorial I'm going to expand the original mediator class that you learned previously. The expansion will make it capable of maintaining three classes in perfect synchronization.

    Well, with the preliminaries out of our way, let's learn more examples of how to apply the mediator pattern with PHP 5. Let's go!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this last tutorial of the series, the initial functionality of...
     

       

    PHP ARTICLES

    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - 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





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