comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: A question for my personal knowledge.
Date: 1999/05/18
Date: 1999-05-17T17:37:06-07:00	[thread overview]
Message-ID: <7hqcni$p8r@sjx-ixn1.ix.netcom.com> (raw)
In-Reply-To: 7hfctj$1kb4@drn.newsguy.com

In article <7hfctj$1kb4@drn.newsguy.com>,
	Mike  <Mike@newsguy.com> wrote:

>Ada OO mechanism is not simple and I find it confusing. a class is the
>most basic concept in OO, and Ada does not have it. No wonder all heavely
>used OO languages today use the class concept (C++, Java) even Simula
>the original OO language used a class to represent objects with. All except
>Ada does it different. 

 ... and Oberon, and Modula-3.

 I believe it was Albert Einstein who said, "Everything should be as
 simple as possible but not simpler."

 The most basic concept in OO is not that of "class."  Rather, it is
 the concept of "object."  Not all OOPL's require "class" in the same
 form.  Also, some practitioners make a distinction between type and
 class.  In one of the languages cited, C++, the model is,

                    type = class = module

 where the relationship is associative so we can also have,

                    module = class = type
                    class = type = module

 This relationship has definite advantages for some approaches to 
 software development.  Its simplicity also has its drawbacks. In
 fact, its very simplicity is seductive, especially in C++, where
 the model requires some rather bizzare code to compensate for the
 absence of other supporting constructs.  For example, a properly
 designed C++ class requires at least one constructor, a copy constructor,
 overloading of assignment, and a destructor.  And that is before one
 even gets started thinking about the problem to be solved.  As one
 explores this presumably "simple" model in depth, it becomes clear that
 it is not at all as simple as we might have thought it would be when
 looking at the general form of the class construct. 

 Ada has a model closer to,
 
                   module contains type,
                   type = root of derivation class
                   class = a derivation of types

 A superficial examination of these two forms would lead one to
 conclude that C++ is simpler.  That is a problem with superficial
 examinations.  It is also the origin of an interesting paradox
 when comparing C++ and Ada in more depth.

 The Ada model has its advantages. We also admit to it having its own 
 downside.  Some OO practitioners regard the Ada model as "counter
 intuitive."  It is only counter-intuitive if you are trying to make Ada
 look like the C++ or Eiffel model.  Otherwise, it is, in practice, easier
 to design and implement code using the Ada model than with the C++
 model.  The superficially simpler model of C++ increases the   
 implementation complexity during the source code development process.   

 The Ada model of enclosing the type as root of a derivation class in
 a package seems, at first, more complex.  This is the paradox.  Even
 though Ada seems more complex because of the separation of concerns
 between module and type, it becomes simpler in practice.  This paradox
 is not easy to see unless one has actually engaged in the development
 of software in both languages.  Sadly, too many software managers see
 only the surface issues, and are misled into believing C++ is simpler 
 because it seems to be so when looking at the basic form.  When comparing
 Ada and C++, it is appropriate to keep the quotation from Einstein
 in mind, especially when doing a cursory evaluation of the two language
 design models.

 Richard Riehle
 richard@adaworks.com
 http://www.adaworks.com
 




  parent reply	other threads:[~1999-05-18  0:00 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-10  0:00 A question for my personal knowledge Siamak Kaveh
1999-05-10  0:00 ` Sam
1999-05-10  0:00 ` Larry Kilgallen
1999-05-10  0:00   ` Keith Thompson
1999-05-12  0:00     ` Charlie McCutcheon
1999-05-12  0:00       ` Werner Pachler
1999-05-17  0:00         ` Charlie McCutcheon
1999-05-17  0:00           ` bglbv
1999-05-17  0:00             ` Larry Kilgallen
1999-05-18  0:00               ` bglbv
1999-05-19  0:00                 ` Larry Kilgallen
1999-05-10  0:00 ` Dan Nagle
1999-05-10  0:00 ` Roy Grimm
1999-05-11  0:00   ` Pascal Obry
1999-05-11  0:00     ` Roy Grimm
1999-05-11  0:00       ` Robert Dewar
1999-05-11  0:00         ` dennison
1999-05-13  0:00           ` Mike Yoder
1999-05-13  0:00             ` Mike
1999-05-13  0:00               ` Martin C. Carlisle
1999-05-14  0:00               ` Dale Stanbrough
1999-05-13  0:00                 ` Mike
1999-05-13  0:00                   ` Brian Rogoff
1999-05-13  0:00                   ` David Starner
1999-05-18  0:00                     ` Georg Bauhaus
1999-05-14  0:00                   ` Florian Weimer
1999-05-14  0:00                     ` Steve
1999-05-15  0:00                       ` Florian Weimer
1999-05-15  0:00                         ` Matthew Heaney
1999-05-14  0:00                   ` Dale Stanbrough
1999-05-15  0:00                   ` Matthew Heaney
1999-05-18  0:00               ` Richard D Riehle [this message]
1999-05-18  0:00                 ` Hyman Rosen
1999-05-18  0:00                   ` Richard D Riehle
1999-05-18  0:00                     ` Hyman Rosen
1999-05-19  0:00                       ` Richard D Riehle
1999-05-11  0:00         ` Roy Grimm
1999-05-12  0:00           ` Robert A Duff
1999-05-11  0:00       ` Marin David Condic
1999-05-11  0:00         ` Roy Grimm
1999-05-11  0:00           ` Tucker Taft
1999-05-11  0:00             ` Roy Grimm
1999-05-12  0:00         ` Roger Racine
1999-05-12  0:00           ` Marin David Condic
1999-05-17  0:00             ` Richard D Riehle
1999-05-18  0:00               ` Marin David Condic
1999-05-18  0:00                 ` bglbv
1999-05-18  0:00                   ` William B. Clodius
1999-05-17  0:00             ` Charlie McCutcheon
1999-05-17  0:00               ` Larry Kilgallen
1999-05-17  0:00                 ` Chris
1999-05-17  0:00                   ` Marin David Condic
1999-05-17  0:00               ` Marin David Condic
1999-05-10  0:00 ` Marin David Condic
1999-05-10  0:00   ` Paul Whittington
1999-05-10  0:00     ` Marin David Condic
1999-05-11  0:00 ` Jean-Pierre Rosen
1999-05-11  0:00   ` Robert Dewar
replies disabled

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