Enterprise JavaBeans™ (EJB) enterprise beans and elements are represented in Unified Modeling Language (UML) class diagram views based on the specification for mapping between the EJB architecture and UML.
The specification is defined by the UML/EJB Mapping Specification request JSR -000026 (also known as JSR-26). JSR-26 defines this standard mapping specification for representing Java™ and EJB technology-based components using UML. Released and updated through the Java Community Process Program, JSR-26 provides the developer community with a key link between these two technologies.
In UML class diagrams, UML notation is used to represent enterprise beans, the fields and methods that comprise an enterprise bean, and the relationships between enterprise beans following JSR-26.
UML class diagrams can also reflect Java classes and interfaces. By default, fields map to attributes and methods map to operations. Depending on the nature of the relationship, it can be useful to represent Java fields as an association to a Java class.
A stereotype is an extension mechanism that broadens the vocabulary of UML and gives more specific meaning to a Java class, a Java interface, or an enterprise bean.
The following table illustrates how enterprise beans and EJB elements map to UML elements and stereotypes with icons in UML class diagrams.
EJB element | UML element | Stereotype | Icon |
---|---|---|---|
EJB JAR file | Artifact | <<EJB Jar>> | ![]() |
Container-managed persistence (CMP) 1.x entity bean | Component | <<Entity Bean>> | ![]() |
CMP 2.x entity bean | Component | <<Entity Bean>> | ![]() |
Bean-managed persistence (BMP) entity bean | Component | <<Entity Bean>> | ![]() |
Message-driven bean | Component | <<Message Driven Bean>> | ![]() |
Session bean | Component | <<Session Bean>> | ![]() |
Session bean facade | Component | <<Session Bean>> | ![]() |
Bean class | Class | <<Bean Class>> | ![]() |
Remote interface | Class | <<Remote Interface>> | ![]() |
Local interface | Class | <<Local Interface>> | ![]() |
Home interface | Class | <<Home Interface>> | ![]() |
Local home interface | Class | <<Local Home Interface>> | ![]() |
Method permission | Class | <<Method Permission>> | ![]() |
Exclude list | Class | <<Exclude List>> | ![]() |
Primary key class | Class | <<EJB Primary Key Class>> | ![]() |
Primary key field | Attribute | <<EJB Primary Key Field>> | ![]() |
CMP field | Attribute | <<CMP Field>> | ![]() |
Local method | Operation | <<Local>> | ![]() |
Remote method | Operation | <<Remote>> | ![]() |
Local home method | Operation | <<Local Home>> | ![]() |
Home method | Operation | <<Home>> | ![]() |
Method element | Operation | <<Method Element>> | ![]() |
Security role name | Actor | <<Role Name>> | ![]() |
Security role name reference | Actor | <<Role Name Reference>> | ![]() |
WebSphere® Application Server (WAS) extension for EJB inheritance relationship | Inheritance | <<WAS Inheritance>> | None |
CMP relationship | Association | <<Relationship>> | None |
Relationship between an enterprise bean and its home, remote (local-home, local) interfaces | Implementation | <<EJB Implementation>> | None |
Relationship between an EJB JAR file and its contained entity beans | Manifestation | <<Manifestation>> | None |
Relationship between an enterprise bean and its bean classes | Realization | <<EJB realization>> | None |
Remote reference between enterprise beans | Usage | <<Reference>> | None |
Local reference between enterprise beans | Usage | <<Local Reference>> | None |
Facade relationship between CMP and session facade beans | Usage | <<Facade>> | None |
Mapping between enterprise beans and database objects | Usage | <<Map>> | None |
Security role relationship | Usage | <<Security Role>> | None |
Security role reference relationship | Usage | <<Security Role Reference>> | None |