CSE2305 - Object-Oriented Software Engineering
Week 2

Topic 3: Polymorphism and Overloading


Synopsis


Polymorphism¤


Polymorphism¤ and Inheritance

 

  • The reason we can send a particular message to an object is because it belongs to a class¤ for which that operation (receiving that message) is well-defined
     
  • Once a message is well-defined for a given class¤ it is automatically well-defined for any subclasses¤
     
  • [Diagram showing a base class (Container), from which is derived         class List, from which are derived classes DoublyLinkedList         and OrderedList. Class Container has an associated function          called sort()].
    [Diagram showing a base class (Container), from which is derived         class List, from which are derived classes DoublyLinkedList         and OrderedList. The classes Container, List and OrderedList         each have an associated function called sort()].


    Polymorphism¤ and Abstraction¤


    Polymorphism¤ and Typing¤


    Polymorphic (or Dynamic) Dispatch¤


    Overloading


    Overloaded operations


    Overloaded functions¤


    Dispatching overloaded functions¤


    Reading


    This material is part of the CSE2305 - Object-Oriented Software Engineering course.
    Copyright © Jon McCormack & Damian Conway, 1998-2005. All rights reserved.