A
agent_008_nl
Guest
By accident read this comment by that Lahman which writings you recommended, Thomas ( from comp.object.narkive.com/.../inheritance-and-function-reuse-why-is-it-bad ): --------------------------------------------------------------------- H. S. Lahman 14 years ago PermalinkRaw Message Responding to Willis... Post by Grumpy Willis I'm interested to learn why use of inherited functions are frowned upon, and indeed why it is allowed in a language at all if it *is* frowned upon. It is frowned upon for a couple of reasons. If subclasses can override the behaviors, then it opens a Pandora's Box of opportunities for foot-shooting. While the problem is greatly reduced if overrides are not allowed, it still exists. Basically the problem is that if the tree is reorganized, it is possible to break existing clients of superclasses because the concrete behavior they expected is no longer provided. Another reason is that it complicates maintenance of generalizations. The OO is-a relation is already difficult to modify because it is a static structure and a client accessing a superclass depends on the structure of the /whole/ tree. By adding implementation inheritance one complicates making safe updates. In effect one adds another dimension (the others being interface and data inheritance) that must be synchronized during maintenance. In particular, such trees are especially prone to LSP violations. As far as why it is allowed in languages, the justification is basically that for why C++ even exists. B-) Having the features allows the developer more direct control over the solution, albeit at the price of substantially increased fragility. [Note that the OOPLs have gotten other things not quite right as well historically, such as directly mapping knowledge responsibilities for memory storage types.] ************* There is nothing wrong with me that could not be cured by a capful of Drano. H. S. Lahman
Continue reading...
Continue reading...