Without polymorphism, the programmer would have to employ if statements or switch logic to test the type of the currently active object. This alternative would clearly be difficult to maintain as the size and diversity of the modeled system changes. Polymorphism allows the developer to process objects of related classes in a very general way by focusing on class similarities. Polymorphism accommodates implementation differences by automatically dispatching commands to the appropriate methods at execution time. This allows code to be far more flexible and extensible.