OOPortal
RationalDB Database Design
prev next prev next
  Course navigation
 
Lesson 1
Ad hoc polymorphism
    This module introduces you to the concept of polymorphism and why it is essential to designing code that requires little modification when functionality is added.
you will learn:
  1. What polymorphism is and why it's useful
  2. About the two types of ad hoc polymorphism: conversion and overloading
  3. How to create special conversion member functions to convert from a user-defined type to built-in type
  4. How the compiler picks the appropriate version of an overloaded function
     
In object-oriented programming, polymorphism refers to a programming language's ability to process objects differently depending on their data type or class. Furthermore, it is the ability to redefine methods for derived classes. Example: Given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying the area method to it will return the correct results. Polymorphism is considered to be a requirement of any true object-oriented programming language (OOPL).
  Course navigation