246 Patterns: Implementing Self-Service in an SOA Environment
Note that a WML rendering kit is not a standard component of Rational
Software Architect at this time. However the JSF framework can clearly
accommodate this and other kits as they become available.
򐂰 JSF is a standard component of the J2EE 1.4 specification, and is rapidly
gaining acceptance in the industry. JSF is now supported by all major IDEs
and Web application servers, including the WebSphere and Rational family of
products.
JSF versus Struts
A fair question at this point, would be to ask why we selected the JSF framework
over Jakarta Struts? See 7.2.6, “Frameworks” on page 153 for more details
about Struts. It is true that there is no overwhelming advantage for JSF at this
time. The primary deciding factor was that JSF has now been adopted as a J2EE
standard. JSF has been embraced rapidly by the IT industry, including all the
major tool vendors. JSF incorporates most of the concepts which made Struts so
popular over the last few years, while making improvements in various areas.
The general consensus at this time, is that if an application is already
implemented in Struts, there is no great need to convert it to JSF. However,
when writing a new application, as we are in this case, JSF is the preferred
option.
Enterprise JavaBeans components
The last layer of our component model is composed of Enterprise JavaBeans
(EJBs), which provide the Model portion of the MVC pattern, as well as the
integration to the back-end services.
The Customer entity bean manages the data for one customer, storing it in a
DB2 table. Following the J2EE session facade pattern, the access to this entity
bean is encapsulated in an EJB session bean. The session facade also provides
access to the back-end services supporting the ITSOMart application.
9.2.3 Object model
This section describes the object model for the ITSOMart front-end, through the
use of various modeling diagrams.
Front-end class diagram
The class diagram in Figure 9-3 on page 247 shows the primary classes in the
ITSOMart front-end. For the sake of readability, we restricted the visibility of the
classes’ components strictly to those operations and data members we wanted
to highlight. Note that given the nature of a JSF front-end, a formal UML class
diagram might not provide the complete picture of the application. That is
because the JSP pages, which are an integral component of the JSF framework,
Chapter 9. JSF front-end scenario 247
are not allowed in standard UML class diagram notation. However we illustrate
the JSP relationships later in freeform diagrams, and Web flow diagrams.
Figure 9-3 ITSOMart front-end class diagram
The following are some of the key classes and relationships depicted in the class
diagram:
򐂰 The top portion of the diagram represents a layer of Java beans that support
the Faces JSP pages. There is a bean assigned to each JSP page, and each
bean is responsible for getting and setting the data in the JSF UI components
of the page. Some beans also support the action methods which trigger the
back-end requests. See 9.3.2, “JSF managed bean design” on page 257, for
an extended discussion about JSF managed beans.
򐂰 The CustomerDO class is the data object used to encapsulate and exchange
the customer information across the application.
PageCodeBase
<<
Java Class
>>
c
EmailValidator
<<
Java Class
>>
JSF Managed
Request Beans
DeleteConfirm
<<
Java Class
>>
SystemError
<<
Java Class
>>
CreateConfirm
<<
Java Class
>>
CustomerNotFound
<<
Java Class
>>
UpdateConfirm
<<
Java Class
>>
CustomerAdmin
<<
Java Class
>>
+ doLoginButtonAction ( )
CreateCustomer
<<Java Class>>
+ doCreateCustomerAction ( )
UpdateCustomer
<<
Java Class
>>
+ doUpdateCustomerAction ( )
+ doDeleteAction ( )
HomeFactory
<<
Java Class
>>
OrderSystemSessionFacadeLocal
LocalHome
<<
Java Interface
>>
OrderSystemSessionFacadeLocal
<<
Java Interface
>>
+ createCustomer ( )
+ retrieveCustomer ( )
+ updateCustomer ( )
+ deleteCustomer ( )
email : String
Iname : String
fname : String
streetAddress : String
city : String
phone : String
password : String
state : String
zip : String
accountInfo : String
deliveryType : String
CustomerDO
<<
Java Class
>>

Get Patterns: Implementing Self-Service in an SOA Environment now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.