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 X-Google-Thread: 103376,76ec5d55630beb71 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-03 02:11:10 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!213.200.246.247!not-for-mail From: Vinzent Hoefler Newsgroups: comp.lang.ada Subject: Re: Ada 200X Date: Tue, 03 Jun 2003 11:09:50 +0200 Organization: JeLlyFish software Message-ID: References: <3EDAD07A.3010200@attbi.com> <3EDB5DBE.4070807@attbi.com> <3EDBBC18.6080103@attbi.com> NNTP-Posting-Host: 213.200.246.247 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: fu-berlin.de 1054631468 9956182 213.200.246.247 (16 [175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:38445 Date: 2003-06-03T11:09:50+02:00 List-Id: Robert I. Eachus wrote: >Vinzent Hoefler wrote: > >> Because the view conversion to a grandparent is of course allowed, >> this is little tricky if not to say error prone sometime. >>=20 >> Well, yes, I know, you should always design your object hierarchy >> beforehand. ;-) > >In one sense this is a valid criticism of the "Ada way" of doing things.= =20 > In another it is totally bogus. I was afraid so. ;-) >Ada tagged type derivation trees tend to come in two flavors. [...] Mmh, well. I encounter a third variant quite often. For instance let's take a short look at a part of the good old TurboVision object hierarchy: | +-------+ | =A6TObject=A6 | +-------+ | | | +-----+ | =A6TView=A6 | +-----+ | | | +----------------------------------------------+ | | | | | | | | | +----------+ | +----------+ | +--------+ | +------+ | |TScrollBar| | |TInputLine| | |TCluster| | |TGroup| | +----------+ | +----------+ | +--------+ | +------+ | | | | | | | +-----------+ +--------+ | +-----------+ +-------------+ | =A6TStaticText=A6 =A6THistory=A6 | =A6TListViewer=A6 = | | +-----------+ +--------+ | +-----------+ | | | | | | | +-----------+ | +-----------+ | | | | | | | | | +------+ +----------+ | +--------+ +--------------+ | | |TLabel| |TParamText| | |TListBox| |THistoryViewer| | | +------+ +----------+ | +--------+ +--------------+ | | +------+--------+ +--------+ | | | | | | | +-----------+ | +-------+ | | |TCheckBoxes| | |TWindow| | | +-----------+ | +-------+ | +-------------+ +----------------+ | | |TRadioButtons| |TMultiCheckBoxes| | | +-------------+ +----------------+ | | +-------------+ | | | | +--------------+ +-------+ | |THistoryWindow| |TDialog| | +--------------+ +-------+ This rather looks like a tree. And I doubt, any medium sized OO-System would be much different from that just because it's Ada. So let's say, as a specific example, I am deriving MyWindow from TWindow, slightly change one of its method and let the fathers method do the usual rest. Now I decide to insert another object (of course I will derive from that later) into the tree, so that TWindow is now the grandfather of MyWindow. Because I am still calling the method of TWindow I skip the new inbetween object's method. This might be wrong or false depending on what it does and what I intended to do. So having something like "inherited" in Object-Pascal that automagically selects the right method of either the father, grandfather, grand-grandfather, ..., in the cases where I *really* just want to use the method of the anchestor would be nice. Well, after a night of thought I see some problems with that, especially that it 1) hides where exactly the method comes from (depending on the view of information hiding this might be a good or a bad thing) and 2) a worse case: If the anchestor, whos method I am about to call, is really declared in another package that I didn't even "with"ed in. Vinzent. --=20 Parents strongly cautioned -- this posting is intended for mature audiences over 18. It may contain some material that many parents would not find suitable for children and may include intense violence, sexual situations, coarse language and suggestive dialogue.