comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Design By Contract
Date: 1997/09/08
Date: 1997-09-08T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680000809972142380001@news.ni.net> (raw)
In-Reply-To: VA.0000004d.486c7bde@nickle.compulink.co.uk



In article <VA.0000004d.486c7bde@nickle.compulink.co.uk>,
nickle@compulink.co.uk wrote:


>> For example Eiffel has direct support for multiple inheritance (MI).  Ada
>> requires you to play games with generic parameters in order to achieve
>> the same effect.

Thinking more about it, it really does make sense to implement mixin
inheritance this way in Ada 95.  The original poster probably wasn't
"thinking in Ada."  

To declare an abstract data type in Ada, you do this:

package P is

   type T is tagged private;
...
end;

Clients of type T with package P to get visibility to the type:

with P;
procedure Q is
   O : P.T;
...

Now as far as clients of T are concerned, it doesn't matter whether P is a
non-generic package, or the instantiation of a generic package.  His
manipulation of the type is the same.  For example, we could have done
this:

generic
   ...
package GP is 
   type T is tagged ...;
...

package P is new GP (...);

My point is that from a client's point of view, it's exactly the same.  He
wants a type that has certain operations, so he withs a package containing
that type.

Now we have a certain abstraction into which we want to mix some other
operations.  What we're debating is how easy it is for the _mixer_ to do
this.  But who made this executive decision that MI is a better mechanism
than genericity for combining abstractions?

The key thing is that we're able to combine abstractions this way,
_without_ an additional language feature.  (This doesn't mean MI is bad,
only that it's not needed.)  Existing language mechanisms do _exactly_ what
we want.  The irony is that this isn't anying especially new: in Ada 83 we
were _already_ combining abstractions this way (example: extending a list
type with utility operations by importing the list type as a generic formal
parameter).

To say that MI is a "more elegant' mechanism of implementing mixin
inheritance, or that Ada requires you to "play games" with generics (thus
reducing the Ada mechanism to the status of a mere "idiom"), is a pretty
impuissant argument.  (Like my new word?)  The generic technique is what
Ada programmers have been doing all along (though not quite as simply as in
Ada 95), so I'm not clear what you'd buy by using yet another mechanism
whose superiority is only putative.

--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271




  reply	other threads:[~1997-09-08  0:00 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-21  0:00 Critique of Ariane 5 paper (finally!) aek
     [not found] ` <33FC66AD.9A0799D4@calfp.co.uk>
1997-08-22  0:00   ` Robert S. White
1997-08-22  0:00     ` Samuel Mize
1997-08-22  0:00       ` Samuel Mize
1997-08-23  0:00     ` Ken Garlington
     [not found]   ` <33FFA4B1.3543@flash.net>
1997-08-26  0:00     ` Nick Leaton
     [not found]       ` <3403940F.4154@pseserv3.fw.hac.com>
1997-08-27  0:00         ` Design By Contract Ted Velkoff
     [not found]           ` <5u3c6v$gtf$2@miranda.gmrc.gecm.com>
     [not found]             ` <34058808.3BF@pseserv3.fw.hac.com>
1997-08-28  0:00               ` Darren New
1997-08-28  0:00             ` Patrick Doyle
1997-09-06  0:00               ` Joachim Durchholz
1997-09-06  0:00                 ` Patrick Doyle
     [not found]           ` <JSA.97Aug27180328@alexandria.organon.com>
1997-08-28  0:00             ` W. Wesley Groleau x4923
1997-09-03  0:00             ` Don Harrison
1997-09-03  0:00               ` Jon S Anthony
1997-09-04  0:00                 ` Don Harrison
     [not found]         ` <EFM140.Fy9@syd.csa.com.au>
1997-08-28  0:00           ` Jon S Anthony
1997-08-29  0:00             ` Patrick Doyle
1997-08-29  0:00               ` Jon S Anthony
     [not found]                 ` <EFqDw0.3x7@ecf.toronto.edu>
     [not found]                   ` <JSA.97Aug30145354@alexandria.organon.com>
1997-09-01  0:00                     ` Patrick Doyle
1997-08-29  0:00             ` Don Harrison
1997-08-29  0:00               ` Jon S Anthony
     [not found]                 ` <EFqE8L.4Eq@ecf.toronto.edu>
     [not found]                   ` <JSA.97Aug30145058@alexandria.organon.com>
1997-09-01  0:00                     ` Patrick Doyle
1997-09-02  0:00                 ` Don Harrison
1997-09-02  0:00                   ` Jon S Anthony
1997-09-03  0:00                     ` Don Harrison
     [not found]                     ` <JSA.97Sep3201329@alexandria.organon.com>
     [not found]                       ` <EFzLn7.481@ecf.toronto.edu>
1997-09-04  0:00                         ` Jon S Anthony
1997-09-04  0:00                       ` Paul Johnson
1997-09-05  0:00                         ` Jon S Anthony
     [not found]                         ` <5un58u$9ih$1@gonzo.sun3.iaf.nl>
1997-09-06  0:00                           ` Building blocks (Was: Design By Contract) Joachim Durchholz
1997-09-08  0:00                           ` Paul Johnson
1997-09-08  0:00                             ` Brian Rogoff
1997-09-09  0:00                               ` W. Wesley Groleau x4923
1997-09-09  0:00                               ` Matthew Heaney
1997-09-09  0:00                                 ` Brian Rogoff
1997-09-09  0:00                                 ` W. Wesley Groleau x4923
1997-09-10  0:00                                   ` Robert A Duff
1997-09-12  0:00                                     ` Jon S Anthony
1997-09-10  0:00                                 ` Paul Johnson
1997-09-10  0:00                                   ` Matthew Heaney
1997-09-10  0:00                                   ` Darren New
1997-09-10  0:00                                 ` Robert Dewar
1997-09-12  0:00                                   ` Jon S Anthony
1997-09-12  0:00                                     ` Robert Dewar
1997-09-16  0:00                                       ` Brian Rogoff
1997-09-12  0:00                                   ` Paul Johnson
1997-09-14  0:00                                     ` Robert Dewar
1997-09-14  0:00                                     ` Robert Dewar
1997-09-15  0:00                                       ` John G. Volan
1997-09-14  0:00                                     ` Robert Dewar
1997-09-09  0:00                               ` Veli-Pekka Nousiainen
1997-09-09  0:00                               ` Veli-Pekka Nousiainen
1997-09-09  0:00                                 ` Jon S Anthony
1997-09-08  0:00                         ` Design By Contract Nick Leaton
1997-09-08  0:00                           ` Matthew Heaney [this message]
1997-09-09  0:00                           ` Paul Johnson
     [not found]                       ` <EFz0pD.E6n@syd.csa.com.au>
1997-09-05  0:00                         ` W. Wesley Groleau x4923
1997-09-05  0:00                         ` subjectivity W. Wesley Groleau x4923
1997-09-05  0:00                           ` subjectivity Matthew Heaney
1997-09-10  0:00                             ` subjectivity Don Harrison
1997-09-12  0:00                               ` subjectivity Jon S Anthony
1997-09-16  0:00                                 ` subjectivity Don Harrison
1997-09-16  0:00                                   ` subjectivity Jon S Anthony
1997-09-10  0:00                           ` subjectivity Don Harrison
1997-09-10  0:00                             ` subjectivity W. Wesley Groleau x4923
1997-09-11  0:00                               ` subjectivity Don Harrison
1997-09-10  0:00                             ` subjectivity W. Wesley Groleau x4923
     [not found]                         ` <JSA.97Sep4172912@alexandria.organon.com>
     [not found]                           ` <EG0oz8.F6M@syd.csa.com.au>
     [not found]                             ` <EG0rp7.GtL@syd.csa.com.au>
1997-09-05  0:00                               ` Design By Contract Matthew Heaney
1997-09-05  0:00                             ` Jon S Anthony
1997-09-05  0:00                               ` Nick Leaton
1997-09-08  0:00                                 ` Jon S Anthony
1997-09-09  0:00                                   ` Nick Leaton
1997-09-10  0:00                                     ` Paul Johnson
1997-09-06  0:00                               ` Patrick Doyle
1997-09-09  0:00                           ` Robert A Duff
1997-09-09  0:00                             ` Matthew Heaney
1997-09-02  0:00                   ` Joerg Rodemann
1997-09-02  0:00                     ` Jon S Anthony
1997-08-28  0:00           ` Robert Dewar
1997-08-29  0:00             ` Don Harrison
     [not found]         ` <349224633wnr@eiffel.demon.co.uk>
1997-08-27  0:00           ` Design by Contract Robert Dewar
1997-08-29  0:00           ` Don Harrison
     [not found]       ` <3406BEF7.2FC3@flash.net>
     [not found]         ` <3406E0F7.6FF7ED99@calfp.co.uk>
1997-09-02  0:00           ` Critique of Ariane 5 paper (finally!) Ken Garlington
     [not found] <5u1627$1fak@info4.rus.uni-stuttgart.de>
     [not found] ` <EFM1Lx.GD2@syd.csa.com.au>
1997-08-28  0:00   ` Design by Contract Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-08-07  0:00 Safety-critical development in Ada and Eiffel Ken Garlington
1997-08-12  0:00 ` Don Harrison
1997-08-12  0:00   ` Jon S Anthony
1997-08-13  0:00     ` Ted Velkoff
1997-08-13  0:00       ` Ken Garlington
1997-08-14  0:00         ` Nick Leaton
1997-08-18  0:00           ` Joachim Durchholz
1997-08-19  0:00             ` Ken Garlington
1997-08-21  0:00               ` Joachim Durchholz
1997-08-23  0:00                 ` Ken Garlington
     [not found]                   ` <JSA.97Aug25181856@alexandria.organon.com>
     [not found]                     ` <34023A1F.41C67EA6@eiffel.com>
1997-08-25  0:00                       ` Design by Contract Bertrand Meyer
     [not found]                         ` <3402d123.0@news.uni-ulm.de>
1997-08-26  0:00                           ` Nick Leaton
     [not found]                             ` <3402e51d.0@news.uni-ulm.de>
     [not found]                               ` <3402E8C9.3384D976@calfp.co.uk>
     [not found]                                 ` <dewar.872631036@merv>
1997-08-27  0:00                                   ` Ted Velkoff
1997-08-27  0:00                                   ` Matt Kennel (Remove 'NOSPAM' to reply)
     [not found]                                   ` <34050F3C.5A3A@invest.amp.com.au>
1997-08-28  0:00                                     ` Robert Dewar
1997-08-29  0:00                                       ` Paul Johnson
1997-08-31  0:00                                         ` Matt Kennel (Remove 'NOSPAM' to reply)
1997-09-01  0:00                                           ` John F. Bell III
1997-09-02  0:00                                             ` Ken Garlington
1997-09-05  0:00                                               ` Robert Dewar
     [not found]                                         ` <dewar.872887402@merv>
1997-09-02  0:00                                           ` Ken Garlington
1997-09-03  0:00                                             ` Thomas Beale
     [not found]                                               ` <EFxx8q.2sw@ecf.toronto.edu>
1997-09-04  0:00                                                 ` Thomas Beale
1997-09-05  0:00                                             ` Robert Dewar
1997-09-05  0:00                                               ` Ken Garlington
     [not found]                             ` <340306E1.5FB64D70@XYZZYcalfp.com>
1997-08-28  0:00                               ` Mark Bennison
     [not found]                         ` <bengtk-2708972209500001@sl35.modempool.kth.se>
1997-08-28  0:00                           ` Nick Leaton
1997-08-25  0:00                       ` Bertrand Meyer
1997-08-25  0:00                         ` Steve Stringfellow
1997-08-26  0:00                         ` Don Harrison
1997-08-25  0:00                       ` Bertrand Meyer
     [not found]                         ` <JSA.97Aug26151833@alexandria.organon.com>
1997-08-27  0:00                           ` Patrick Doyle
1997-08-25  0:00                       ` Bertrand Meyer
replies disabled

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