From: Robert Feldt Date: 2001-11-30T14:56:40+09:00 Subject: [ruby-talk:27031] Re: thoughts on virtual base classes, interfaces On Fri, 30 Nov 2001, Dave Thomas wrote: > > I tend to use an "abstract base class" with raise NotImplementedError to > > document this. Not for Ruby's sake but as documentation. A smart doc tool > > would parse it out and call the class and interface and mark the method as > > "virtual" or whatever it should be called. > > Would a mixin perhaps be a better flag of this? > Sometimes yes, but I (1) often find it hard to invent a good name ending with -able (:-)) and (2) sometimes want the subclasses really be subclasses of a certain class and not only implement an interface. I think I mean that the decision to use a Mix-in or Super class cannot be made based on the aspect discussed here alone. On the other hand I don't have a clear-cut way to choose between a Mix-in or a Super class. Any can share their heuristics? Most flexible is often to only use Mix-ins, I guess? I would think an answer to this question suitable for the FAQ since its likely to be an issue for newcomers learning about the Module/Class dicothomy and their uses. Regards, /RobertF