JSF Central - Prisma Builds a Client Support System with MyFaces
JSF Central

 Articles & Books 
In the Trenches
Prisma Builds a Client Support System with MyFaces
by Kito D. Mann
14 Apr 2005 23:00 EDT

In the Trenches is a new series about real world projects that use JavaServer Faces. This installment looks at how Prisma rewrote their customer support application's front end using JSF.

If you've completed a JSF project, or you're substantially into a new project, we'd love to hear from you! Send an e-mail to trenches@jsfcentral.com describing your experiences -- the good and the bad -- and we may include your story in a future In the Trenches article.

When Prisma, an Austrian credit insurance company, wanted to replace the Java applet running their on-line customer service system, they chose Java consulting firm Irian to build a new application using JavaServer Faces (JSF). The two principals of Irian, Martin Marinschek and Thomas Spiegl, know JSF well - both are members of the development team of the Apache MyFaces open source JSF implementation.

Spiegl is one of the co-founders of MyFaces, which he began developing with Manfred Geiler in 2003 on SourceForge. This came about because Spiegl and Geiler were interested in developing web applications with a Java Community Process-sanctioned standard web framework, but were unhappy with the level of maturity of the reference implementation at that time. Since then, MyFaces has grown in popularity and has recently joined the Apache Software Foundation.

The team has several years of experience in building web applications, beginning with C++. Like many developers, they once had their own home-grown web application framework. "We are sure that JSF saved us loads of time in comparison with just programming JSPs and servlets. Additionally, we are sure that maintenance is much easier with this standardized framework and the open-sourced components," comments Marinschek.

During approximately five months of part-time work on the project, Marinschek and Spiegl, as well as one developer at Prisma, built Prisma.Net. Prisma.Net serves as a hub for about 2,000 clients, managing their accounts and allowing them to track payments and claims, examine contractual terms, and perform other account management duties (see figure 1).

  Figure 1. Prisma.Net uses JSF components to provide an intuitive, powerful user interface.
Figure 1. Prisma.Net uses JSF components to provide an intuitive, powerful user interface.

In addition to standard JSF components, the team also used several custom MyFaces components, such as the DataScroller and Navigation components. They also developed several of their own custom components, including a Popup component and a menu component based on the popular JSCookMenu JavaScript library. Their custom components, in addition to enhanced error reporting for the standard UIData component, have made their way into the MyFaces code base of version 1.09, which was released on April 11th, 2005.

In addition to the MyFaces JSF runtime and custom components, Irian used other Apache projects including POI for manipulating Microsoft Excel files, and the Commons libraries for additional plumbing.

Marinschek and Spiegl developed the application using Windows 2000 with JetBrains IntelliJ and Apache Ant. The deployment platform includes RedHat Linux Enterprise Server 3, JBoss, and Tomcat.

Under the Hood

The back-end of Prisma.Net uses stateless session beans developed in-house by Prisma. The session beans communicate with the company's AS400 system, which houses the core business logic and database. The web front-end communicates with the session bean through a business delegate that is also responsible for creating transfer objects.

The view layer was developed by Irian using JSPs with JSF tag libraries, but do not contain any logic or JSTL tags. Page composition was achieved with Tiles, using MyFaces' built-in Tiles support.

Each JSF view is represented by a model class, which references a composite entity containing the business data necessary for displaying the view. The model retrieves this data through the business delegate, and also manages additional information necessary for rendering the view.

Each view also has a controller that is responsible for storing or deleting the data. Unlike the model classes, controller classes directly access JSF APIs. Irian separated the model and controller as much as possible, especially for code that might be reused in another context, such as a Swing application.

To enable this separation, the team developed a GUIContext class, which is used as a wrapper around the standard FacesContext class. There is also a GUIContextFactory class, which is responsible for creating and caching the GUIContext for each request.

The GUIContext also maintains a reference to a SessionData instance, which contains information such as the user's name, which is displayed on every page. SessionData state can be stored either on the client or on the server. When an instance of the object is stored on the client, Prisma.Net takes advantage of MyFaces' SaveState component (see figure 2 for a class diagram of the system).

  Figure 2. Prisma.Net class diagram.
Figure 2. Prisma.Net class diagram.

A Successful Facelift

"So far, the user feedback has been very good, and the usability has been improved in comparison to the [usability] of the applet that existed before," comments Spiegl. Irian is currently putting the final touches on Prisma.Net, and intends to use JSF as the foundation for future projects.

RSS feed(all feeds)

The Editor's Desk
Inside Facelets
In the Trenches

Site version 1.83  Report web site problems

Copyright (C) 2003-2015 Virtua, Inc. All Rights Reserved. Java, JavaServer Faces, and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. in the United States and other countries. Virtua, Inc. is independent of Oracle Corporation. All other trademarks are the sole property of their respective owners.