comp.lang.ada
 help / color / mirror / Atom feed
* 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 ` Should MI be supported (was: Can MI be supported?) Mário Amado Alves
  0 siblings, 2 replies; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2003-09-24  1:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-15 17:15 Should MI be supported (was: Can MI be supported?) Lionel.DRAGHI
2003-09-15 23:26 ` Matthew Heaney
2003-09-23 10:45   ` Should MI be supported Jacob Sparre Andersen
2003-09-24  1:31     ` Matthew Heaney
2003-09-16 16:23 ` Should MI be supported (was: Can MI be supported?) 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