Use Advanced Search to search the entire archive.
[jsr363-experts] Re: Should JSR-363 API provide the SI class?
- From: Leonardo Lima <
>
- To: "
" <
>
- Subject: [jsr363-experts] Re: Should JSR-363 API provide the SI class?
- Date: Tue, 16 Dec 2014 08:02:10 -0200
I'd like to try exposing the SI units (and the relevant classes as well).
My experience with the current state of the API left me thinking it was too
much work to get a Unit like Liter (or Litre or Litro).
I'm just afraid of the RAM cost for this exposure, as we do have small
systems. Again, the main concern is RAM usage, not Flash storage. So the
API can be "big" in .jar size, but using one or two classes mustn't cause
it to use a lot of RAM.
Regards,
Leonardo.
On Sun, Dec 14, 2014 at 8:59 AM, Werner Keil
<
>
wrote:
>
>
Well right now SI extends AbstractSystemOfUnits because it IS a
>
SystemOfUnit and therefore naturally implements it.
>
Hence it is part of the RI.
>
>
Other implementations may use say a NoSQL db, etc. So keeping the abstract
>
base class in implementations is reasonable, but pulling just one
>
implementing class out of that hierarchy sounds comtradicting.
>
IMHO if SI went into API (so we find a way to solve all the RI
>
dependencies in it;-) so should AbstractSystemOfUnits. It does not force
>
every implementor to use it. See AbstractMap, etc. in the JDK it's just a
>
common default option.
>
>
Werner
>
Am 14.12.2014 04:29 schrieb "Martin Desruisseaux" <
>
>:
>
>
Le 14/12/14 01:37, Werner Keil a écrit :
>
> > Exposing SI in the API was a tempting thought, but a significant
>
> > mix-up between API and RI in JSR 275 did us no good as you remember;-)
>
>
>
> One problem with JSR-275, in my opinion, was that it exposed too much
>
> implementation details. But SI constants for units defined by BIPM is
>
> not an implementation details.
>
>
>
>
>
> > We discussed moving abstract base classes, especially
>
> > AbstractSystemOfUnits into the API (...snip...),
>
> > see https://java.net/jira/browse/UNITSOFMEASUREMENT-42
>
>
>
> I agree with the comments posted in the JIRA task: AbstractSystemOfUnits
>
> should stay on the implementation side. There is no guarantees that an
>
> other implementation would not use an other abstract base class. But
>
> this is unrelated to the SI discussion - there is no need for those
>
> classes for providing SI constants.
>
>
>
>
>
> > If we wanted to provide any implementation class as "default" in the
>
> > API, we would have to reopen this ticket first.
>
>
>
> Not necessarily - using ServiceLoader in the static class initializer, a
>
> SI class would not need to know the actual implementation classes.
>
>
>
>
>
> Martin
>
>
>
>