S
Soulshift
Hi all,
Here's my problem. I have a design where the class Container inherits
class Widget, and is used to contain and handle the proper display of
widgets and behaves like a widget itself. I have a class IsoWidget
which inherits from class Widget which is used to display isometric
widgets. I want to make a class IsoContainer (which contains
IsoWidgets and behaves like an IsoWidget), and since an IsoContainer
seems like it should inherit from both IsoWidget and Container, I'm
not sure what's best.
I see a few options as of now:
- Use multiple inheritance (ick) to resolve the issue by having
IsoContainer inherit from Container and IsoWidget.
- Copy code from IsoWidget and dump it into IsoContainer (ick)
- Copy code from Container and dump it into IsoContainer (worse)
- Redesign the entire class hierarchy, breaking nearly everything
else, but resulting in a better design.
Does anyone see a better solution? Help!
Thanks in advance,
Soulshift
Here's my problem. I have a design where the class Container inherits
class Widget, and is used to contain and handle the proper display of
widgets and behaves like a widget itself. I have a class IsoWidget
which inherits from class Widget which is used to display isometric
widgets. I want to make a class IsoContainer (which contains
IsoWidgets and behaves like an IsoWidget), and since an IsoContainer
seems like it should inherit from both IsoWidget and Container, I'm
not sure what's best.
I see a few options as of now:
- Use multiple inheritance (ick) to resolve the issue by having
IsoContainer inherit from Container and IsoWidget.
- Copy code from IsoWidget and dump it into IsoContainer (ick)
- Copy code from Container and dump it into IsoContainer (worse)
- Redesign the entire class hierarchy, breaking nearly everything
else, but resulting in a better design.
Does anyone see a better solution? Help!
Thanks in advance,
Soulshift