You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by shaoguang geng <ge...@yahoo.com> on 2007/08/09 05:18:50 UTC

1 more new component instance per request?

Today, I found in respond to each request, Tuscany instantiate new one class for each. I tried binding.ws, it works as well.

SCA1.0 does not specify instance management of a component, but I remember J2EE does not mentioned such things for EJB and servlet, it should be managed by the containers.

So here comes my question: is it a good idea to make a great deal of component instances in Tuscany, or we might control it to act as singleton?



       
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. 

Re: 1 more new component instance per request?

Posted by shaoguang geng <ge...@yahoo.com>.
Great help, thank you very much. You realy make me a litte uneasy: I need to give more time to spec analyzation.


Simon Laws <si...@googlemail.com> wrote: On 8/9/07, shaoguang geng  wrote:
>
> Today, I found in respond to each request, Tuscany instantiate new one
> class for each. I tried binding.ws, it works as well.
>
> SCA1.0 does not specify instance management of a component, but I remember
> J2EE does not mentioned such things for EJB and servlet, it should be
> managed by the containers.
>
> So here comes my question: is it a good idea to make a great deal of
> component instances in Tuscany, or we might control it to act as singleton?
>
>
>
>
> ---------------------------------
> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's
> on, when.

Hi Shaoguang

SCA defines a concept of scope for a component, for example, if you take a
look at the Java Annotations and APIs spec you will see an annotation @SCOPE
defined which takes the values,

STATELESS
REQUEST
CONVERSATION
COMPOSITE

This gives you some fairly coarse grained control over how the runtime will
manage instances of Java components. For example, if you mark your Java
implementation as having @SCOPE(COMPOSITE) you should see that only one
instance is created within the composite.

Hope that helps

Simon


       
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 

Re: 1 more new component instance per request?

Posted by Simon Laws <si...@googlemail.com>.
On 8/9/07, shaoguang geng <ge...@yahoo.com> wrote:
>
> Today, I found in respond to each request, Tuscany instantiate new one
> class for each. I tried binding.ws, it works as well.
>
> SCA1.0 does not specify instance management of a component, but I remember
> J2EE does not mentioned such things for EJB and servlet, it should be
> managed by the containers.
>
> So here comes my question: is it a good idea to make a great deal of
> component instances in Tuscany, or we might control it to act as singleton?
>
>
>
>
> ---------------------------------
> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's
> on, when.

Hi Shaoguang

SCA defines a concept of scope for a component, for example, if you take a
look at the Java Annotations and APIs spec you will see an annotation @SCOPE
defined which takes the values,

STATELESS
REQUEST
CONVERSATION
COMPOSITE

This gives you some fairly coarse grained control over how the runtime will
manage instances of Java components. For example, if you mark your Java
implementation as having @SCOPE(COMPOSITE) you should see that only one
instance is created within the composite.

Hope that helps

Simon