Category Polymorphism

Click on the above link to see a complete list of pages in this category.

PolyMorphism (what a horrible WikiName, but what can you do?) is the development of algorithms or data structures (or more concrete language constructs, such as objects or functions) which operate successfully on multiple types, doing things appropriate for the type.

Some take issue with polymorphism being based solely on "types". Answering a particular message (method call) does not necessarily depend on typing. Your viewpoint probably depends on where you stand in the static-versus-dynamic HolyWar.

[Note that even when there isn't a formal type system per se, one can still divine the concept of type. Smalltalk is often called untyped. However, if you have a set of classes that respond to the message

 doThis: andThat: andTheOther:
one could say that this set represents a type, distinct from its inverse (which doesn't respond to the above message). Of course, you are getting away from type hierarchies, and into set-based or predicate-based type systems. Which are more flexible than hierarchies, but arguably more difficult to implement efficiently. -- ScottJohnson]

I am not sure set-based types or predicate-based types could even be called "types". I suppose one's world view could be that EverythingIsaType?, for good or bad. But, that is a subjective perception, not necessarily something objectively in say Smalltalk.


Types of polymorphism:

Is StaticPolymorphism GenericPolymorphism??

Also see GenericVsObjectOrientedProgramming, AlternateObjectOrientedProgrammingView, OnUnderstandingTypes

Issues in polymorphism:


See Also: CategoryConditionalsAndDispatching, CategoryLanguageTyping


CategoryCategory


EditText of this page (last edited June 25, 2006) or FindPage with title or text search