Use Advanced Search to search the entire archive.
Re: Question: javax.measure.quantity in API
- From: Werner Keil <
>
- To:
- Subject: Re: Question: javax.measure.quantity in API
- Date: Thu, 14 Aug 2014 13:28:06 +0200
Martin/all,
Thanks for picking up on that. The JSR proposal says:
- The RI should support units in the SI system
As explained, that does not mean quantity types shall be part of the RI for
above reasons, but as a minimum there should be SI units:
http://en.wikipedia.org/wiki/International_System_of_Units#Units_and_prefixes
Then there are also these:
http://en.wikipedia.org/wiki/SI_derived_unit Most
of them are in the "quantity" package, but we could have them defined
elsewhere.
Nevertheless it's important to keep them separate from different
implementations, see the ones I did here (for Health/Fitness cases to be
demonstrated during Maker Faire, DemoCamps or JavaZone, etc., and to use
with selected devices like Fitbit or what comes out of Google Fit)
https://github.com/unitsofmeasurement/unit-lib/tree/master/domain
Note, "unit-lib-health" declares quantity sub-types, while "
unit-lib-health-ri" is specific to the JSR 363 RI. That way the same types
can be used seamlessly with other implementations, either the SE one or one
for Android[?]
Regards,
Werner
On Thu, Aug 14, 2014 at 1:00 PM, Martin Desruisseaux <
>
wrote:
>
Hello Otávio
>
>
Le 13/08/14 12:33, Otávio Gonçalves de Santana a écrit :
>
>
In API I see some classes that are specialized of Quantity.
>
Do these classes should not go to impl?
>
I believe the API, should contain the behavior of Quantity and measure
>
Unit and not the specializations, isn't?
>
>
The quantity sub-interfaces are used for compile-time type-safety in two
>
places:
>
>
- When used directly (e.g. a getWaterTemperature() method returning a
>
Temperature instance);
>
- When used for parameterization of Unit<? extends Quantity>.
>
>
If we want to make possible the use of Unit instances from different
>
libraries (implementations), then the fact that Quantity is part of Unit
>
declaration forces us to standardize at least the most important Quantity
>
sub-types. If we don't do that, only Unit<?> in method signature would be
>
implementation-neutral. Any declaration like Unit<Temperature> would be
>
implementation-specific.
>
>
This raise the question about which criterion to use for deciding which
>
Quantity sub-types to include. I will post a separated email on this
>
topic.
>
>
Martin
>
>
Attachment:
347.gif
Description: GIF image