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,af92cb4b0cc736af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-01 09:04:28 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: problem with abstract types User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Fri, 1 Nov 2002 17:03:51 GMT Content-Type: text/plain; charset=us-ascii References: <3DC12CFF.EC36842C@brighton.ac.uk> <3DC165F9.9000000@attbi.com> <8nmtpa-pd1.ln@uli.uli-eckhardt.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:30291 Date: 2002-11-01T17:03:51+00:00 List-Id: Simon Wright writes: > But to make this work you have to do things the right way: the > "proper" idiom is to initialize using a function, > > declare > Reg : Registry'Class := Open_Registry (...); > begin > > where you might need to include some indication of what sort of > registry to choose in the parameters to Open_Registry. Often people > use strings. This is a classic example of the Factory pattern .. Right, but if the code can't figure out the Tag of Reg when it is created, or if the Tag changes over time, then Reg will have to be of an access-to-Registry'Class type. But that does not imply that all the operations need to take access parameters. They can take Registry parameters, and you would then pass Reg.all as the actual parameter. - Bob