From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,88093378be1184d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-09 20:39:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!ppp-1-20.cvx1.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: List Container Straw Man Date: Sat, 10 Nov 2001 02:20:49 -0000 Message-ID: <9sib28$13aeg3$6@ID-25716.news.dfncis.de> References: <9s941p$11mrei$4@ID-25716.news.dfncis.de> <9s99tt$pdb$1@nh.pace.co.uk> <9s9s8p$11vt7l$1@ID-25716.news.dfncis.de> <9sc5l8$9b7$1@nh.pace.co.uk> <9scke8$12jb14$3@ID-25716.news.dfncis.de> <9sdnva$dpk$1@news.huji.ac.il> <9seup4$12h0ar$3@ID-25716.news.dfncis.de> NNTP-Posting-Host: ppp-1-20.cvx1.telinco.net (212.1.136.20) X-Trace: fu-berlin.de 1005367177 37042691 212.1.136.20 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:16201 Date: 2001-11-10T02:20:49+00:00 List-Id: "Ted Dennison" 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 ;-)