ACM Home Page
Please provide us with feedback. Feedback
Object-oriented units of measurement
Full text PdfPdf (297 KB)
Source Conference on Object Oriented Programming Systems Languages and Applications archive
Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications table of contents
Vancouver, BC, Canada
SESSION: Languages table of contents
Pages: 384 - 403  
Year of Publication: 2004
ISBN:1-58113-831-9
Also published in ...
Authors
Eric Allen  Sun Microsystems Laboratories, Burlington, MA
David Chase  Sun Microsystems Laboratories, Burlington, MA
Victor Luchangco  Sun Microsystems Laboratories, Burlington, MA
Jan-Willem Maessen  Sun Microsystems Laboratories, Burlington, MA
Guy L. Steele, Jr.  Sun Microsystems Laboratories, Burlington, MA
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
SIGSOFT: ACM Special Interest Group on Software Engineering
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 8,   Downloads (12 Months): 74,   Citation Count: 6
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1028976.1029008
What is a DOI?

ABSTRACT

Programs that manipulate physical quantities typically represent these quantities as raw numbers corresponding to the quantities' measurements in particular units (e.g., a length represented as a number of meters). This approach eliminates the possibility of catching errors resulting from adding or comparing quantities expressed in different units (as in the Mars Climate Orbiter error [11]), and does not support the safe comparison and addition of quantities of the same dimension. We show how to formulate dimensions and units as classes in a nominally typed object-oriented language through the use of statically typed metaclasses. Our formulation allows both parametric and inheritance poly-morphism with respect to both dimension and unit types. It also allows for integration of encapsulated measurement systems, dynamic conversion factors, declarations of scales (including nonlinear scales) with defined zeros, and nonconstant exponents on dimension types. We also show how to encapsulate most of the "magic machinery" that handles the algebraic nature of dimensions and units in a single meta-class that allows us to treat select static types as generators of a free abelian group.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
 
2
3
4
 
5
W. Brown. Applied Template Metaprogramming in SIUnits: the Library of Unit-Based Computation. In Proceedings of the Second Workshop on C++ Template Programming, October 2001. Available at http://www.oonumerics.org/tmpw01/brown.pdf.
6
 
7
J.C. Cleaveland. Redundant Specification in Programming Languages Through Pouches. UCLA Technical Report. 1975.
8
 
9
D. Ferrucci, C. Welty. What's in an Instance? RPI Computer Science Technical Report. 1994.
 
10
 
11
D. Isbell, D. Savage. Mars Climate Orbiter Failure Board Releases Report, Numerous NASA Actions Underway in Response. NASA Press Release 99-134. http://nssdc.gsfc.nasa.gov/planetary/text/mco pr 19991110.txt. Nov. 10, 1999.
 
12
 
13
N. Gehani. Units of Measure as a Data Attribute. Computer Languages, Vol. 2. pp. 93--111. Pergamon Press, 1977. Printed in Great Britain.
 
14
N. Gehani. Databases and Units of Measure. IEEE Transactions on Software Engineering. Vol. SE-8, No. 6, November 1982.
 
15
 
16
J. Goubault. Inference d'unites physiques en ML. In P. Cointe, C. Queinnec, and B. Serpette, editors, Journees Francophones des Langages Applicatifs, Noirmoutier, p.3--20. INRIA, Collection didactique, 1994.
17
 
18
19
 
20
 
21
A. Kennedy. Programming Languages and Dimensions. PhD Thesis. St. Catharine's College. November 1995.
22
23
 
24
P. Neumann. Risks to the public from the use of computers. ACM Software Engineering Notes, 10(3) July 1985.
 
25
M. Sulzmann, The Chameleon website. http://www.comp.nus.edu.sg/ sulzmann/chameleon/
 
26
 
27
 
28
M. Wand, P. M. O'Keefe. Automatic dimensional inference. In J.-L. Lassez and G. Plotkin, editors, Computational Logic: Essays in Honor of Alan Robinson. MIT Press, 1991.
 
29


Collaborative Colleagues:
Eric Allen: colleagues
David Chase: colleagues
Victor Luchangco: colleagues
Jan-Willem Maessen: colleagues
Guy L. Steele, Jr.: colleagues