Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Sun Java Center - J2EE Patterns

 
 

Patterns

We have used UML extensively in the pattern catalog, particularly as follows:

  • Class diagrams: We use the class diagrams to show the structure of the pattern solution and the structure of the implementation strategies. This provides the static view of the solution.
  • Sequence (or Interaction) diagrams: We use these diagrams to show the interactions between different participants in a solution or a strategy. This provides the dynamic view of the solution.
  • Stereotypes: We use stereotypes to indicate different types of objects and roles in the class and interaction diagrams. The list of stereotypes and their meanings is included below.

Each pattern in the pattern catalog includes a class diagram that shows the structure of the solution and a sequence diagram that shows the interactions for the pattern. In addition, patterns with multiple strategies use class and sequence diagrams to explain each strategy.

To learn more about UML, please see the references[3].

UML Stereotypes

While reading the patterns and their diagrams, you will encounter certain stereotypes. Stereotypes are terms coined or used by designers or architects. We created and used these stereotypes so as to present the diagrams in a concise and easy to understand manner. Note that some of the stereotypes relate to the terminology explained in the previous section.

Stereotype Meaning
EJB Represents an enterprise bean component; associated with a business object. This is a role that is usually fulfilled by a session or entity bean.
SessionEJB Represents a session bean as a whole without specifying the session bean remote interface, home interface, and the bean implementation.
EntityEJB Represents an entity bean as a whole without specifying the entity bean remote interface, home interface, the bean implementation and the primary key.
View A View represents and displays information to the client.
JSP Represents a Java Server Page; a View can be implemented as a JSP.
Servlet Represents a Java servlet; a View can be implemented as a servlet.
Singleton An object that has a single unique instance adhering to the Singleton pattern.
Custom Tag JSP Custom Tags are used to implement Helper objects., as are JavaBeans. A Helper is responsible for such activities as gathering data required by the View and for adapting (see GoF Adaptor pattern[4]) this data model for use by the View. Helpers can service requests for data from the View by simply providing access to the raw data or by formatting the data as web content.