Dispatching Object Model Concept
Dispatching in the object model is executing the correct code based on the type of a class. In this example, the age method is overloaded in the Student and Employee classes. Overloading occurs because the same name, age, is used for the methods in all three classes. There may be a reason for calculating the age of a Student or an Employee. For example, for insurance reasons, you may want the age of an Employee as of the first of the month instead of using today's date as might be defined in the Person class.
The object system ensures that the right method is executed on the right data. In other words, it is not possible to execute the wrong age method on the right data, or the right age method on the wrong data.
The ability to redefine methods on a class basis is known a polymorphism.
For this example, you should not see this type of case statement with an object system. It is handled by dispatching.
if type is Person then
... calculate age based on Person rules ....
else if type is Student then
... calculate age based on Student rules ....
else it type is Employee then
... calculate age based on Employee rules
More on the general topic: Inheritance Object Model Concept