From: James Coglan Date: 2008-09-17T17:40:05+09:00 Subject: Re: SuperClass and Modules ------=_Part_2845_21213916.1221641252018 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > To avoid the method confusion while having more than one module, Ruby > looks in a particular order. This can be applied in the case of super > classes as well and let ruby follow the order of import while searching > for a method. Thus i may have, > > class MyClass < A < B #[oder of method search will be from MyClass, A to > B] > > I believe that there might be some strong reason for allowing multiple > Modules while restricting only one Parent ...? This is likely just my opinion, but it's mostly a question of semantics, of indicating your intent to other programmers. If you want to make a more specialised kind of MyClass object, you'd subclass MyClass. If you have some behaviour that could be applied to many different types of objects, you use a module and mix it in. Parent-child inheritance is really just a special case of module inclusion, with some extra restrictions. Remember that Class inherits from Module -- modules are objects that store methods, and classes are objects that store methods *and* create new objects. ------=_Part_2845_21213916.1221641252018--