Re: How do I retrieve the 'type' of an object



* muppet <scott asofyet org> [2004-06-07 12:44]:
what aristotle said, that you don't want to differentiate by
types, is true; that breaks the ability to use subclasses of
things.  in this situation, though, polymorphism will require
multiple inheritance, 

No, it doesn't. You should simply stick your methods in the
existing base class package. (Ruby calls it mixins and in Perl6
we will be doing that routinely.) Subclassing would be advisable
if you were doing this for a module, but isn't particularly
useful in an app. In that situation only likely breakage is with
future versions of the class library, but then future versions of
the class library are bound to break a lot more anyway.

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]