Skip to main content

[jsr363-experts] Re: PI

  • From: Werner Keil < >
  • To: " " < >
  • Subject: [jsr363-experts] Re: PI
  • Date: Sun, 14 Dec 2014 13:28:48 +0100

We could try that for a further stage. If it worked, then at least each
SystemOfUnits implementation would have a redundant overhead of maintaining
the collection by itself (that is mainly what Abstract* made reusable to
get rid of some boilerplate code all unit systems otherwise shared;-) or it
might eve question the whole concept of a SystemOfUnits interface
alltogether?;-)

As of now the code is doing all based on static definitions, especially the
calculations, etc. one would have to change it drastically, somewhat along
the lines of what JSR 354 did.
Especially because Java ME has the ServiceLoader concept as optional this
could only be part of an optional package like SPI or another one, not sit
in the mandatory root level, since it won't work on many devices and also
create quite some overhead. If introducing that to SPI or (since it uses
the SPI) somewhere else, we could think about it.

Ideally someone should try that in a branch while we head for PD.

Werner

On Sun, Dec 14, 2014 at 12:43 PM, Martin Desruisseaux <
>
 wrote:
>
>  Le 14/12/14 19:59, Werner Keil a écrit :
>
> 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.
>
> But nobody is proposing that...
>
>
>  IMHO if SI went into API (so we find a way to solve all the RI
> dependencies in it;-) so should AbstractSystemOfUnits.
>
> No, they would be no dependency and no need for AbstractSystemUnit. Just
> use ServiceLoader and current Unit public API, nothing else. No need for
> direct dependency to anything from the RI. Example:
>
>  public final class SI {
>     public static final Unit<Length> METRE;
>     public static final Unit<Time> SECOND;
>
>     static {
>         SystemOfUnits sys = null;
>         for (SystemOfUnitsProvider p : 
> ServiceLoader.load(SystemOfUnitsProvider.class)) {
>             sys = p.getSystemOfUnits();
>             // TODO: what to do if we find more than one provider on the 
> classpath?
>         }
>         // TODO: what to do if we find no provider on the classpath?
>         METRE = sys.getUnit(Length.class);
>         SECOND = sys.getUnit(Time.class);
>         // etc.
>     }
> }
>
>
>     Martin
>
>


[jsr363-experts] Should JSR-363 API provide the SI class?

Martin Desruisseaux 12/13/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/13/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Martin Desruisseaux 12/13/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/13/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/13/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Martin Desruisseaux 12/14/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/14/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Martin Desruisseaux 12/14/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/14/2014

[jsr363-experts] PI

Martin Desruisseaux 12/14/2014

[jsr363-experts] Re: PI

Werner Keil 12/14/2014

[jsr363-experts] Re: PI

Martin Desruisseaux 12/14/2014

[jsr363-experts] Re: PI

Werner Keil 12/14/2014

[jsr363-experts] Re: PI

Werner Keil 12/17/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Leonardo Lima 12/16/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Martin Desruisseaux 12/16/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Leonardo Lima 12/16/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Martin Desruisseaux 12/16/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/16/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Leonardo Lima 12/16/2014

[jsr363-experts] Re: Should JSR-363 API provide the SI class?

Werner Keil 12/16/2014
 
 
Close
loading
Please Confirm
Close