comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: pointers & OOP
Date: 1999/05/06
Date: 1999-05-06T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.10.9905062007340.27089-100000@shell5.ba.best.com> (raw)
In-Reply-To: kfgz+IAjeKM3EwgM@jr-and-assoc.demon.co.uk

On Wed, 5 May 1999, John Robinson wrote:

> In article <7gq27t$vnd$1@nnrp1.deja.com>, Robert Dewar <robert_dewar@my-
> dejanews.com> writes
> >In article <MVsZ8DAT0AM3EwF3@jr-and-assoc.demon.co.uk>,
> >  John Robinson <john@jr-and-assoc.demon.co.uk> wrote:
> >
> >> Hence, a mapping from UML to Ada 95 should always map a single UML class
> >> box onto a package containing a single tagged type.  Although the
> >> language allows multiple tagged types to be declared in a single package
> >> it makes no sense whatsoever to do so.

OK, you agree with Bertrand Meyer that the class is the unit of modularity 
I happen to think otherwise. 

> >This is very wrong. In fact I would say that you have essentially completely
> >missed one of the most powerful features of Ada, namely that the packages
> >and tagged types need NOT be in 1-1 correspondence. 
> 
> No I didn't miss this fact.  I choose to implement a one-to-one mapping,
> and judging by a quick review of my bookshelf I am in good company.

My bookshelf says different.

> >You sound like a C++
> >programmer trying to squeeze the paradigms you are used to into Ada 95 in
> >an ugly and very unnatural way. 

I think we should stop accusing each other of being C or C++ programmers,
since many professional programmers have used C and C++, and could easily 
qualify. Besides, Ada 95 is the only language I know in which pointers 
and OOP are orthogonal, so I could just as easily accuse Mr. Robinson of 
being an Eiffel programmer trying to do a little paradigm squeezing :-).

> >Very often putting multiple types into a single package solves in a neat and
> >clean way nasty problems that simply don't have neat solutions in other
> >languages.
> 
> Such as?  

Providing access to representation information. A good example is an
iterator class or type. 

> The use (in general) of one "major" type per package goes back to my

Well, now its become one "major" type per package. This is a lot weaker
than your original claim. I might even agree with this one, and my own 
example clearly has the collection as the major type. A naming convention
which I like, which some people find too C-ish, is to name the major type
of a package "T" and the minor types things like Iterator_T or Index_T,
and rely on the package name to "really" name the major type, like
Lists.T, Lists.Iterator_T, etc. I still wouldn't reject a package with two 
symmetric (neither more major than the other), coencapsulated tagged types
as being a bad design, I just can't remember having had to do that except 
when using access discriminants to do MI, which doesn't really count.

I think your original claim about the inability to do OOP without pointers 
is more convincing in the weak version too, since there are some things 
like heterogeneous collections (in general) and access discriminant tricks 
(in Ada 95) that require access types, but its obvious that you can use 
OOP features in a pointerless program. How much OOP do you have to use for
an application to be a major OOP application?

-- Brian






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

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-01  0:00 pointers & OOP Matthew Heaney
1999-05-01  0:00 ` Matthew Heaney
1999-05-03  0:00 ` John Robinson
1999-05-03  0:00   ` Samuel Mize
1999-05-04  0:00     ` Martin C. Carlisle
1999-05-04  0:00     ` Robert Dewar
1999-05-04  0:00   ` Robert Dewar
1999-05-04  0:00     ` Mike Silva
1999-05-05  0:00     ` John Robinson
1999-05-05  0:00       ` Robert Dewar
1999-05-05  0:00         ` John Robinson
1999-05-06  0:00           ` Brian Rogoff [this message]
1999-05-07  0:00             ` dennison
1999-05-07  0:00               ` Brian Rogoff
1999-05-10  0:00                 ` dennison
1999-05-11  0:00                   ` Jean-Pierre Rosen
1999-05-11  0:00                     ` dennison
1999-05-10  0:00             ` John Robinson
1999-05-14  0:00               ` Matthew Heaney
1999-05-14  0:00                 ` David Botton
1999-05-14  0:00           ` Matthew Heaney
1999-05-14  0:00             ` Ed Falis
1999-05-05  0:00       ` Matthew Heaney
1999-05-05  0:00       ` Robert Dewar
1999-05-08  0:00         ` Ehud Lamm
1999-05-06  0:00       ` Tom Moran
1999-05-06  0:00         ` John Robinson
1999-05-06  0:00           ` Tom Moran
1999-05-07  0:00             ` dennison
1999-05-07  0:00             ` dennison
1999-05-07  0:00             ` dennison
1999-05-10  0:00             ` John Robinson
1999-05-14  0:00         ` Matthew Heaney
1999-05-06  0:00       ` Simon Wright
1999-05-06  0:00         ` John Robinson
1999-05-08  0:00           ` Simon Wright
1999-05-10  0:00             ` John Robinson
1999-05-05  0:00     ` Francois Godme
  -- strict thread matches above, loose matches on Subject: below --
1999-05-01  0:00 Tom Moran
replies disabled

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