🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.eiffel
1 messages
1 total messages Started by snyder@hplabsz.H Wed, 11 Jan 1989 23:31
multiple inheritance example
#40
Author: snyder@hplabsz.H
Date: Wed, 11 Jan 1989 23:31
34 lines
1390 bytes
I am posting the enclosed letter at the request of Bertrand Meyer.
We believe it raises issues of general interest.
================================================================================
To: meyer
Subject: a question
Reply-to: snyder@hplabs.hp.com
Date: Fri, 30 Dec 88 15:29:06 PST
From: Alan Snyder <snyder@hplsny>

Bertrand,

I have a question about the example you used in your column on multiple
inheritance in the Nov/Dec issue of JOOP.  To refresh your memory, you gave
an example of walking menus, which included a class SUBMENU that inherits
from both MENU and ENTRY.

It is clear to me why a SUBMENU must be an ENTRY: it must be an ENTRY
because it is an entry in a menu.  However, it is not clear to me why a
SUBMENU must also be a MENU.  As an alternative, I would consider having a
SUBMENU contain a MENU as an attribute; the execute action would have the
effect of bringing up that contained MENU.  I justify this alternative by
noting that the MENU operations are not needed on the object that lives in
the enclosing menu (the menu entry) and claiming that the two behaviors
need not be represented by a single object.

My question: What is your reasoning in favor of the multiple inheritance
solution over this alternative?  Do you see one alternative as strongly
superior to the other?  On what basis do you choose between these
alternatives?

Thank you.

  Alan
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads