PHP
  Home arrow PHP arrow Object Interaction and Mediator Classes 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? 
Google.com  
PHP

Object Interaction and Mediator Classes in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      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


    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
     

       

    PHP ARTICLES

    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - 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 ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek