PHP
  Home arrow PHP arrow Building Dynamic Web Pages with Polymo...
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 
Actuate Whitepapers 
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

Building Dynamic Web Pages with Polymorphism in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2007-03-28

    Table of Contents:
  • Building Dynamic Web Pages with Polymorphism in PHP 5
  • Building web pages using Polymorphism
  • Extending the concept of polymorphic classes
  • Seeing some polymorphic objects 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Building Dynamic Web Pages with Polymorphism in PHP 5


    (Page 1 of 4 )

    If you’re starting to delve deeper into object-oriented programming with PHP, and also want to know how to include polymorphic objects into your own scripts, this might be the right opportunity to learn more about this interesting topic. Welcome to the second part of the series that began with “Using polymorphism with objects in PHP 5.” In three articles, this series provides you with a comprehensive guide on how to take advantage of polymorphism to build more efficient object-based PHP applications.

    Introduction

    If you already read the first article of the series, then it's quite probable that the concept of working with polymorphic objects is now very familiar to you. However, in case this subject doesn't ring any bells, let me offer a brief introduction. This will give you a more solid background for tackling the group of topics that I plan to cover in this article.

    In short, Polymorphism is a feature exposed by certain objects that belong to the same family, which eventually can behave differently, even when they're using identical methods. Or more clearly, an object can be considered polymorphic when it's capable of performing different actions by utilizing the same method.

    As you can see, this feature can be really useful in certain situations where using polymorphic objects can improve noticeably the way that a specific application is structured, aside from avoiding the inclusion into the source code of redundant checking blocks, such as the popular "if" and "switch/case" combinations.

    The previous theory was clearly demonstrated in the preceding article, where I showed how to take advantage of polymorphism by building a simple yet expansible database abstraction layer for working with MySQL and SQLite. Obviously, the aforementioned  layer used polymorphic objects for accessing both database systems, but this concept can be easily extended to other applications, which makes it even more interesting.

    Therefore, bearing in mind that the implementation of polymorphic objects in PHP 5 can be indeed as useful to you as it is to me, in this second part of the series, I'm going to show you how to use polymorphism to build dynamic web pages.

    The experience not only will be interesting, but also educational, so let's not waste more time in preliminaries. 

    More PHP Articles
    More By Alejandro Gervasio


       · As you learned in the first article of the series, the implementation of polymorphic...
       · Alejandro, this article is Great !
       · Thank you for the compliments on my PHP article. I hope it's been useful to you and...
       · Thanks for your Great Work.This is very useful to New Php...
       · Thank you for commenting on my PHP article, and I'm glad to know it's been useful to...
     

       

    PHP ARTICLES

    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application
    - Sending MIME Email with PHP
    - Handling Files for a Project Management Appl...
    - Viewing and Editing Tasks for a Project Mana...
    - More on Private Methods with PHP 5 Member Vi...
    - Adding Tasks to a Project Management Applica...
    - Utilizing Private Methods with PHP 5 and Mem...
    - Making Changes in a Project Management Appli...
    - Defining Public and Protected Methods with M...
    - HTML for a Project Management Application
    - Using Subclasses and Accessors with Member V...
    - Implementing Internet Protocols with PHP
    - Project Management: The Application
    - Working with Private Properties to Protect P...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway