in reply to (tye)Re2: Why do you need abstract classes in Perl?
in thread Why do you need abstract classes in Perl?
An abstract class is one whose main purpose is to define a common interface for its subclasses. An abstract class will defer some or all of its implementation to operations defined in its subclasses; hence an abstract class cannot be instantiated. The operations that an abstract class declares but doesn't implement are called abstract operations. Classes that aren't abstract are called concrete classes.Without the ability to have implementations in abstract classes, you'd need a pair of superclasses to factor common code out of like classes: one for the abstract operations, the other for the common, factored operations. This wastes a class, and makes the class hierarchy one deeper than is really necessary.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re3: Why do you need abstract classes in Perl?
by tye (Sage) on Mar 06, 2001 at 11:04 UTC |