Hi Luciano,

thanks for the pointer, but I already knew that background.

My question is: why not make every service composite scope? (With the
arguments in favor of that approach given in my original post.)
Perhaps I misunderstood something?

-- Sebastian

-----Original Message-----
From: Luciano Resende [mailto:[email protected]] 
Sent: Wednesday, December 08, 2010 6:31 PM
To: [email protected]
Subject: Re: Elementary question about Scopes

On Wed, Dec 8, 2010 at 12:27 AM, Millies, Sebastian
<[email protected]> wrote:
> I've noticed that I have been making some of my services COMPOSITE scope,
> others not, without apparent reason. My question regards the difference
> between composite and default (request) scope, disregarding conversations.
>
> As I see it, either a service implementation maintains state or it does not.
> If it does, it must be made composite scope, so as not to lose the state 
> between
> requests, and one must take care of shared access (thread issues) in one's
> programming.
>
> If it does not, it wouldn't matter if it were composite scope, as there would
> be no shared state to care about how to access anyway. So it could as well be 
> made
> composite.
>
> A service being composite scope earns the additional benefit of the init()
> method, which can be costly, only being executed once.
>
> So I would decide to make all my services composite scope by default.
>
> Would that be wrong? In other words, is there any particular advantage 
> associated
> with default scope services? Any specific runtime properties in Tuscany 1.6 
> perhaps?
>
> -- Sebastian
>

In the 1.x context, here is a good explanation from Mike:

http://tuscany.markmail.org/thread/ubfs2ohn67vv5nw2

In 2.x, the SCA Specs reduced to only support COMPOSITE and STATELESS (default)

-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Reply via email to