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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8eff44ec1bcf8433 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-23 07:31:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.huji.ac.il!not-for-mail From: "Ehud Lamm" Newsgroups: comp.lang.ada Subject: Re: Container reqs Date: Tue, 23 Oct 2001 16:23:01 +0200 Organization: The Hebrew University of Jerusalem Message-ID: <9r3umu$hvo$1@news.huji.ac.il> References: <9qctpn$lil$1@news.huji.ac.il> <3BCA86C7.BB252751@acm.org> <%jYy7.31350$ev2.37672@www.newsranger.com> <3BCD7C50.647ADBD0@brighton.ac.uk> <9qk44b$utk$1@news.huji.ac.il> <3BD527A8.93C1F68B@brighton.ac.uk> NNTP-Posting-Host: di3-36.dialin.huji.ac.il X-Trace: news.huji.ac.il 1003847199 18424 132.64.13.36 (23 Oct 2001 14:26:39 GMT) X-Complaints-To: abuse@news.huji.ac.il NNTP-Posting-Date: Tue, 23 Oct 2001 14:26:39 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Xref: archiver1.google.com comp.lang.ada:15076 Date: 2001-10-23T16:23:01+02:00 List-Id: wrote in message news:3BD527A8.93C1F68B@brighton.ac.uk... > Yes; but if you *want* to avoid inheritance, the STL is an existence > proof for a possible solution... :-) > > OTOH, if you do want to use inheritance here, some trickery is probably > needed to avoid the library-level problem (since you'll presumably want > generic packages but don't want to force library-level instantiation). > Life isn't simple, is it? I outlined a basic approach that works for me, a few days a go (the abstract types package is parametreized by item. Inheritance, providing implementation, is done in child units). Others presented their apporaches. Let me say a few words concerning my point of view, from a teaching perspective. Since you teach too, I'd be happy to hear your views on these issues. - I want to teach the concept of ADTs, without talking about inheritance, tagged types etc. - I want to be able to show how ADTs can help reuse, by utilizing the container library. - Following the above, I want to be able to explore the concept of "interfaces" in the most general sense: what is sometimes called interface oriented programming. I want to show how a Set ADT defines an interface, and how this interface can have multiple implementations. This, in Ada, means inheritance, and tagged types. However, the situation right now, means you can only directly support one interface (MI idioms are going to be too confusing, I'm afraid). - Interface leads us to class-wide programming, or to the use of signature packages. - The interface relations are best explored using inheritance, and that's fine. Inheritance however can easily be used for other purposes, and I want to minimize the possbility for confusion. - I want to utilize Ada's strong typing, and detest access to Object'class solutions. And all this, before getting into issues of guarded, bounded and other design dimensions. These are also worth considering... Ehud