comp.lang.ada
 help / color / mirror / Atom feed
From: "christov" <christov@mac.com>
Subject: Re: Ada 2005?
Date: 18 Dec 2004 00:47:04 -0800
Date: 2004-12-18T00:47:04-08:00	[thread overview]
Message-ID: <1103359624.475636.116510@z14g2000cwz.googlegroups.com> (raw)
In-Reply-To: 1103344064.372396.51420@c13g2000cwb.googlegroups.com

conradwt@runbox.com wrote:
> Hi, will Ada support keyword class for designing and implementing
> classes?  For example, I'm forced to convert the following C++ class
in
> Ada as follows:

No, I do not think that Ada 2005 will support the keyword "class".  Ada
2005 will
add the "interface" keyword however.  (I haven't read up on it yet.)

[non-object-oriented code examples snipped]

Neither of your code examples really show much "object-orientation."
The best that you can say is that both examples show encapulation and
static function binding.  The C++ example is just a syntactic sugar
over what is easily acheivable in plain C.  The Ada example, while you
use tagged types, does not show any methods taking Classwide parameters
and thus use dynamic dispatch.

The syntax difference is just that, a syntax difference.  Looking at
the Ada Issues database it does look like Ada 2005 will support an
Object.Operation(...) style of notation.  It will provide a more
familiar syntax for C++/Java programmers who balk at
Package.Operation(Object,...).

>
> It seems that I'm trying to mimic the behavior of a OO language in a
> procedural language when converting C++ to Ada.  Is this correct?  If
> so, why doesn't Ada have OO contructs similar to C++,
> Java, Eiffel, and Smalltalk to name a few where one passes a message
to
> an instance of a class?  Will this be something in Ada 2005 because I
> have been able to find a good overview of the language to date?
Well,
> I must go and thanks for any comments that you may send me.

Ada95 is at least as object oriented as C++ in that it offers data
encapulation, type heirarchies, dynamic dispatch, abstract types and
methods, etc.  The syntax and procedure for their use are different.
Packages provide the mechanism for encapsulation and specialization in
Ada.  Tagged types and subprograms taking Type'Class arguments
(declared in the same package) provide the method for dynamic dispatch
and type inheiritance.

I also think that many Smalltalk adherants would be dismayed to find
you lumping that language in with C++ and Java.  Smalltalk (and
Objective C) are message passing, dynamically bound OO languages.  C++
is not a message passing language.

If you want a good book on Ada, I recommend  _Programming in Ada95, 2nd
edition_ by John Barnes.  There are also several excellent refferences
on Ada to be found for free from sites like http://www.adapower.com/ or
http://www.adaworld.com/.

Adacore has a short summary of Ada 2005 at
http://www.adacore.com/ada_2005.php.
If you want to go to the source then
http://www.ada-auth.org/arg-minutes.html shows the language design
process in all of its messy glory.  I really don't recommend it for
beginers though.  I try to steer clear myself. :-)

Cheers,
     Chris




  parent reply	other threads:[~2004-12-18  8:47 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-18  4:27 Ada 2005? conradwt
2004-12-18  8:08 ` Martin Dowie
2004-12-20 20:06   ` conradwt
2004-12-21  6:51     ` Martin Dowie
2004-12-18  8:47 ` christov [this message]
2004-12-19  3:28   ` Randy Brukardt
2004-12-19 19:11     ` christov
2004-12-19 22:07       ` Ada User Journal (was: Re: Ada 2005?) Dirk Craeynest
2004-12-19 22:34         ` Ada User Journal Florian Weimer
2004-12-20  9:19           ` Martin Krischik
2004-12-20 11:02             ` Florian Weimer
2004-12-20 12:22               ` Thomas Hühn
2004-12-27 13:16                 ` Florian Weimer
2004-12-21  0:15   ` Ada 2005? David Botton
2004-12-18  8:51 ` Martin Krischik
2004-12-18 16:03 ` Dmitry A. Kazakov
2004-12-20 18:49   ` conradwt
2004-12-20 20:10     ` Dmitry A. Kazakov
2004-12-20 23:44       ` jayessay
2004-12-21  1:26         ` Alexander E. Kopilovich
2004-12-21  8:31           ` Dmitry A. Kazakov
2004-12-21 17:24           ` jayessay
2004-12-21  8:11         ` Dmitry A. Kazakov
2004-12-21 17:10           ` jayessay
2004-12-21 17:12             ` Dmitry A. Kazakov
2004-12-21 21:42               ` jayessay
2004-12-22  8:55                 ` Dmitry A. Kazakov
2004-12-22 18:02                   ` jayessay
2004-12-22 19:10                     ` Dmitry A. Kazakov
2004-12-23 18:09                       ` jayessay
2004-12-24  9:41                         ` Dmitry A. Kazakov
2004-12-27 17:09                           ` jayessay
2004-12-27 19:44                             ` Dmitry A. Kazakov
2004-12-27 21:51                               ` Georg Bauhaus
2004-12-28  9:56                                 ` Dmitry A. Kazakov
2004-12-28 17:56                                   ` jayessay
2004-12-28 17:48                                 ` jayessay
2004-12-28 17:36                               ` jayessay
2004-12-21  8:33     ` Martin Krischik
2004-12-21 15:34       ` jimmaureenrogers
2004-12-21 15:53         ` Martin Krischik
2004-12-22  9:34           ` Larry Kilgallen
2004-12-22 11:01             ` Martin Krischik
2004-12-22 12:52               ` Larry Kilgallen
2004-12-22 16:38                 ` Martin Krischik
2004-12-23 23:05       ` conradwt
2004-12-24  9:24         ` Pascal Obry
2004-12-24  9:59         ` Martin Krischik
2004-12-18 19:31 ` Jeffrey Carter
2004-12-20 18:55   ` conradwt
2004-12-20 23:53     ` Jeffrey Carter
2004-12-21  0:25       ` David Botton
2004-12-19  3:16 ` Brian May
2004-12-20 23:38   ` jayessay
2004-12-21 21:42     ` Brian May
replies disabled

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