[Prévia] [Próxima] [Prévia por assunto] [Próxima por assunto]
[Índice cronológico] [Índice de assunto]

Object-oriented units of measurement



Oi,

Na última aula eu citei um artigo recente que apareceu na OOPSLA'2004 com um trabalho que estendeu a linguagem Java para comportar unidades de medidas.

O trabalho é o seguinte e pode ser baixado da Web (com máquinas com IP da USP):

http://portal.acm.org/citation.cfm?id=1028976.1029008


*Object-oriented units of measurement* 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.



Note que um dos autores é o Guy L. Steele, Jr. que é um dos 4 criadores da linguagem Java.

[]s,
fabio.