comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Idiom for a class and an object in Ada
Date: Wed, 20 Oct 2004 09:58:52 +0200
Date: 2004-10-20T09:58:52+02:00	[thread overview]
Message-ID: <14c2cz6mqb2jr.14y3calkn0fm7$.dlg@40tude.net> (raw)
In-Reply-To: 41753277$0$74190$39cecf19@news.twtelecom.net

On Tue, 19 Oct 2004 11:40:08 -0400, Matthew Heaney wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2004-10-20  7:58 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 11:47 Idiom for a class and an object in Ada Marin David Condic
2004-10-18 12:14 ` Martin Krischik
2004-10-18 19:40   ` Matthew Heaney
2004-10-19 12:59   ` Marin David Condic
2004-10-19 14:46     ` Martin Dowie
2004-10-19 15:55       ` Matthew Heaney
2004-10-19 18:31         ` Martin Dowie
2004-10-19 15:52     ` Matthew Heaney
2004-10-18 12:26 ` Marius Amado Alves
2004-10-19  2:09   ` Jeffrey Carter
2004-10-19  3:28     ` Matthew Heaney
2004-10-19 12:53       ` Marin David Condic
2004-10-19 14:44         ` Matthew Heaney
2004-10-19 15:01           ` Dmitry A. Kazakov
2004-10-19 15:40             ` Matthew Heaney
2004-10-20  7:58               ` Dmitry A. Kazakov [this message]
2004-10-20 12:31                 ` Marin David Condic
2004-10-20 13:53                   ` Dmitry A. Kazakov
2004-10-20 15:23                   ` Matthew Heaney
2004-10-21 12:24                     ` Marin David Condic
2004-10-21 17:15                       ` Matthew Heaney
2004-10-20  5:39         ` Simon Wright
2004-10-20  7:24           ` Matthew Heaney
2004-10-20  8:39             ` Dmitry A. Kazakov
2004-10-21  1:36             ` Jeffrey Carter
2004-10-21  1:46               ` Matthew Heaney
2004-10-21  7:51                 ` Dmitry A. Kazakov
2004-10-21 12:45                   ` Matthew Heaney
2004-10-21 14:11                     ` Dmitry A. Kazakov
2004-10-22  1:04                 ` Jeffrey Carter
2004-10-22  1:36                   ` Matthew Heaney
2004-10-21 19:31               ` Kevin Cline
2004-10-21 22:02                 ` Matthew Heaney
2004-10-22  0:10                   ` Matthew Heaney
2004-10-21  8:25             ` Martin Dowie
2004-10-20 17:04           ` Matthew Heaney
2004-10-20 19:37             ` Simon Wright
2004-10-20 20:04               ` Matthew Heaney
2004-10-22  5:37                 ` Simon Wright
2004-10-20  1:10       ` Jeffrey Carter
2004-10-20  7:04         ` Matthew Heaney
2004-10-20 12:42           ` Marin David Condic
2004-10-20 12:55             ` Matthew Heaney
2004-10-20 15:27             ` Matthew Heaney
2004-10-21  1:36               ` Matthew Heaney
2004-10-19 12:38   ` Marin David Condic
2004-10-18 16:59 ` Matthew Heaney
2004-10-18 18:02 ` Martin Dowie
2004-10-19 13:06   ` Marin David Condic
2004-10-19 14:51     ` Martin Dowie
2004-10-20 16:20 ` Michael Paus
2004-10-20 17:15   ` Matthew Heaney
2004-10-20 17:55     ` Michael Paus
2004-10-21 12:33   ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2004-10-21 13:59 Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox