comp.lang.ada
 help / color / mirror / Atom feed
From: "W. Wesley Groleau x4923" <wwgrol@pseserv3.fw.hac.com>
Subject: Re: Design By Contract
Date: 1997/08/28
Date: 1997-08-28T00:00:00+00:00	[thread overview]
Message-ID: <3405922A.3FA6@pseserv3.fw.hac.com> (raw)
In-Reply-To: JSA.97Aug27180328@alexandria.organon.com


Jon S Anthony wrote:
> 
> In article <3403C44F.2424@erols.com> Ted Velkoff <velkoff@erols.com> writes:
> 
> > Constrained genericity.
> >       Constrained genericity is achieved in Ada typically by adding
> > generic function or procedure parameters to the parameter list.
> > Depending on the generic type, that list of parameters could be long.
> >       I think the Eiffel approach, which says an actual parameter must
> > conform to (i.e. inherit from) some class, is simple and powerful, and
> > typically results in shorter parameter lists.
> 
> That's not quite right.  The Ada approach basically subsumes the
> Eiffel approach: an actual must conform/inherit from some class or you
> can use an approach sort of like what you mention.  Also, in the
> latter case, the parameter lists can be captured in a signature
> package which can then be passed as a single parameter to another
> generic.
> 
> >       Of course the religious question is whether you believe in MI or
> > not.
> 
> Right.
> 
> >  After not being sure for about a year, I've come to believe it is
> > extremely useful.  I think Bertrand Meyer is correct in saying that MI
> 
> Somewhat interestingly, I (and some others here) went the other way
> 'round and now consider MI to be (generally speaking) poor modeling.
> 
> > is not bad as long as it is implemented properly.  Using MI in
> > Eiffel is really just no big deal.
> 
> It makes it at least "reasonable" - but it does not address the
> modeling issue.
> 
> > Dynamic binding.
> >       Someone please correct me if I'm wrong on this one, but I think
> > in Ada95, the programmer has to designate whether dynamic binding can be
> > applied by making a type "classwide" with 'Class.  I think this is
> 
> A dynamic binding can be applied to primitive operations of "tagged"
> types.  _Whether_ any given _invocation_ of such an operation will be
> so treated requires that the actual involved be classwide.  So, all
> primitive ops of tagged types are dispatchable, but if you can control
> for any given call instance whether you really want that to happen
> 
> > comparable to C++ "virtual", but I think I read that the Ada compiler is
> 
> Not like C++ "virtual".  In C++ only operations tagged with "virtual"
> can be dispatching and this tagging happens at the point they are
> _declared_.  In Ada, all primitive ops of tagged types are
> dispatching.
> 
> > executable.  The chief objection (if I have understood the Ada mechanism
> > correctly) might be that one might forget to make a type classwide that
> > a descendant would need to override, and require a change to the code.
> 
> This is indeed a problem with C++ "virtual" but has nothing to do with
> Ada.
> 
> > Garbage collection.
> >       There are many applications being done in Ada for which garbage
> > collection is not appropriate (hard real-time, etc.).  I suspect that
> > there are many more applications being done in Ada that could benefit
> > from garbage collection.
> 
> Absolutely.
> 
> >       Eiffel is of course garbage collected.  There are also library
> > facilities for fine-grained control during execution.
> 
> Right.
> 
> > Exception handling.
> 
> This actually seems to be another religious issue.
> 
> > to Ada.  As far as I know, Eiffel environments are the only I know of
> > that support class flattening (i.e. generating the union of all features
> > of all ancestors).
> 
> I seem to recall some freeware stuff that can do this for any language
> with class based heirarchy.  If anyone actually cares, I think I can
> dig this up...
> 
> >  They also support push-button access to the list of clients,
> > suppliers, ancestors, descendants.  I don't know how many times in
> > other languages (including Ada) I have really needed to find out
> > "who's calling this?" and had nothing better at my disposal than
> > grep.
> 
> Such tools certainly do exist.  Emacs ada-mode does much of this.
> Other environments pretty much do it all and then some.
> 
> > more properly addressed by inheritance (i.e. tagged types).  I would
> > worry that programmers using that as a guide would attempt to solve many
> > problems with child packages that should use inheritance instead.
> 
> Or vice-versa.  I'm no longer a big fan of class-based inheritance.
> It is useful and has its place.  But like anything else - it is a poor
> choice for "universal" application.
> 
> > Pointers to functions, aliases.
> >       I sort of got the heeby-jeebies when I saw these introduced 
> > into Ada95.  They didn't appear any easier or safer to use than 
> > their counterparts in C/C++.  In Ada83, you could sort of see the 
> > argument for subprogram pointers, but once inheritance and abstract 
> > subprograms were introduced, they seemed out of context to me.
> 
> These things do have their ups and downs.  To be fair, the way they
> are done in Ada, probably the "worst" thing about them is they look
> "ugly" - makes it look like you are cheating or up to something
> nefarious.  Note that no matter what, you kind of need subprogram
> pointers to be a "good citizen" in today's C dominated world.

They are _certainly_ safer than in C.  Ada ensures conformance
of parameter profiles and being in scope.  It is true (as evidenced
by the number of "why doesn't this work?" posts on the subject) that
they are not easier to use than in C, but that is a side-effect of 
the safety rules.

Inheritance, abstract subprograms, generic subprog params can
substitute for subprog pointers, but not sometimes in a less
readable and/or less efficient way, and sometimes not at all
(as with the X11 & C callback paradigm).

-- 
----------------------------------------------------------------------
    Wes Groleau, Hughes Defense Communications, Fort Wayne, IN USA
Senior Software Engineer - AFATDS                  Tool-smith Wanna-be
                    wwgrol AT pseserv3.fw.hac.com

Don't send advertisements to this domain unless asked!  All disk space
on fw.hac.com hosts belongs to either Hughes Defense Communications or 
the United States government.  Using email to store YOUR advertising 
on them is trespassing!
----------------------------------------------------------------------




  parent reply	other threads:[~1997-08-28  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]           ` <JSA.97Aug27180328@alexandria.organon.com>
1997-08-28  0:00             ` W. Wesley Groleau x4923 [this message]
1997-09-03  0:00             ` Don Harrison
1997-09-03  0:00               ` Jon S Anthony
1997-09-04  0:00                 ` Don Harrison
     [not found]           ` <5u3c6v$gtf$2@miranda.gmrc.gecm.com>
1997-08-28  0:00             ` Patrick Doyle
1997-09-06  0:00               ` Joachim Durchholz
1997-09-06  0:00                 ` Patrick Doyle
     [not found]             ` <34058808.3BF@pseserv3.fw.hac.com>
1997-08-28  0:00               ` Darren New
     [not found]         ` <EFM140.Fy9@syd.csa.com.au>
1997-08-28  0:00           ` Robert Dewar
1997-08-29  0:00             ` Don Harrison
1997-08-28  0:00           ` Jon S Anthony
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>
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                               ` 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-15  0:00                                       ` John G. Volan
1997-09-14  0:00                                     ` Robert Dewar
1997-09-14  0:00                                     ` Robert Dewar
1997-09-09  0:00                               ` Veli-Pekka Nousiainen
1997-09-09  0:00                                 ` Jon S Anthony
1997-09-09  0:00                               ` Veli-Pekka Nousiainen
1997-09-09  0:00                               ` W. Wesley Groleau x4923
1997-09-08  0:00                         ` Design By Contract Nick Leaton
1997-09-08  0:00                           ` Matthew Heaney
1997-09-09  0:00                           ` Paul Johnson
     [not found]                       ` <EFzLn7.481@ecf.toronto.edu>
1997-09-04  0:00                         ` Jon S Anthony
     [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-10  0:00                             ` subjectivity W. Wesley Groleau x4923
1997-09-11  0:00                               ` subjectivity Don Harrison
     [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-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
     [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                       ` 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
replies disabled

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