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,1f0e8beefacb537e X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: Engineering types hierarchy Date: 1999/09/08 Message-ID: #1/1 X-Deja-AN: 522490537 References: <7r50i7$e893@svlss.lmms.lmco.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: newsabuse@supernews.com Organization: Software Arts & Sciences X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 1999-09-08T00:00:00+00:00 List-Id: David Kristola wrote in message news:7r50i7$e893@svlss.lmms.lmco.com... > Hello, > > I am trying to put together a robust and easily usable > hierarchy of types packages to support a collection of > engineering units (kilograms, meters, seconds, etc.) > in scalar, vector, and matrix forms. > > So far, i have a list of the base types and combined > types (meters per second and so on) that are going to > be used on this project. > > There is an explosion of operators that i have to > implement. "/" for meters and second returning > meters per seconds, and on, and on, and on. > Of course, there is nothing special about these > operators beyond the typing they do. I have free code for dimensioned unit that avoids the combinatorial explosion, supporting metric units or any other system of measurment. The URL is http://www.classwide.com/products/freecode.htm, and then look for "dimensioned units". It might be useful as a starting point. One thing to keep in mind is that the overhead of maintaining dimensionality may not ultimately be acceptable. In that case a design allowing you to transparently substitute a different implementation of the same interface after unit testing might be appropriate. (Such a change after testing may not be acceptable practice; certainly not in safety-critical software!) This other implementation would not maintain dimensionality and would therefore not have the overhead. The point is that the interface needs to be considered up front so that the substitution works easily. I make no representation that the code above provides such an interface -- it might, I just haven't looked at it for that purpose. -- Pat Rogers Training and Consulting in: http://www.classwide.com Deadline Schedulability Analysis progers@classwide.com Software Fault Tolerance (281)648-3165 Real-Time/OO Languages