JSF v. Struts
There's been a "what advantages does JSF have over Struts" thread on the MyFaces list in the last couple of days so I thought I'd put together a summary.
- Fewer and less verbose config files
- Automatic type conversion of bean elements (not forced to use String)
- Bi-directional conversion between browser info and bean info, not just decoding
- Validation and conversion are more robust, re-usable and extensible
- Large and rapidly growing set of UI components – richer and more reliable UI
- UI components are more reusable
- Using standard (JEE) components maximises ability to hire developers who will understand them and is thus a safer choice (in the long run, presumably)
- Better tools are available
- Allows RAD (by building view first)
- Lifecycle events are standardised and extensible
- Eliminates all logic in JSPs
- Dependency injection is considered best practice these days
- JSF's bean injection virtually eliminates the need to directly access the Session and Request objects, reducing coupling and increasing reliability
- Rendering is decoupled from the view, so can use JSF for rendering to mobile devices
- Cleaner MVC model – is an ActionForm part of the controller (action) or view (form)?
- More flexible navigation because navigation rules are decoupled from actions
- Less coupling to the framework in general
The last point was only touched on briefly somewhere, but for me it's one of the key points. My view (since JSF 1.0 came out) is that the JSF framework is cleaner and does more of the dirty work for you, but the lack of coupling means more of your application to be written as POJOs – the same advantage as technologies like JDO and Spring.