On 8/9/07, shaoguang geng <[EMAIL PROTECTED]> 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