
Originally Posted by
titiwangsa
In a web based spring application, we can set the scopes for the beans.
Normally a session scope or a request scope. Not setting the scope means that the beans are application scoped.
Right?
Ok.
Moving on.
When we have business logic inside our codes, what is the scope that we should put our bean?
Is session scope ok?
Or is request scope better or is application scope better?
Why?
I think we should put it in session scope because if there are a lot of people using the logic, then each person can have their own bean.
If we put it in the request scope, then we have to re-create the bean over and over again.
Is this correct?