lotus

previous page: 2.1) What Is Polymorphism? Cardelli and Wegner's Definition [Cardelli 85]:
  
page up: Object-Oriented Technology FAQ
  
next page: 2.2) What Does Polymorphism Boil Down To In OO Programming Languages? (Typing - Object-Oriented Technology)

2.1) What Is Polymorphism? Other Definitions




Description

This article is from the Object-Oriented Technology FAQ, by Bob Hathaway rjh@geodesic.com with numerous contributions by others.

2.1) What Is Polymorphism? Other Definitions


> Booch's Definition [Booch 91, p. 517]:

polymorphism A concept in type theory, according to which a name (such as a
variable declaration) may denote objects of many different classes that are
related by some common superclass; thus, any object denoted by this name is
able to respond to some common set of operations in different ways.

Booch also has several sections devoted to polymorphism.

[The author notes Booch's definition above is clearly in the context of
conventional, classical OO and subclass polymorphism.]

> Meyer's Definition [Meyer 88, sect. 10.1.5 Polymorphism]:

"Polymorphism" means the ability to take several forms. In object-oriented
programming, this refers to the ability of an entity to refer at run-time to
instances of various classes. In a typed environment such as Eiffel, this is
constrained by inheritance: ...

[The Author notes Meyer has a following section 10.1.7 on Static Type,
dynamic type, which is relevant, but claims "... there is no way the type
of an object can ever change. Only a reference can be polymorphic: ...".
Meyer is clear between the concept and the Eiffel realization in his
polymorphism definition above, but here neglects the "becomes" facility
as found in several dynamically typed OO languages such as Actors, CLOS,
Self and Smalltalk, which allows an object (and not just a reference) to
change its class.]

> Stroustrup's Definition [Stroustrup 90, p. 209]:

The use of derived classes and virtual functions is often called "object-
oriented programming". Furthermore, the ability to call a variety of
functions using exactly the same interface - as is provided by virtual
functions - is sometimes called "polymorphism".

[The Author notes this is a functional view of polymorphism (as provided in
C++). [Stroustrup 91, p. 136] has an example of polymorphism with void *'s,
but a newer template function is incomparably preferable, as implied in
[Stroustrup 90, ch 14]]

Rumbaugh's Definition [Rumbaugh 91, p. 2]:

"Polymorphism" means that the same operation may behave differently on
different classes.

 

Continue to:













TOP
previous page: 2.1) What Is Polymorphism? Cardelli and Wegner's Definition [Cardelli 85]:
  
page up: Object-Oriented Technology FAQ
  
next page: 2.2) What Does Polymorphism Boil Down To In OO Programming Languages? (Typing - Object-Oriented Technology)