comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Michael Paus" <paus@ib-paus.com>
Subject: Re: OOD in Ada?
Date: Sat, 22 Jun 2002 11:18:50 +0200
Date: 2002-06-22T09:18:51+00:00	[thread overview]
Message-ID: <3D1440FA.9030409@ib-paus.com> (raw)
In-Reply-To: 3d135676$0$8511$cc9e4d1f@news.dial.pipex.com

David Crocker wrote:
> I know that Ada95 tries to support O-O development, but from my perspective
> as an OO developer but Ada novice, it appears to me that any attempt to
> implement a large OO design in Ada will run into the following problems:
> 
> 1. The infamous "withing" problem (i.e. it is not possible to declare 2
> classes A and B, each in its own package, such that A has a method taking a
> paremeter of type "access B", and B has a method with a parameter of type
> "access A"); and

Yes, this is also considered a problem by other people.

This in an excerpt from the JGNAT user guide:

"A long-standing programming problem that is difficult to solve in Ada
is that of creating mutually dependent package specifications.  The
problem is that Ada package specifications aren't allowed to depend on
each other. There are various possibilities for working around this
restriction in specific cases, generally involving levels of
indirection and syntactically heavy programming idioms. However, these
workarounds are too cumbersome for practical use, [...]"

To overcome this problem the GNAT people even introduced a language extension
"with type". This feature is available in any recent GNAT implementation although
it does not seem to work (For the example I have used the compiler seems to go
into an endless loop). In order to activate it you have to use the -gnatX switch.
For a more extensive explanation of how it works see the JGNAT user manual.

> 2. The lack of a "dot" notation (or anything similar) for calling a member
> method, making the code hard to read and hard to determine where dynamic
> binding may be taking place.

This is indeed one of the more serious problems. Many people in this group
will argue that technically it does not make any difference whether you have
a "dot" notation or not and this is probably right. But from the point of
readability it is a big difference. This may of course be just a matter of
taste but in my daily work I have met a lot of people who have real difficulties
to understand what this OO stuff is all about. I think it is much easier to
explain and understand in a language like Java than it is in Ada.

> So: is there anyone on this list who does serious object-oriented
> development in Ada and would like to comment?

Well, this depends of course on how you define serious. What you mostly find
are projects where some OO features are used occasionally but not consistently.
Just using a tagged type here or there certainly does not qualify as "serious
object-oriented development". Personally I have not yet seen any Ada project
where a rigorous OO design and implemenation have been performed. In some
companies the use of any OO features of the language is even strictly forbidden.

Michael




  parent reply	other threads:[~2002-06-22  9:18 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-21 16:39 OOD in Ada? David Crocker
2002-06-21 17:20 ` Pat Rogers
2002-06-21 19:37   ` Ed Falis
2002-06-23  3:05   ` Ted Dennison
2002-06-23  7:03     ` tmoran
2002-06-24 21:41       ` Ted Dennison
2002-06-24 14:19     ` Stephen Leake
2002-06-21 17:22 ` Marin David Condic
2002-06-22  4:42 ` Jeffrey Carter
2002-06-22  9:18 ` Dr. Michael Paus [this message]
2002-06-22  9:47   ` Pascal Obry
2002-06-22 13:11     ` Dr. Michael Paus
2002-06-22 13:46       ` OOD in Ada? Correction Dr. Michael Paus
2002-06-22 18:21         ` Simon Wright
2002-06-28 23:57         ` Randy Brukardt
2002-07-09  8:45           ` Preben Randhol
2002-07-09 17:12             ` Mark Biggar
2002-07-09 19:40             ` Randy Brukardt
2002-06-23  3:33   ` OOD in Ada? steve_H
2002-06-23  4:55     ` Jim Rogers
2002-06-23  5:33       ` achrist
2002-06-25 18:00       ` Georg Bauhaus
2002-06-25 18:55         ` Marin David Condic
2002-07-07 18:19           ` Daniel Dudley
2002-06-23  7:46     ` Dr. Michael Paus
2002-06-24  5:06       ` steve_H
2002-06-23 19:26   ` Chad R. Meiners
2002-06-22 22:47 ` Dmitry A.Kazakov
2002-06-24 20:03 ` Kevin Cline
2002-06-25 13:32   ` David Crocker
2002-06-25 13:58     ` Marin David Condic
2002-06-26 18:16       ` tmoran
2002-06-26 18:47         ` Marin David Condic
2002-06-27 18:23           ` tmoran
2002-06-28 13:09             ` Marin David Condic
2002-06-26  0:59     ` Hyman Rosen
2002-06-26  4:57       ` Jim Rogers
2002-06-26 12:49       ` Marin David Condic
2002-06-26  9:01     ` Fraser Wilson
2002-06-29  0:08       ` Randy Brukardt
2002-07-01 11:50         ` Fraser Wilson
2002-07-05 20:02     ` Stephen J. Bevan
2002-07-09 19:19 ` Craig Carey
replies disabled

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