--
You received this message because you are subscribed to the Google Groups "units-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to units-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Werner and All,I am fine with this early draft (it is very close to latest JSR-275 work). I am not sure we should keep the QuantityFactory and spi package in the API though (too implementation dependent).Cheers,Jean-Marie.
On Wed, Nov 26, 2014 at 4:56 PM, Werner Keil wrote:
Hi,JSR 363 is soon about to publish Early Draft.Please have a look at the Spec on Google Docs: https://docs.google.com/document/d/12KhosAFriGCczBs6gwtJJDfg_QlANT92_lhxUWO2gCYFeedback is welcome either here on the mailing list or for those of you with java.net account feel free to use JIRA.Cheers,Werner
--
You received this message because you are subscribed to the Google Groups "units-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to units-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Werner
Please have a look at the Spec on Google Docs: https://docs.google.com/document/d/12KhosAFriGCczBs6gwtJJDfg_QlANT92_lhxUWO2gCY
Sorry for being so late. I just had a look and the
specification, and it looks okay. I fixed some formatting but
otherwise did not edited the content. Below are my comments
about the content:
The three last bullets at the bottom of the page (about
concrete classes) are not part of the specification, but rather
of the reference implementation. I suggest to either omit them,
or insert a line before them saying "The reference
implementation includes:".
First bullet ("Small or no runtime overhead compared with an
implementation not using Unit-API") is not true: there is
a huge overhead in using arithmetic operations on Quantity
compared to double primitive type. I suggest to either
remove that bullet, or explain that it may be true only when
using UnitConverter directly, not Quantity.
Paragraph contains "decimal point number" words. Do you
mean "floating point number", or maybe "decimal number"?
Where the picture come from? Do we have the right to insert it
in our document (does the picture has a license)?
Could the Medical & Healthcare and Quantified Self use cases give actual examples of units or quantities?
I wonder if the following sentence should be rephrased? In
particular starting with something else the "See", avoiding
acronyms not defined in the specification. I'm also do not quite
understand what is a "connected scale".
See a few personal health devices from “Smart Pill Boxes” (knowing the dosage a patient needs based on their EHR) to connected scales, blood pressure, heartbeat or sugar sensors.
I don't think that Vector should implement Quantity.
It could have implemented Measurement if we had kept
that interface, but not Quantity if we understand it
as a scalar measurement. I suggest to replace the first line by:
public class Vector<Q extends Quantity> {
I have not yet finished. Will continue the review a little bit
later...
Martin
Le 13/12/14 03:40, Werner Keil a écrit :
Do sentence do not specify under which circumstances there is no overhead. The vast majority of developers use the double primitive types, for which there is a huge overhead. Furthermore even in the case of BigDecimal, we still have the cost of checking the unit, potentially applying conversion or unit multiplication.
Hello Werner, Frank and all
Answers below, separated in 3 sections (types, coefficients and
errors):
I agree with Frank that some way to get the formulas used by a UnitConverter
may be useful. The interfaces proposed by Frank could work, but it
may be a little bit late for introducing them. Furthermore
defining those interfaces may expose more implementation details
than desired:
If we provide the proposed UnitConverter
sub-interfaces, it would make the above implementation choices
more visible.
A partial alternative could be to replace the isIdentity()
and isLinear() methods by a single getConversionType()
method which would returns one of the following enum values:
enum ConversionType {IDENTITY, LINEAR, LOGARITHMIC, EXPONENTIAL, OTHER}
I think the identity, linear, logarithmic and exponential cases
cover almost all unit conversions in SI and imperial system,
except conversions of sexagesimal degrees to decimal degrees.
Admittedly this enum proposal does not provide the function
coefficients.
On Frank's point about the difficulty to get the coefficients of
the underlying conversion (current API leads to approximative
values), I agree with him. I proposed a while ago the following
methods in UnitConverter:
/** * Returns the derivative of this conversion function at the given value. * Note that for a linear conversion, the derivative is the slope and is the same for all x values. */ double derivative(double x);
Derivatives are really needed for advanced users. For those who
are not so comfortable with mathematics, at least this method
allow them to get the slope of a linear function, which meets part
(admittedly not all) of Frank's request.
If we take inspiration from ISO 19111 (coordinate operations)
terminology, a conversion is by definition exact to the accuracy
allowed by floating point operations. An operation with known
errors (not due to floating point rounding errors) is called transformation,
and I think is out of scope of JSR-363 since there is many kinds
of such errors. Furthermore, unit conversions are often exact by
definition. For example the conversion factor from inches to
centimetres is 2.54 by definition, so I don't think that
we need (or should) handle the case of approximative
transformations. I would rather said in the specification that
implementations shall use the official definitions with all the
accuracy given by the standard body.
Martin
--
You received this message because you are subscribed to the Google Groups "Units Developers" group.
Hi Werner and All,It looks good, but is there a way to identify what has changed from version 1.0 (e.g. font color different).This would be useful for people who already know v 1.0 and want only look at the changes.Thanks,Jean-Marie
Hello Werner
Sorry if my question is trivial. Could we summarize the situation please?
Thanks
Martin