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

* Re: Should MI be supported (was:  Can MI be supported?)
  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-16 16:23 ` Should MI be supported (was: Can MI be supported?) Mário Amado Alves
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Heaney @ 2003-09-15 23:26 UTC (permalink / raw)


Lionel.DRAGHI@fr.thalesgroup.com writes:

> 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 have never
> encountered a "true" case of MI (there is more than half a million Ada
> lines).

In my experience multiple views are more useful than mixins, but YMMV.


> 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 disagree with both of your statements that the "syntax is awkward" and
that multiple views aren't "useful enough," but agree that it does get
the job done.  (I like the multiple views idiom, and I don't think it
gets used enough because many programmers don't really understand it, or
how to do it.)





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

* Re: Should MI be supported (was:  Can MI be supported?)
  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-16 16:23 ` Mário Amado Alves
  1 sibling, 0 replies; 5+ messages in thread
From: Mário Amado Alves @ 2003-09-16 16:23 UTC (permalink / raw)


Lionel wrote: "... i never encounter a "true" case of MI ..."

Controlled streams. Controlled storage pools. Don't you find these
"true"? How do you solve it? Compare

  type Controlled_Stream is new Root_Stream_Type with Controlled;



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

* Re: Should MI be supported
  2003-09-15 23:26 ` Matthew Heaney
@ 2003-09-23 10:45   ` Jacob Sparre Andersen
  2003-09-24  1:31     ` Matthew Heaney
  0 siblings, 1 reply; 5+ messages in thread
From: Jacob Sparre Andersen @ 2003-09-23 10:45 UTC (permalink / raw)


Matthew Heaney wrote:

> (I like the multiple views idiom, and I don't think it
> gets used enough because many programmers don't really understand it, or
> how to do it.)

I think you may be right about this.  I have never had much exposure to
the multiple views and mix-ins ideoms besides discussions here on
comp.lang.ada.  Maybe it is a topic that needs a bit more coverage in
one of the Ada journals (or elsewhere, where you can reach Ada
programmes) and maybe also in the chapters on tagged types in various
Ada textbooks (although I may have skipped too lightly over those).

Jacob
-- 
�You know the world has gone crazy when the best rapper is a
   white guy, the best golfer is a black guy, the swiss hold
   the America's cup, France is accusing the U.S. of
   arrogance, and Germany doesn't want to go to war�




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

* Re: Should MI be supported
  2003-09-23 10:45   ` Should MI be supported Jacob Sparre Andersen
@ 2003-09-24  1:31     ` Matthew Heaney
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Heaney @ 2003-09-24  1:31 UTC (permalink / raw)


Jacob Sparre Andersen <sparre@crs4.it> writes:

> I think you may be right about this.  I have never had much exposure to
> the multiple views and mix-ins ideoms besides discussions here on
> comp.lang.ada.  Maybe it is a topic that needs a bit more coverage in
> one of the Ada journals (or elsewhere, where you can reach Ada
> programmes) and maybe also in the chapters on tagged types in various
> Ada textbooks (although I may have skipped too lightly over those).

If you have specific questions you should send them to "dearada" at
domain "adapower.com".

I think I know what the next column will be about, but the MI stuff
would make a good column, too.





^ 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