Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
"I'm not back." - Bill Harding, Twister
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Why would that be unambiguous? I assumed that it was inches... or was it feet.Originally posted by Mapraputa Is:
<element name="height" type="length"/>
<height>5.9</height>
which would unambiguously mean "5.9 m"
Tell me where I am wrong.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
"I'm not back." - Bill Harding, Twister
Rob
SCJP 1.4
Originally posted by Elliotte Rusty Harold:
"This strikes me as a very interesting idea in principal. Unit analysis was one of the simplest and most powerful techniques I learned in physics, and I've long felt that the lack of support for units has been a major flaw in virtually all programming languages from Fortran through C#."
http://www.cafeaulait.org/2001march.html
Originally posted by Elliotte Rusty Harold:
"Nonetheless I wonder if Java is really the right language in which to do this. While a class library for unit handling would certainly be useful, I'd be a lot more excited to see a language built around this idea in which all primitive numeric variables had units (or were explicitly dimensionless). Such a language would probably need to eliminate the distinction between primitive and object types to allow for new units to be attached to the base types. Does any such language already exist?"
http://www.cafeaulait.org/2001march.html
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Originally posted by Frank Carver:
On the other hand, a standardization strategy only works where the conversion factors are static and well understood. Using SI units for physical measurements is cool, but won't work for money, for example, where the exchange factors are dynamic.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
"I'm not back." - Bill Harding, Twister
Originally posted by Mapraputa Is:
I have a thermometer that shows temperature in both F and C, which effectively disproves your thesis about impossibility of unit conversion.
My point is: there is no point in achieving absolute precision because all measurements are imprecise by definition. There are always metering errors. Then, if you represent your even unconverted data as float numbers, they will be imprecise anyway...
Well, this your argument undermines the whole computer industry, not only XML with proposed units added. :roll: Why use Java if a programmer still can make a mistake in algorithm?
I am saying that
<element name="height" type="length" measurement="feet"/>
<height>5.9</height>
as you proposed, is much better than
<element name="height" type="float"/>
<height>5.9</height>
Whether all units should be in SI is another question, that must be properly and thoroughly discussed.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
This is an interesting question. Java has done amazing things with internationalization that it is surprising that nothing has been done in this area. We do date transformations from one locale to another why not unit transformations from one locale to another? Then we could ask our database how much Map weighs and Map would see the answer in kilograms, Angela would see the answer in stones, and I wouldn't see the answer because women never tell men their weight.Originally posted by Mapraputa Is:
2) why there is (after Rob's post I will say was) no support for units/unit conversion in Java API?
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Frank Carver:
It's all well and good to speak of seven basic units in the SI system, but other systems of measurement are not so lean and self-consistent.
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Don't get me started about those stupid light bulbs. |