|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> I might have asked this before, but do you have any good (hopefully generic)
> examples of where MI really helps out?
It's not commonplace for sure, but I have had actual situations where
multiple inheritance has been useful (and also at least one situation
where multiple inheritance would have been useful but was not available
because the language, in this case Objective-C, didn't support it).
Coincidentally (or perhaps not) all the cases I remember have been related
to GUI programming.
These have been cases where I have had an object which should act as a
screen element (whatever the basic element may be called in a particular
GUI library) and also as another class, neither of which could have been
just an interface (because both base classes contained functionality of
their own).
(In the Objective-C case I had to get around the limitation by using
preprocessor macros which could be used to add the required member
variables and functions in all the classes that needed them. It was quite
ugly.)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |