> Hello all, > Sorry for bothering this Struts list for my question which > Is little off-topic, but I am trying to learn JSF (and move my existing > struts-based applications to JSF), and by reading various materials, I > found at least > 2 different approaches for developing JSF-based apps > > One approach, where we have a Model (made of managed/backed beans) where > > The bean itself contains both properties (getters and setters) as well > as > The 'actions' to perform (such as edit/delete/create etc) > > A Second approach, where we have a Model (JB) and a separate > 'Controller' > Class that has the edit/create/ etc actions (a-la Action & ActionForm) > > > Now, having used struts for more than 2 years, the second approach would > be > My immediate choice, but I have 'heard' about the first approach being > A 'Domani model' approach, where the same class has both properties > And (part of) business logic ... and this approach being 'better'.. > > > So, I guess I am not the first one who moves from struts to JSF, and I > was > Wondering what you guys have done... > > Can anyone give me any feedback? >
Im not sure if you have check out Struts Shale, a subproject that is built on JSF. http://struts.apache.org/shale/index.html One of the key features is this notion of a view controller that adds additional life cycle hooks in a specialized managed bean. The view controller assumes a relationship to a JSF view id. Shale fires these life cycle events without method bindings in your page. I expect that's why it's called a view controller verses a view model. http://struts.apache.org/shale/features.html#view This pattern promotes the ViewController as the handler of action event callbacks. From the view controller you have access to other managed beans so there is not a limitation. I like the separation we see in struts between the data and data handler. You can easily do this by mapping your value binding expressions to an aggregated object on the view controller that is created as a managed bean (kind of like using multiple form beans from a struts action). Gary > > Thanx in advance and regards > marco > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]