I have a question that is more design and architecture related. I am coming from a classical MVC based background and have to get my hands dirty on JSF2. I read the IBM articles on JSF2 (http://www.ibm.com/developerworks/library/j-jsf1/) and think I understand the overall concept.
I started to get in touch with JSF2 through ROO. I have the feeling that ROO (maybe this is true for any JSF2-Type App, or maybe not) is making very strange/unclear use of beans. It is in general really not clear to me what the actual role of a Bean is! For example, if I have a view with a form that is for editing a single user-entry, i would initialize the user in a, lets call it UserBean (maybe store it in a member variable) and access this variable trough getters. If i now want to overview all users, I would again render the view in in the UserBean hold a collection of users and again access this collection through getters. The previous description is actually the way i would do things with jsf. This means I would user the UserBean more as a stateful-service as a controller.
In a typical controller situation i would create for every type of action (list user, edit user, view user, etc) a separate controller, with specific initialized data and this way i would separate the context of the logic by controllers.
I often use context-specific services, e.g., if I handle user's often an spread over the application, I create a user-service that handles user-specific logic that is maybe too complex to be put into itself. If I now for example look into roo generated Beans, I would find methods that programmatically render forms, input fields, and labels, that again store list's of users, Boolean fields that indicate if data had already been loaded, single user members and a lot of methods that more look like to be put into a UserService (or whatever). I am wondering if this is the way JSF2 is intended to be used, in words: pushing everything that is related to one context into on bean, not making use of service, and writing "super-controller-beans" that handle everything.
I don't really know if you get the question right, but what would maybe help me is, a hint to
Thank you so much!
Please feel free the push me to concretize specific points if I am not clear!
The link for JSF2 you have posted points to JSF1.2 article. In case you want to start of with JSF2 or JSF I suggest following links.
I'll suggest start with plain vanilla JSF rather than ROO with JSF to get a hang of JSF.
To answer your question
Hope this helps.