Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Polymorphism

September 28, 1998

Okay, there is one final feature of objects that you need to understand.

Objects are smart enough to be dynamic. Specifically, they have the ability to react differently depending on the situation.

This is important because it makes the API dependable and easy to understand for the incoming developer.

Let's look at an example. Suppose you have a method called "print()".

The first question you might ask is, "what does this method print: pictures, text, or what?"

Well, using "polymorphism", an object can be made to handle any scenario with the exact same method name. Thus, depending on what the object is asked to print, it will be able to print it.

Instead of having separate methods like printPicture(), printLetters(), and printNumbers() you have one unified print() and the object itself determines how to handle the different types of situations.

Inheritance
Introduction to Perl 5 | Table of Contents
Object Oriented Programming in Perl



Up to => Home / Authoring / Languages / Perl / 5




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers