comp.lang.ada
 help / color / mirror / Atom feed
From: Ken Garlington <GarlingtonKE@lmtas.lmco.com>
Subject: Re: Question about record rep spec placement
Date: 1997/01/25
Date: 1997-01-25T00:00:00+00:00	[thread overview]
Message-ID: <32EA8318.32C4@lmtas.lmco.com> (raw)
In-Reply-To: 5c7tsn$85h@mill.gdls.com


Art Schwarz wrote:
> 
> > The way we intend a clients to read this is: You can
> > assume that a Message has components Priority, Port, and
> > Data, with the types shown. However, there are no guarantees
> > as to the size of a Message, the placement of components
> > within that message, the number of bits each component will
> > use, etc. being stable from release to release. (In some
> > cases, of course, you can use attributes to determine the
> > current values, but it's up to the client to protect himself
> > from changes in those attribute values.)
> 
> Why not supply procedures (methods) for setting and retrieving
> values of interest within the record? One advantage (of procedures)
> is it allows explicit front-end validity checks. Another advantage
> may be to allow the type to be private.

As I noted at the end of my message, that's certainly an option.
However, we found in practice that, assuming that we didn't really want
to make the type private (that is, we wanted all of the operations
usually available to a record declared in the visible part of the spec
to be available), it was more error-prone to make it private and write
all those access operations manually. This has been the SPC experience
as well.

I'm not sure I follow the logic of making a type private, in order to
accrue the "advantage" of making a type private! If I wanted to narrow
the operations available to the record, or I expected those operations
to change over time, or if I wanted to enforce certain relationships
between the components, then certainly it makes sense. Otherwise, it
just adds unnecessary complexity, which is something you don't want -
particularly in our systems, which are safety-critical. It's one of
the nice things about Ada: you have very good control (most of the time,
anyway) about how much you want to do explicitly, and how much you want
created implicitly. It's not an "all or nothing" language with respect
to visibility.

> 
> art
> schwarza@gdls.com

--
LMTAS - The Fighter Enterprise - "Our Brand Means Quality"
For job listings, other info: http://www.lmtas.com or
http://www.lmco.com




  reply	other threads:[~1997-01-25  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-15  0:00 Question about record rep spec placement Ken Garlington
1997-01-15  0:00 ` Norman H. Cohen
1997-01-16  0:00   ` Ken Garlington
1997-01-17  0:00     ` Robert A Duff
1997-01-18  0:00       ` Ken Garlington
1997-01-15  0:00 ` Bob Gilbert
1997-01-16  0:00   ` Fergus Henderson
1997-01-17  0:00   ` Ken Garlington
1997-01-17  0:00     ` Bob Gilbert
1997-01-17  0:00       ` Robert A Duff
1997-01-17  0:00         ` Ken Garlington
1997-01-18  0:00           ` Robert A Duff
1997-01-18  0:00             ` Ken Garlington
1997-01-19  0:00               ` Robert A Duff
1997-01-21  0:00         ` Bob Gilbert
1997-01-22  0:00           ` Ken Garlington
1997-01-23  0:00             ` Art Schwarz
1997-01-25  0:00               ` Ken Garlington [this message]
1997-01-24  0:00             ` Bob Gilbert
1997-01-25  0:00               ` Ken Garlington
1997-01-20  0:00       ` Ken Garlington
1997-01-16  0:00 ` Jerome Desquilbet
1997-01-16  0:00 ` Jeff Creem
replies disabled

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