[Home]History of Polymorphism

Robo Home | Changes | Preferences | AllPages


Revision 5 . . March 28, 2003 0:07 EST by Hexkid
Revision 4 . . March 27, 2003 10:16 EST by PEZ
  

Difference (from prior major revision) (no other diffs)

Added: 3a4,8
The Power of Polymorphism


Polymorphism, Greek for "many forms", means that you can hide many alternative implementations behind a common interface. In Java and other OO languages this is done by inheritance (either direct inheritance of classes or by interface based inheritance). Basically it means that you can switch in alternative strategies and hide (or in OO speak - encapsulate) the code that performs the operation behind a known and public API. This ability means that you can create 'loosely-coupled' applications that allow new strategies to be added with the minimum amount of disruption.


Interfaces are probably one of the hardest concepts to understand for the newbie Java/OO developer and consequentially are used a lot less frequently than they should be IMHO. Easiest way to think of an interface is basically as a contract that defines the signatures of the methods that the classes HAVE to deliver.


Sorry for the lesson, i've been reading again:)Hexkid


Robo Home | Changes | Preferences | AllPages
Search: