Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

EJB UML Mapping

For more than a decade, development and use of object technology has been increasing. Database administrators, who controlled the mainframe and client/server development fields, have been increasingly forced to share authority as developers are moving quickly to adopt object-oriented (OO) languages such as C++ and Java. Recently, object and data professionals have been required to cooperate, especially when it comes to technology such as Enterprise JavaBeans (EJB) that are written in Java but are typically stored in relational databases such as Oracle or IBM's DB2, which use non-object technology.

Relational DBMSes have a well-known flaw: the application programmer is forced to work in languages such as Java or C++ that have a syntax, semantics, and type system different from the data manipulation language (that is, SQL) of the DBMS. Many developers overcome this by using object-relational mapping.

The UML specification provides a specialized use of UML known as a profile. In addition, the Java Community Process is involved in the creation of an EJB UML-mapping profile. The JSR-000026 UML profile for EJB, which can be found at http://jcp.org/jsr/detail/26.jsp, defines a set of UML extensions for use when modeling software implemented with Enterprise JavaBeans in UML. These extensions allow the Java IDE, application server, and other enterprise tool vendors to provide EJB modeling capabilities using UML within their tools. They also facilitate forward and reverse engineering between UML models and EJB implementations. an XML DTD for a file placed within the EJB-JAR that identifies a UML model stored in that EJB-JAR is defined within the specification, as well as that model's relationship to other EJBs in the same EJB-JAR. This enables use of Java's automation and reflection APIs to access UML models stored in EJB-JARs.

This is especially compelling because it gives EJB components the capability to self-describe their contents and capabilities, through use of case or other UML diagrams. XML Metadata Interchange (XMI), the widely used metadata representation format based on XML, will also be supported by this profile.

Need of the Java Community Addressed by the Proposed Specification

UML models must represent EJBs, capturing both their structure and semantics in order to describe software implemented with EJB. The model elements that express this structure and semantics are not contained in UML, since it predates EJB architecture. Because UML was designed to be extensible, it provides standard extension mechanisms for defining new model elements. These extension mechanisms can be used to define new model elements to represent EJBs.

In order for tools and frameworks from different vendors to interoperate, these extensions must be standardized. As it stands, some vendors may use nonstandard proprietary mappings between UML and EJB, some may use nonstandard proprietary metamodels rather than UML, and still others will not support modeling or model-based reflection and automation for EJB at all.

In addition, UML models describing EJBs with the EJB implementations in an EJB-JAR must be associated in order to use the models for automation and reflection. Without a standard way to achieve this association, tools and frameworks will be unable to use the UML models in EJB-JARs from different vendors.

Specification to be Developed and How It Addresses the Need

The following items express a new specification, defining a set of standard UML extensions that will define new model elements to represent EJBs. The UML profile for EJBs

  • Describes the relationship of logical and physical EJB constructs to UML model elements using the standard UML extension mechanisms

  • Describes the relationship between the EJB deployment descriptor and UML model elements using the standard UML extension mechanisms

  • Describes the forward engineering transformation from UML model elements using the standard UML extension mechanisms to EJB implementation artifacts

  • Describes the reverse engineering transformation from EJB implementation artifacts to UML model elements using the standard UML extension mechanisms

In addition, the specification defines a mechanism for the association of UML models stored in an EJB-JAR with the implementations of the EJBs they describe. The UML descriptor for EJB defines an XML DTD for a file placed within the EJB-JAR identifying UML models stored in the same EJB-JAR as well as their relationship to EJBs in the EJB-JAR.

  • + Share This
  • 🔖 Save To Your Account