comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@adaos.worldonline.co.uk>
Subject: Re: List Container Straw Man
Date: Sat, 10 Nov 2001 02:20:49 -0000
Date: 2001-11-10T02:20:49+00:00	[thread overview]
Message-ID: <9sib28$13aeg3$6@ID-25716.news.dfncis.de> (raw)
In-Reply-To: AyTG7.18995$xS6.30775@www.newsranger.com

"Ted Dennison" <dennison@telepath.com> wrote in message
news:AyTG7.18995$xS6.30775@www.newsranger.com...
> In article <9seup4$12h0ar$3@ID-25716.news.dfncis.de>, Nick Roberts says...
> >
> >Not really. My approach (as Ted's) uses generic packages instantiated
with
> >the element type. I use a hierarchy of tagged types to represent
iterators
> >(of gradually increasing complexity) based on that element type: it is
this
> >which ensures a common (iterator) interface.
>
> I don't really have any major problems with this approach in a component
> facility in general. The main issue I have with it for the effort we are
talking
> about is that it requires those multiple generic instantiations. That was
the
> complaint with Booch that started this whole effort. If people can live
with
> those, then my vote is for Booch. Otherwise, I think we are forced to
design
> things using only independant generic packages.

But I really feel this is like someone trying to argue that an aeroplane
would be much less complex if it didn't have any wings. In real software, I
am certain, my design would save great quantities of programming (writing
the same old thing over and over again for different container types). Ada
is supposed to be about software re-use; wouldn't it be a great shame if a
common containers library for Ada failed to facilitate re-use?

> My ideal component library, like yours, would be much more complex than
the
> strawman. Heck, it may even be the same as yours. But we aren't shooting
for
> ideal here. We are shooting for something *simple* that Ada newbies can
figure
> out w/o much trouble, but which is still usable for most serious
applications.

Well, I've shown a few examples of using my design. It basically requires
two instantiations (one generic parameter each). Students could learn this
pattern by rote until they got to understanding it (just like Sequential_IO
and Direct_IO). I can't believe that it's too complicated for anyone.

> If you can find a way to default things so that there's a way to use it w/
only
> one instantiation, I'd like to see it.

There is a way (you put the abstract types package instantiation inside the
container package), but this trick is poor design in most cases, since it
doesn't decouple the software so much. (A general principle of good software
engineering is to maximise the decoupling of the modules.) The user should
just do the two instantiations and not complain! It's only a bit of typing*.

--
Nick Roberts





*and Ada is a strongly typed language (sorry ;-)






  reply	other threads:[~2001-11-10  2:20 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-06 16:45 List Container Straw Man Nick Roberts
2001-11-06 17:29 ` Stephen Leake
2001-11-06 18:25   ` Marin David Condic
2001-11-06 23:02     ` Nick Roberts
2001-11-07 19:49       ` Stephen Leake
2001-11-07 20:30         ` Marin David Condic
2001-11-07 23:58           ` Nick Roberts
2001-11-08  4:34             ` Jeffrey Carter
2001-11-08 10:45             ` Ehud Lamm
2001-11-08 19:09               ` Nick Roberts
2001-11-09 16:32                 ` Ted Dennison
2001-11-10  2:20                   ` Nick Roberts [this message]
2001-11-10 19:50                     ` Ehud Lamm
2001-11-11  3:48                       ` Nick Roberts
2001-11-08 10:41           ` Ehud Lamm
2001-11-08 19:20             ` Marin David Condic
2001-11-08 20:35               ` Ehud Lamm
2001-11-09 16:39             ` Ted Dennison
2001-11-08  0:06         ` Nick Roberts
2001-11-09 16:16           ` Stephen Leake
2001-11-09 16:24             ` Ehud Lamm
2001-11-09 16:52               ` Brian Rogoff
2001-11-09 18:04             ` Darren New
2001-11-09 20:05               ` Stephen Leake
2001-11-10  3:24             ` Nick Roberts
2001-11-06 23:52   ` Nick Roberts
2001-11-07  4:44     ` A question and a request Eric Merritt
2001-11-07 11:00       ` Preben Randhol
2001-11-07 12:54         ` David C. Hoos, Sr.
2001-11-08  2:35           ` dale
2001-11-07 13:24         ` Eric Merritt
2001-11-07 13:58       ` James Rogers
2001-11-07 16:32       ` Jeffrey Carter
2001-11-09 23:32       ` Matthew Heaney
replies disabled

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