04 November, 2007

Java Server Faces

Overview:
JavaServer Faces is a holistic solution to several longstanding problems facing software developers and the customers who consume the software. For the end user, JavaServer Faces holds the promise of an easier, more intuitive usage experience for Web-based applications. For software developers, JavaServer Faces provides a standard, object-oriented, easy-to-use application programming interface (API) that takes much of the pain out of bringing a great user experience to the world of Web applications. JavaServer Faces gives users the power, flexibility, and performance that have previously been addressed only in a piecemeal fashion. JavaServer Faces was developed by a community of Web application experts assembled by the Java Community Process. These experts are the people behind Jakarta Struts, Oracle Application Server, Sun Java Studio, IBM WebSphere Studio, ATG, and many other programs in the Web application development space. Their collective wisdom was brought to bear on the problem
of how to take the best patterns from the existing technologies that solve the same problems and combine them into a cohesive whole, as well as filling in the gaps not filled anywhere to date. JavaServer Faces combines the ubiquity of JSP and servlets, the simplicity of JavaBeans, the power of J2EE, and the common-sense chutzpah of frameworks like Jakarta Struts to bring you the best-of-breed way to develop the user interface for a Web application.

Introduction:
JavaServer Faces (JSF) is an exciting new technology that will change the way we build user interfaces for Java 2 Enterprise Edition applications. With the introduction of JSF, we can finally create user interfaces simply with a set of reusable components. And with a component-based framework, Web applications are finally on a more level playing field with client-based User Interface (UI) frameworks such as Swing. Web developers will be able to use and reuse components off the shelf in their applications so we will see tool support and components implemented for JSF.

Why JSF?

  • MVC for web applications
  • Clean separation of roles
  • Easy to use
  • Extensible Component and Rendering architecture
  • Support for client device independence
  • Standard
  • Huge vendor and industry support
  • Offers finer-grained separation of behavior
    and presentation than JSP
  • UI-component and Web-tier concepts
    without limiting a particular scripting
    technology or markup language

Comparing JSF & Struts:

  • Struts (I am not saying you should not use Struts)

    • No built-in UI component model
    • No built-in event model for UI components
    • No built-in state management for UI components
    • No built-in support of multiple renderers (Struts is more or less tied up with HTML)
    • Not a standard (despite its popularity)
  • Struts and JSF can be used together


References
JSF in Action - Kito D. Mann

0 comments: