comp.lang.ada
 help / color / mirror / Atom feed
* RE: Should MI be supported (was:  Can MI be supported?)
@ 2003-09-18  8:25 Lionel.DRAGHI
  0 siblings, 0 replies; 13+ messages in thread
From: Lionel.DRAGHI @ 2003-09-18  8:25 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Matthew Heaney [mailto:matthewjheaney@earthlink.net]
..
| 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.
...
| 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....

Yes, I agree with you that multiple views idiom match much better Hyman's
example than the Mixin's one.  

But note that i was not discussing this: I was just arguing that Mixin was
(in my opinion) a more natural implementation of this particular problem,
not a more natural translation of Hyman's code. 

-- 
Lionel Draghi



^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Should MI be supported (was:  Can MI be supported?)
@ 2003-09-16 11:57 Lionel.DRAGHI
  2003-09-17  3:36 ` Matthew Heaney
  0 siblings, 1 reply; 13+ messages in thread
From: Lionel.DRAGHI @ 2003-09-16 11:57 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Matthew Heaney [mailto:matthewjheaney@earthlink.net]
...
| Did I think Bob's translation was very natural?  Not really, no.
| _

That's where we differ. I feel much more confortable with Bob's translation,
because
Colorable is not an object, it's a "properties".

My_Adapter is an Adapter, so inheritance apply.
My_Adapter is not a "colorable", so i won't inherit from some colorable
class.
Neither is "Colorable" a particular "role" of an Adapter.

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. 

-- 
Lionel Draghi




^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Should MI be supported (was:  Can MI be supported?)
@ 2003-09-16  8:16 Lionel.DRAGHI
  2003-09-16 11:02 ` Matthew Heaney
  0 siblings, 1 reply; 13+ messages in thread
From: Lionel.DRAGHI @ 2003-09-16  8:16 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Matthew Heaney [mailto:matthewjheaney@earthlink.net]
...
| 
| In my experience multiple views are more useful than mixins, but YMMV.
| 
OK, it depends probably on design habits.

To translate Hyman example, did you use multiple views to stick with his
code, or because it's your "natural" choice?

-- 
Lionel Draghi



^ permalink raw reply	[flat|nested] 13+ messages in thread
* Should MI be supported (was:  Can MI be supported?)
@ 2003-09-15 17:15 Lionel.DRAGHI
  2003-09-15 23:26 ` Matthew Heaney
  2003-09-16 16:23 ` Mário Amado Alves
  0 siblings, 2 replies; 13+ messages in thread
From: Lionel.DRAGHI @ 2003-09-15 17:15 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Robert I. Eachus [mailto:rieachus@attbi.com]
...
| 
| I don't know that I would call it "has a" but that is exactly what 
| mix-ins do.  But I have wondered whether we got mix-ins too 
| right in Ada 
| 95.  I just saw a post by Matt Heaney on access discriminants.  There 
| are some roles for which the mix-in needs access to the whole object, 
| and his particular example (persistant types) is one of them. 
|  But for 
| most roles where a role only needs access to its own state variables, 
| mix-ins do the job nicely and much more elegantly than access 
| discriminants.  

I agree with this point. 

By applying in my current project, the rule :
- if "Is A" then -> inheritance,
- if "Has some characteristics" then -> mixin,
then :
We use simple inheritance, 
We use mixin (and never run into case where mix-in needs to access the
whole),
We didn't use multiple views (but this is possibly due to design pratices), 
And, for now, i never encounter a "true" case of MI (there is more than half
a million Ada lines).

Thats why i think Ada 95 was well designed, by addressing the most common
needs : simple inheritance and mixins.
Mutiple views idiom translate awkwardly in current Ada, but who cares? It's
not useful enough to add some new cleaner syntax to the language for now.
The important thing is that there is at least an idiom.

I think interface inheritance may be a useful improvement for Ada 0Y, but
some other MI syntax will not meet an essential expectation.


-- 
Lionel Draghi



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-09-23  8:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-18  8:25 Should MI be supported (was: Can MI be supported?) Lionel.DRAGHI
  -- strict thread matches above, loose matches on Subject: below --
2003-09-16 11:57 Lionel.DRAGHI
2003-09-17  3:36 ` Matthew Heaney
2003-09-17 18:16   ` Hyman Rosen
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox