Guideline: J2EE Application
This guideline discusses the J2EE Application, the largest independent unit of deployment in a J2EE system.
Relationships
Related Elements
Main Description

Introduction

A J2EE Application is the largest independent unit of deployment in a J2EE system. For general information on J2EE Applications, see Concept: Java 2 Platform Enterprise Edition (J2EE) Overview.

For information on assembling J2EE Applications, see Guideline: Assembling J2EE Applications.

For information on deploying J2EE Applications, see Guideline: Deploying J2EE Modules and Applications.

Modeling J2EE Applications

J2EE Applications are represented in the Implementation Model as UML artifacts with a <<EAR>> stereotype.

The composition of J2EE Module archives into a J2EE Application archive can be shown graphically by drawing an <<EJBModule>> dependency from contained EJB-JARs to the EAR, and by drawing a <<WebModule>> dependency from the contained WARs to the EAR.

Diagram described in accompanying text.

The mapping of a J2EE Application to a specific node (i.e., application server) can be shown graphically be drawing a <<deploy>> dependency from the EAR to the application server node, as shown in the following diagram.

Diagram described in accompanying text.

In addition to modeling what module archives are packaged in the application archive, you can also model properties, which are ultimately documented in the module and application archives' deployment descriptors.

An example of how to model some of these properties is provided below.

Diagram described in accompanying text.

The above diagram shows the assembly of an EJB and a Web archive into an EAR. Notice the modeling of the the security roles, which are used by the application to determine which types of users can access parts of the system, down to the method level of granularity.

J2EE Application Deployment Descriptors

A J2EE Application contains a J2EE application deployment descriptor with a file name of "application.xml". The application deployment descriptor must be placed in the META-INF/ subdirectory.

The application deployment descriptor lists the modules that are packaged in the application, as well as instructions for customizing the application.

The contents of the application deployment descriptor are set when the J2EE Application is assembled. For more information on assembling J2EE Applications, see Guideline: Assembling J2EE Applications.

For general information on deployment descriptors, see Concept: Java 2 Platform Enterprise Edition (J2EE) Overview.