no, it's probably not worth the trouble.

My concern was especially with infrastructure services (e. g. a
ConfigurationReader), which should be available to ordinary Java-Classes.
Such services are typically stateless, and the service methods don't
need arguments that depend on the calling service's component context.

Therefore, it is simple to provide a composite-scoped container component, 
which makes a reference to the infrastructure service available as a static 
Java variable. The container itself exposes no service interface at all, it's 
really just there to be loaded by the Tuscany runtime and make the target 
reference 
globally available. Perhaps this isn't pretty, but it works for me.

-- Sebastian


> -----Original Message-----
> From: Simon Nash [mailto:[email protected]]
> Sent: Wednesday, September 22, 2010 10:56 AM
> To: [email protected]
> Subject: Re: Q: Best practice for making service references available
> in a component?
>
[snip]
>
> Using the approach described above, I can see that it would be possible
> to make this work.  I'm still not convinced that the benefit is worth
> the complexity.
> 
>    Simon
> 
[snip]

Reply via email to