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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8fdcbb4347c7f20a X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Instantiation of child generics? Date: 1996/07/30 Message-ID: #1/1 X-Deja-AN: 171101346 references: <4t9itp$imd@goanna.cs.rmit.edu.au> <4tkuv1$3jm@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-30T00:00:00+00:00 List-Id: In article <4tkuv1$3jm@goanna.cs.rmit.edu.au>, Dale Stanbrough wrote: >concrete unbounded type "queue"). The benefits are that (if you use use) >you can write your code > > myQ:queue; > >and get diff. implementations by changing the with clause. What problems >do you forsee in doing this? Well, it's hardly a big deal, but I just don't like having zillions of things called "queue". It seems confusing. Your "benefit" above only works if there is only one type of queue being used in this module, by the way. If I were using the style of calling all queue types "queue", I would prefer to refer to Whatever_Pkg.Queue. I really don't mind doing a search-and-replace operation if I want to change what sort of queue it is. Emacs can search through multiple files, so it's not that hard. And if you make a mistake, it will likely be detected at compile time. You need to do that search anyway, just in case somebody used an expanded name instead of a use_clause. Finally, if you really want flexibility, you can use abstract class-wide objects (or pointers to them), and try to localize the creation of objects in a Factory package (which is often a good idea anyway). Again, it's no big deal, either way. - Bob