On Thu, Mar 20, 2008 at 11:19:27PM -0700, Chuck Esterbrook wrote: > To give you an idea of my use of inheritance, in the implementation of > the Cobra compiler I have an abstract Statement class which has a > subclass Expression which has subclasses such as IdentifierExpr and > IfExpr. > > And consider a GUI framework. Having Button and TextField inherit > Control makes a lot of sense. I don't see it as brittle. I do see it > as very real world.
There are a few places were inheritance may fit nicely like GUIs and exceptions I agree. They seem few and far between. > I don't find inheritance any more brittle than other approaches. > Whatever the structure of your code, you'll have to refactor it at > some point, probably multiple times. Avoiding inheritance won't change > that. Well a long vertical inheritance chain means tight integration between layers. Tight integration between layers means if you mess with one layer you affect other layers. Chris -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
