I am curious about the best way to decide what scope a backing bean should exist in.
When I first started with
JSF, I just put all my beans into session scope. Then I could easily access them all the time -- even on ajax calls -- and their data would persist across requests.
However, I have seen many people suggest that storing beans in session scope should not be done lightly due to performance issues, etc.
My question is: when should I use request scope, and when should I use session scope?
Right now, my solution is to have a single backing bean in session scope which just holds data I want to persist across requests, such as EJBs. Then I have my JSF pages only directly reference request scope beans, which provide delegate methods to the session scoped
EJB fields.
Does this sound like a good solution, or are there better
patterns out there?
Thanks in advance
~Zack