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-7-bit X-Google-Thread: 103376,e977cd3ab4e49fef X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: Question about record rep spec placement Date: 1997/01/25 Message-ID: <32EA8318.32C4@lmtas.lmco.com>#1/1 X-Deja-AN: 212204332 references: <32E6A985.6C4B@lmtas.lmco.com> <5c7tsn$85h@mill.gdls.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.01 (Win95; U) Date: 1997-01-25T00:00:00+00:00 List-Id: 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