From the Spring Framework Reference Documentation: "This approach is
powerful and flexible in that you can choose the scope of the objects you create
through configuration instead of having to bake in the scope of an object at the Java
class level."
This essentially means, that you can not rely on the scope of an object, because the scope can be changed via configuration.
Further more: Change the scope in the config and likely break the application.
Scope errors are often only discovered after a relatively long time and are hard to find.
Keine Kommentare:
Kommentar veröffentlichen