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,2e11aa5522d5cc28 X-Google-Attributes: gid103376,public From: gwinn@res.ray.com (Joe Gwinn) Subject: Re: Mixing Ada and C++. Is a good idea? Date: 1997/11/20 Message-ID: #1/1 X-Deja-AN: 291118382 References: <345F7489.A10@si.ehu.es> Organization: Raytheon Electronic Systems Newsgroups: comp.lang.ada Date: 1997-11-20T00:00:00+00:00 List-Id: In article , mheaney@ni.net (Matthew Heaney) wrote: > In article , > gwinn@res.ray.com (Joe Gwinn) wrote: > > >Beware variant records in OO. Ada83 variant records have the well-known > >property that if anything in any record in the variant set changes, > >everybody who uses any member of that set must recompile. In practice, in > >a project of any size, this means one recompiles the world just about > >every day. > > If you're recompiling the world every day, then something is wrong with the > design of the application, not with the language. > > This phenomenon often occurs when a "common types" package is being used, > that contains a lot of low-cohesion type declarations that everyone with's. > Add another type, and everyone who touches that package needs to be > recompiled. You need to break the single, large, low-cohesion package up > into several smaller packages, that each contains a set a high-cohesion > types. That way, when you add another type, only that corner of the > application that depends on that specific package needs to be recompiled. It was a nice theory, one that we never did get to work in a project of any size, because the inherent cohesiveness of the variables was not all that high. This has been true in all projects past some critical size, regardless of language, from the days of assembly on to the present. Having never gotten such a thing to work in the past, in any language, I have simply given up on the approach. Another nice theory. > If you're doing a message passaging (perhaps the common types package > declares a variant record containing all message types), then use the > streams facility, so a package only depends on the predefined streams > packages. You might even consider deriving message types from a > Root_Message tagged type, so that message tags will be determined by the > compiler. Better still is to use the distributed systems annex. Streams? In Ada83? I don't think so. In my current project, now in Ada95, we cannot use the streams because we are using a COTS middleware package to implement damage-tolerant realtime communications, and this middleware package has its own APIs. Joe Gwinn