Create the UML class diagram


JAG allows you to generate a J2EE application from the basis of a UML class diagram. There are many commercial and open-source products currently available that enable you to produce such diagrams; for example PoseidonUML has a freely-available 'community edition'.

The only requirement for the UML modelling tool is that it can export the diagram in XMI format (a format that enables easy interchange of metadata between modeling tools).

The components in the class diagram that are important to JAG are:

  • Entity classes and the associations between them
  • Service classes and their references to entities

Stereotypes

JAG makes use of stereotypes to determine the roles of the various components in the UML class diagram. Stereotypes are basically reusable named tags that you can assign to individual components in the UML diagram, allowing for further differentiation between components.

The following stereotypes must be adhered to for JAG to be able to read in the information correctly:

  • Entity classes must have the stereotype "Entity".
  • Service classes must have the stereotype "Service".
  • An entity class must have at least one attribute marked as primary key. You can mark an attribute as a primary key by giving it the stereotype "PrimaryKey".
  • A service class must have at least one reference to an entity. This is achieved in the UML by drawing a dependency link from the service to an entity, and giving it the stereotype "EntityRef".
  • Relations between entities are drawn as association links. For example, to represent a relation from entity 'Address' to entity 'User' (such that 'Address' has a foreign key field 'userID' which maps to the primary key of 'User'), you would draw an association link from 'Address' to 'User'.
    NOTE: the association must be named after the imported foreign key ('userID' in this case).

Next step: Import the UML model into JAG
<<Start page