JBoss Seam / JSF / Rich Faces


JBoss Seam is an application framework for Enterprise Java. We view Seam as the missing framework that should have been included in Enterprise Java. It sits on top of Java EE frameworks to provide a consistent and easy-to-understand programming model for all components in an enterprise web application. It also makes stateful applications and business process-driven applications a breeze to develop.

In another words, Seam is all about developer productivity and application scalability. Seam integrates JPA and Hibernate3 for persistence, the EJB Timer Service and Quartz for lightweight asynchronicity,  jBPM for workflow, JBoss Rules for business rules, Meldware Mail for email, Hibernate Search and Lucene for full text search, JMS for messaging and JBoss Cache for page fragment caching. Seam layers an innovative rule-based security framework over JAAS and JBoss Rules. There’s even JSF tag libraries for rendering PDF, outgoing email, charts and wikitext.

Seam components may be called synchronously as a Web Service, asynchronously from client-side JavaScript or Google Web Toolkit or, of course, directly from JSF. Seam works in any Java EE application server, and even works in Tomcat. If your environment supports EJB 3.0, great! If it doesn’t, no problem, you can use Seam’s built-in transaction management with JPA or Hibernate3 for persistence. Or, you can deploy JBoss Embedded in Tomcat, and get full support for EJB 3.0.

Seam is inspired by the following principles:

  • One kind of “stuff”
  •   Seam defines a uniform component model for all business logic in your application.
  •  A Seam component may be stateful, with the state associated with any one of several well-defined contexts, including the long-running, persistent, business process context and the conversation context, which is preserved across multiple web requests in a user interaction.
  •  Integrate JSF with EJB 3.0
  • JSF and EJB 3.0 are two of the best new features of Java EE 5.
  • EJB3 is a brand new component model for server side business and persistence logic.

Meanwhile, JSF is a great component model for the presentation tier. Unfortunately, neither component model is able to solve all problems in computing by itself. Indeed, JSF and EJB3 work best used together. But the Java EE 5 specification provides no standard way to integrate the two component models.Fortunately, the creators of both models foresaw this situation and provided standard extension points to allow extension and integration with other frameworks.

  • Integrated AJAX
  • Seam supports the best open source JSF-based AJAX solutions: JBoss RichFaces and ICEfaces. These solutions let you add AJAX capability to your user interface without the need to write any JavaScript code.

Alternatively, Seam provides a built-in JavaScript remoting layer that lets you call components asynchronously from client-side JavaScript without the need for an intermediate action layer. You can even subscribe to server-side JMS topics and receive messages via AJAX push.

  • Business process as a first class construct:  Optionally, Seam provides transparent business process management via jBPM. You won’t believe how easy it is to implement complex workflows, collaboration and task management using jBPM and Seam. Seam even allows you to define presentation tier pageflow using the same language (jPDL) that jBPM uses for business process definition.
  •  Declarative state management: Declarative application state management is made possible by the richness of the context model defined by Seam. Seam extends the context model define d by the servlet spec — request, session, application — with two new contexts — conversation and business process — that are more meaningful from the point of view of the business logic.
  • Bijection: Bijection differs from IoC in that it is dynamic, contextual, and bidirectional. You can think of it as a mechanism for aliasing contextual variables (names in the various contexts bound to the current thread) to attributes of the component. Bijection allows auto-assembly of stateful components by the container. It even allows a component to safely and easily manipulate the value of a context variable, just by assigning it to an attribute of the component.
  • Workspace management and multi-window browsingSeam applications let the user freely switch between multiple browser tabs, each associated with a different, safely isolated, conversation. Applications may even take advantage of workspace management, allowing the user to switch between conversations (workspaces) in a single browser tab. Seam provides not only correct multi-window operation, but also multi-window-like operation in a single window!
  • Integration testing is easySeam components, being plain Java classes, are by nature unit testable. But for complex applications, unit testing alone is insufficient. Integration testing has traditionally been a messy and difficult task for Java web applications. Therefore, Seam provides for testability of Seam applications as a core feature of the framework. You can easily write JUnit or TestNG tests that reproduce a whole interaction with a user, exercising all components of the system apart from the view (the JSP or Facelets page). You can run these tests directly inside your IDE, where Seam will automatically deploy EJB components using JBoss Embedded.

There’s more to a web application than serving HTML pages. Today’s web frameworks think too small. They let you get user input off a form and into your Java objects.  And then they leave you hanging. A truly complete web application framework should address problems like persistence, concurrency, asynchronicity, state management, security, email, messaging, PDF and chart generation, workflow, wikitext rendering, web services, caching and more. Once you scratch the surface of Seam, you’ll be amazed at how many problems become simpler.

  • JavaServer FacesJavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. It was formalized as a standard through the Java Community Process and is part of the Java Platform, Enterprise Edition. Javaserver Faces is based on a component-driven UI design model, using XML files called view templates or Facelets views. Requests are processed by the FacesServlet, which loads the appropriate view template, builds a component tree, processes events, and renders the response, typically in the HTML language, to the client. The state of UI components and other objects of scope interest, is saved at the end of each request in a process called stateSaving (note: transient true), and restored upon next creation of that view. Objects and states can be saved either on the client or server side.
  • RichFaces (The next-generation JSF component framework by JBoss!)RichFaces is an open source Ajax-enabled component library for JavaServer Faces, hosted by JBoss. It allows easy integration of Ajax capabilities into enterprise application development.  RichFaces is more than just a component library for JavaServer Faces. It adds:
  • Skinability (easily change and update application look and feel)
  • Component Development Kit (CDK) to assist in constructing JavaServer Faces components
  • Dynamic Resource Framework
  • Both page wide, and component based Ajax control components.

Comments are closed.