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-Thread: 103376,901038687c38f61c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Idiom for a class and an object in Ada Date: Wed, 20 Oct 2004 09:58:52 +0200 Message-ID: <14c2cz6mqb2jr.14y3calkn0fm7$.dlg@40tude.net> References: <41752559$0$91011$39cecf19@news.twtelecom.net> <138j4nfhzsc45$.1581kzqfi5e89$.dlg@40tude.net> <41753277$0$74190$39cecf19@news.twtelecom.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de kFvVp2aU0ESKmur8zY8wEg9eSvDfRHXbKSfa0o+/0dEwp1VOw= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:5498 Date: 2004-10-20T09:58:52+02:00 List-Id: On Tue, 19 Oct 2004 11:40:08 -0400, Matthew Heaney wrote: > "Dmitry A. Kazakov" wrote in message > news:138j4nfhzsc45$.1581kzqfi5e89$.dlg@40tude.net... >> On Tue, 19 Oct 2004 10:44:04 -0400, Matthew Heaney wrote: >> >>> The term "class" in Ada has a very specific meaning. In Ada, it means >>> "family of types." Specifically, it means "family of tagged types, >>> having >>> this common ancestor." >> >> This is incorrect. For example ARM 12.5 refers classes of types other than >> "class rooted in". > > Yes, of course it does, but that's obviously not what we're discussing here, > since the OP isn't using the term "class" in the sense of "class of integer > types," etc. > > We simply need to clarify whether we're talking about a specific type T, or > a family of types rooted at T, namely T'Class. [ BTW, to be even more pedantic (:-)), T'Class is not a family of types. It is *a* type, which is a closure of that family. ] Anyway, I see nothing criminal in the package name "AD_Converter_Class". The names should reflect the application domain, rather than language gears. With some minor exceptions, which IMO always more or less reflect language deficiencies (I mean XXX_Ptr, XXX_Type etc), Hungarian notation and company is an evil thing. I have no problem to read AD_Converter_Class as "a class of physical devices, described in general by this package". Whether that class is mapped to a type or to a class of related types is a design decision. But the original question was how to name the ultimate instances of that type or types of a family, including generic case, sets of derived types, constrained subtypes, whatsoever. The idiom should not depend on where the instances come from. So important is only (if I correctly understood Marin): 1. Instances are statically known 2. Instances should be public 3. Instances should have unique names (no arrays of, no containers of, no factories of) My personal preference is (b) - child packages. When necessary, one can additionally create an assembly package with renames of converters instances from different packages: with AD_Converter_Class.Diamond; with AD_Converter_Class.AX10410A; ... package AD_Converter_Class.This_Board_Hardware is AD_1 : AD_Converter_Class.Diamond_MM.AD; AD_2 : AD_Converter_Class.AX10410A.AD; ... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de