0
enter code here

In JSR-346 (contexts and dependency injection), there is a concept of a pseudo scope.
A pseudo-scope is annotated @Dependent and have a dedicated instance of a dependency for the object that needs the dependency.
(I generalized it, hope it is correct)
In the case of normal scope, if several beans need the same dependency, they all can refer to a single instance of the dependency within the scope.
It is mentioned as well, that the singleton scope is kind of pseudo scope...
//it has only one instance, so what is the point... don't get it

Anyway, what is the counterpart of a pseudo-scope in spring?
I guess, that if two beans need a dependency ant it is resolved to a particular bean instance at run-time, both the beans needing the dependency will get a reference to this one instance
(if they are in the same thread)

emosms
  • 1
  • 1
  • The prototype scope will do that: each bean will have its own instance of the prototype bean. – JB Nizet Apr 12 '15 at 09:48
  • I am doing a specifications study for a report :), have no experience with Spring So, a session scope in Spring then shares one instance for all beans that need it? – emosms Apr 12 '15 at 09:56

0 Answers0