JavaServer Faces (NFJS)

Posted on November 11, 2004 by Scott Leberknight

The last two sessions last Friday at NFJS were spent listening to David Geary explain the wonderous nature of JavaServer Faces (JSF). He started by giving a brief history of Java on the server-side focusing mainly on Servlets, JSP, and Struts. David is a member of the JSF expert committee, and so obviously likes JSF. I, on the other hand, do not like it at all.

According to Geary, JSF is both a "better Struts" and as "the standard web application framework". I think neither is true. First, in many ways JSF is similar to Struts. That's not surprising since Craig McClanahan, Struts' creator, and David Geary, the 2nd Struts committer, both helped to define JSF. That doesn't mean it's better though. Second, how is JSF "the" standard web application framework? Perhaps in Sun's distorted view it is, but I doubt it is to WebWork or Tapestry users, or how about .NET users? For example, though EJB is a standard, how many people have been running away from it at full speed towards lighter-weight frameworks like Spring and HiveMind?

JSF was designed by a committee, and it looks like it. JSF tries to satisfy a ton of requirements. It tries to define a flexible and extensible model for creating UI components. It tries to separate GUI rendering from the actual GUI components, to allow a component to be rendered into different view technologies. It has an event model, a validation framework, a navigation framework, and supports i18n. It doesn't seem to do any of these things particularly well, however, and seems overly abstract and convoluted right now. Perhaps it'll get better in the future but I'm not interested right now.

One thing about JSF that really irks me is the lack of useful GUI components, such as a DatePicker component or a powerful Table component that supports sorting, pagination, etc similar to DisplayTag. According to Geary, the JSF committee was a year and a half behind schedule because of infighting between Apache and Sun over the future of Struts versus JSF. After they resolved their differences they actually began doing something but then were pressured to "get something out". Due to this their strategy was to provide a flexible and extensible component model from which you can build complex component types. While it's nice to have that flexibility, I think it is absurd that they simply left out some of the most useful and needed components. I'd have gladly waited another year for them to put JSF out if they had included useful GUI components out of the box.

Another thing that is annoying is that JSF was designed with tools in mind, and in fact was designed (more or less) for vendors to create point-and-click GUIs such as Sun Studio Creator. Designing a framework specifically to permit tooling is not necessarily a bad thing, but I think a framework should be not painful to use without tools. JSF development without tools seems painful to me. Sun's position, as stated at JavaOne and by Geary at NFJS, is to use JSF and the supporting tools as a way to lure millions of Microsoft VB developers to Java development. Is that really a good thing?



Post a Comment:
Comments are closed for this entry.