Use Advanced Search to search the entire archive.
[jsr363-experts] Bootstrap
- From: Werner Keil <
>
- To: "
" <
>
- Subject: [jsr363-experts] Bootstrap
- Date: Mon, 27 Jul 2015 11:14:21 +0200
Dear Experts,
I know, some of you may be on holiday these days. Those who can, please
have a look at the "Bootstrap" ticket:
https://java.net/jira/browse/UNITSOFMEASUREMENT-145
and related improvements to API and RI also paving the road to a TCK. That
won't access RI elements directly, rather call an API/SPI mechanism like
"Bootstrap" to retrieve necessary services and types like Unit or Quantity.
While the SE port is still a bit bumpy (no priority for the JSR itself I'm
afraid, it could some day after Java 9 be offered as future RI, but Oracle
won't accept it till Java 10 as far as we know) especially when it comes to
UnitFormat implementations, the SimpleUnitFormat in the RI works pretty
well (it is largely based on old concepts in JSR 275 btw. which was Locale
agnostic, a good thing for Java ME at least;-)
While SystemOfUnits implementations like Units or other extensions on top
of the JSR like SI, US, etc. often stand as providers to constants,
QuantityFactory depends on a context, so you need to call e.g.
Mass m = DefaultQuantityFactory.getInstance(Mass.class).create(23.0,
KILOGRAM);
for one quantity or
Time m = DefaultQuantityFactory.getInstance(Time.class).create(124,
MILLI(SECOND));
for another. Resulting in the proposal of another service:
https://java.net/jira/browse/UNITSOFMEASUREMENT-151
As of now (Otavio called it QuantityFactoryProvider in the SE port, but it
was a final class with only static methods and not SPI-friendly) two
interfaces like
https://github.com/unitsofmeasurement/unit-ri/blob/master/src/main/java/tec/units/ri/spi/QuantityFactoryService.java
exist in RI and SE port.
It would not increase the API significantly (~30kb total) but make sense of
QuantityFactory.
Please have a look and share your thoughts. If you think it's OK it can be
factored into the Spec and subsequently used by the TCK (which is based on
Spec document chapters and content)
Regards,
Werner
[jsr363-experts] Bootstrap
|
Werner Keil |
07/27/2015 |