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 X-Google-Thread: 103376,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/07/29 Message-ID: <6pp9k8$77j$1@platane.wanadoo.fr>#1/1 X-Deja-AN: 376267721 Content-Transfer-Encoding: 8bit References: <6pdhfo$1br$1@platane.wanadoo.fr> <6pi71p$n90$1@platane.wanadoo.fr> <6pk3jh$gpm$2@platane.wanadoo.fr> <6pkoir$sh6$1@nnrp1.dejanews.com> <6pmrkd$5v9$1@platane.wanadoo.fr> <6pnfkv$qkg$1@nnrp1.dejanews.com> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Adalog Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-07-29T00:00:00+00:00 List-Id: dennison@telepath.com a �crit dans le message <6pnfkv$qkg$1@nnrp1.dejanews.com>... >In article <6pmrkd$5v9$1@platane.wanadoo.fr>, > "Jean-Pierre Rosen" wrote: >> OK, it is available as http://perso.wanadoo.fr/adalog/naming9x.zip >> It is a zipped file that contains naming9x.doc (word6 format) and >> naming9x.ps (PostScript) > >27K is mighty small for a Zip file :-). > >It looks like a large part of the original rationale assumes the need for >using generics to provide MI-like facilities to specific child classes of a >class. > >Folks on c.l.a who don't like "Instance" on account of it confusing the issue >of what's an object and what's a type, ought to really dislike this: > >"By the same token, the declaration of the main type is always followed by >the declaration of a subtype for the corresponding class wide type; this >subtype is always named "class"." > >So we're using a package to implement a class. But it contains a type named >"Class". But "Class" isn't actually full type. Its a subtype declared using >the declaration of "Instance", which isn't actually an Instance in the >OO-sense but a type. %-( I appreciate the humour, but it is technically inaccurate. Class *is* a full type, because Instance'class is not the same *type* as Instance. It is even called a "class-wide type", to justify calling it "Class"... OK, I use a subtype to replace a renaming. Note that without this subtype, the class wide type would be called Instance'class, which even I find ugly ;-) >I'm not entirely satisfied with this approach. To me it breaks the fundamental >principle that identifiers should be named to describe their metaobject. >Instance may be used to create instances, but it is *not* itself an instance >(in the OO sense). But neither is it a class in and of itself. It takes the >operations in the package and the type to make up a class. Let me explain once again my position (and I understand perfectly why others may not agree on this). The only use of a type is to declare variables, constants, and formal parameters (these three categories are globally called "objects" in the RM, but I didn't dare using that term in the context of this discussion...). In a client-server model, I tend to favour the client against the server; in this context, it means that I choose a name that maximizes readability of the *variable declaration*, not of the *type declaration*. Given this, I consider that: An_Account : Bank_Account.Instance; -- may contain only an instance of Bank_Account All_Accounts : Bank_Account.Class := F; -- may contain any value in the class of Bank_Account makes sense... -- ---------------------------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://perso.wanadoo.fr/adalog