Skip to main content

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

  • From: Werner Keil < >
  • To: " " < >
  • Subject: Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory
  • Date: Fri, 31 Oct 2014 12:05:18 +0100

OK, so you are fine with Quantities returning a Quantity instance (as
opposed to a factory in 354, we don't have to replicate another JSR if we
think it's easier to get the Quantity directly[?]) aka Option 1?

If such convenience class like Quantities was to call
java.util.ServiceLoader, OSGi or something else is an implementation
detail, we can think about that later.
If QuantityFactory is mainly to be used by Services, I would conclude it's
better to place it in "spi" than "function".
"javax.measure.function" is a slightly improved form of the old
"javax.measure.converter" package or "javax.money.convert" with a similar
purpose. It allows to hold conversion related elements which are almost
entirely "functional Interfaces in the sense of Java 8" (a single method)
with a few others. QuantityFactory "producing" something sounded like a
good match, but IMHO it would better fit into "spi" now. That leaves it
entirely up to implementors, if they call it via OSGi, Java Service Loader
or not at all. Especially in ME on devices that don't support the optional
Service Loader mechanism it saves having to implement it in such profiles.

Thanks,
Werner

On Fri, Oct 31, 2014 at 11:39 AM, Martin Desruisseaux <
>
 wrote:

> Le 31/10/14 18:42, Werner Keil a écrit :
> > @Martin, do you have an opinion or preference for the Quantities class?
> > As of now, we have exactly 2 votes, one for each Option.
>
> I think that Quanties should returns Quantity objects, eventually using
> QuantityFactory under the hood (but we may not need to expose that fact
> publicly).
>
> I understand the value of giving access to QuantityFactory, but I think
> that giving to the user an instance of QuantityFactory is
> java.util.ServiceLoader or OSGi's job rather than Quantities job.
>
> Actually I see QuantityFactory as the interface doing the real job, and
> Quantities as nothing more than a set of convenience methods for those
> who don't want to bother querying ServiceLoader or OSGi for a
> QuantityFactory themselves. I think that Quanties should not provide any
> functionality that QuantityFactory can not do. Quantities should only
> make common tasks easier, by hiding QuantityFactory to the users who
> don't need to bother about it.
>
>     Martin
>
>

Attachment: 347.gif
Description: GIF image



Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

(continued)

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/30/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/30/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/30/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Otávio Gonçalves de Santana 10/30/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Otávio Gonçalves de Santana 10/30/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Otávio Gonçalves de Santana 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Jean-Marie Dautelle 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Jean-Marie Dautelle 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Jean-Marie Dautelle 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Martin Desruisseaux 10/31/2014

Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory

Werner Keil 10/31/2014
 
 
Close
loading
Please Confirm
Close