PHP
  Home arrow PHP arrow Using Different Objects in the Same Script for Polymorphs in PHP
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 
iPad news and developer info.
Ads by affinity 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
VPS Hosting 
Forums Sitemap 
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

Using Different Objects in the Same Script for Polymorphs in PHP


By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2010-01-20


    Table of Contents:
  • Using Different Objects in the Same Script for Polymorphs in PHP
  • Review: creating polymorph classes using interfaces and abstract classes
  • Rendering HTML divs and paragraphs within the same script
  • Passing a different argument to the parseContent()method of the polymorph classes

  • 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


    Summary: Welcome to the final part of a seven part series on building polymorphs in PHP. In a friendly fashion, this series gets you started constructing polymorph classes specifically in PHP 5. It shows you how to accomplish this by using first interfaces, then parent classes, and finally a proper combination of both.

    Using Different Objects in the Same Script for Polymorphs in PHP
    (Page 1 of 4 )

    And now that you've been introduced to the main goal of this group of tutorials, it’s time to review the topics discussed in the last one. In that article I explained how to build a couple of polymorph classes; both of them inherited structure from a simple interface and functionality from an abstract class responsible for rendering generic HTML elements.

    Also, it’s necessary to recall that each of the classes constructed a specific HTML element through a common method called “render().” They also parsed its contents via another method, named“parseContent(),” which was inherited from the pertinent interface.

    However, analyzing the construction of these sample classes separately would not be very helpful for understanding their polymorph nature. To solve this issue, in this final chapter of the series I’m going to develop a couple of scripts where the classes will be put to work together.

    Now, it’s time to tackle the last part of this hopefully educational exercise in building polymorph classes with PHP 5. Let’s get going!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - PHP Excel Customizations: Working with Formu...
    - MVC and the Zend Framework
    - PHP: Rendering Web Pages Using the Composite...
    - PHP: Creating Dynamic Web Pages with the Com...
    - Secure Encrypting and Decrypting for Your PH...
    - PHP: Creating Single View Objects with the C...
    - PHP: View Object Collections and the Composi...
    - Securing Your PHP Website
    - Determine Link Relevance and Unique Class C ...
    - PHP Composite View Design Pattern: Introduci...
    - Facebook PHP API Applications: A Second Look
    - Secure PHP Programming
    - Facebook PHP API Applications: Basic Introdu...
    - SOAP Servers and Web Services
    - Using XPath, SOAP, and More with Web Services


    Code Analysis Tools
    Enterprise code analysis tools that deliver quality and reliable code



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