Re: [osgi-dev] Prototype scope components and Fluent builder

2019-01-30 Thread Tim Ward via osgi-dev
I’m not quite sure what this question means, but the most obvious 
interpretation is “how should I deal with registering a service that is a 
fluent builder?”. 

The JAX-RS Whiteboard does this with the ClientBuilder service 
. 
And the way in which it works is highly related to the rules of the builder. In 
the case of the ClientBuilder the builder returns this not a copy, therefore it 
is not possible for multiple components to share a single builder service. 
Therefore the builder must be registered and used as a prototype scope service.

If (and only if) your builder creates copies of itself each time a method on it 
is called then it is safe to use it as a singleton or bundle scoped service. 
This situation is comparatively rare.

I hope this helps.

Tim

> On 29 Jan 2019, at 16:39, Alain Picard via osgi-dev  
> wrote:
> 
> I am curious if there is a prescribed or suggested approach to use fluent 
> builder in conjunction with Fluent builders?
> 
> Cheers,
> Alain
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] Prototype scope components and Fluent builder

2019-01-29 Thread Alain Picard via osgi-dev
I am curious if there is a prescribed or suggested approach to use fluent
builder in conjunction with Fluent builders?

Cheers,
Alain
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev