From: Trans Date: 2007-02-19T12:03:50+09:00 Subject: Re: More flexible inheritance On Feb 18, 2:49 pm, Gary Wright wrote: > On Feb 17, 2007, at 8:24 PM, Trans wrote: > > > A notion came to me yesterday with regards to how we extend classes. > > On the one hand we can create a module and include it into a class, > > but this will not allow us to override a preexisting method -- for > > that we must reopen the class and play the alias and/ or binding game. > > Why not just use a subclass? Isn't that one of the primary motivations > for inheritance in the first place, to override a method in an ancestor? You're right of course --if that's what one needs. But often one wants to extend a prexisting class. There are numerous reasons one might want to do that, and which arn't very suitable to subclassing. Imagine if we didn't have open classes , then just to add a single method to a class required a new subclass. (would Ruby start to look a lot more like Java?) T.