From: Matthew Heaney <matthewjheaney@earthlink.net>
Subject: Re: Should MI be supported (was: Can MI be supported?)
Date: Wed, 17 Sep 2003 03:36:59 GMT
Date: 2003-09-17T03:36:59+00:00 [thread overview]
Message-ID: <uu17c5bkr.fsf@earthlink.net> (raw)
In-Reply-To: mailman.5.1063713558.302.comp.lang.ada@ada.eu.org
Lionel.DRAGHI@fr.thalesgroup.com writes:
> That's where we differ. I feel much more confortable with Bob's
> translation, because Colorable is not an object, it's a "properties".
Perhaps, but I felt (and still do) that my translation was more faithful
to the C++ example.
> My_Adapter is an Adapter, so inheritance applies. My_Adapter is not a
> "colorable", so i won't inherit from some colorable class. Neither is
> "Colorable" a particular "role" of an Adapter.
What's interesting is that my example, I only exposed the root interface
types: Colorable_Type and Resizeable_Type. I felt that in Hyman's
implementation, he exposed too much information; specifically, that
My_Object derived from Colorable_Adapter_Type and
Resizeable_Adapter_Type.
But that's only an implementation detail. What's nice in the approach I
showed is that you only have to advertise that you support the root type
interface. The fact that privately I "inherited" from
Colorable_Adapter_Type and Resizeable_Adapter_Type was only an
implementation detail, and therefore I was able to move it to the
private part of the spec.
Hyman: Is there a way to do that in C++? Can you publicly inhterit from
ColorableType and privately inherit from ColorableAdapterType?
> It's just a characteristic (note that Colourable is an adjective,
> Adapter is a noun), and so i use a Mixin. You may perfectly use
> multiple views if you feel better with it. Hyman choose MI instead of
> (templates + SI) because the code was simpler to write. But in my
> opinion, mixin translate better the problem description.
The mixin approach may translate better to the problem description, but
it's debatable whether it translates better to the C++ implementation.
As usual, YMMV....
next prev parent reply other threads:[~2003-09-17 3:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-16 11:57 Should MI be supported (was: Can MI be supported?) Lionel.DRAGHI
2003-09-17 3:36 ` Matthew Heaney [this message]
2003-09-17 18:16 ` Hyman Rosen
-- strict thread matches above, loose matches on Subject: below --
2003-09-18 8:25 Lionel.DRAGHI
2003-09-16 8:16 Lionel.DRAGHI
2003-09-16 11:02 ` Matthew Heaney
2003-09-17 3:12 ` Robert I. Eachus
2003-09-17 3:25 ` Matthew Heaney
2003-09-17 10:36 ` Lutz Donnerhacke
2003-09-23 8:44 ` Robert I. Eachus
2003-09-15 17:15 Lionel.DRAGHI
2003-09-15 23:26 ` Matthew Heaney
2003-09-16 16:23 ` Mário Amado Alves
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox