Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!usc!apple!apple.com!casseres From: casseres@apple.com (David Casseres) Newsgroups: comp.sys.mac.programmer Subject: Re: Multiple Inheritance -- Is It A Luxury? Message-ID: <9110@goofy.Apple.COM> Date: 12 Jul 90 17:42:13 GMT References: <9093@goofy.Apple.COM> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 24 In article <9093@goofy.Apple.COM> rmh@apple.com (Rick Holzgrafe) writes: > Try hard to write classes whose users won't need source. Then give them > source anyway. Since I made the remark that started this sub-thread, I should add that I heartily agree with the above. Let me try a better way of saying what I was getting at in the first place: I would rather be grubbing around and rewriting source code to figure out how to make a poorly designed class do what I want, than putting together a pot of spaghetti made out of poorly designed classes and multiple inheritance. Obviously, it is best if we don't have any poorly designed classes to deal with, but life is not really like that. Even with well-designed classes there is *sometimes* a situation where you want a new Class X to be able to do things like both Class A and Class B. My preferred way of dealing with this is to let X be a subclass of A and let each instance of X contain an instance of B. In some sense this is not as elegant as multiple inheritance, but in another sense it is more elegant: it encapsulates the problem much more effectively -- X and its subclasses need not worry about which of their parents they are inheriting from. David Casseres Exclaimer: Hey!