T
Thomas Mercer-Hursh
Guest
For the record, Mr. Lahman responds: That missive wasn't from one of my more articulate moments. I suspect that in the context I was arguing against implementation inheritance (i.e., a subclass provides an implementation of a behavior that overrides a different implementation of that behavior that is already defined in its superclass). That tends to be a maintenance nightmare. Unfortunately, it is supported by many OOPLs. However, OOA/D generalization is a quite different beast. It is actually a variation on polymorphism (i.e., inclusion polymorphism). The superclass defines a contract for a behavior, but each subclass can provide a unique implementation of the behavior. Thus the superclass defines What the behavior is, but not How it is implemented, so there is exactly one implementation of How the behavior is implemented for each subclass. That is a pretty harmless way of providing behavior generalization since the only implementation in the inheritance limb is tied solely to the specific subclass. FWIW, I have never been keen on referring to OO behavior generalization as "behavior inheritance". The only thing that is being inherited is the interface and semantics of the behavior; only leaf subclasses provide actual implementations of the behavior. Note that this is quite different than data inheritance in generalization, where the data implementation is defined in the superclass and cannot be overridden by any subclass. IOW, subclasses only provide values for attributes, not the storage.
Continue reading...
Continue reading...