How to map J2EE concepts in UML diagrams


EJB design: How to map J2EE concepts in UML diagrams

  1. How to map J2EE concepts in UML diagrams (4 messages)


    I have worked with J2EE or several months now but I never had to create the models in UML before. I don´t know how to represent some objetcs from a J2EE application in some of the diagrams. For example, I have JSP´s for presentation, servlets for control of flow and some EJB´S. In a sequence diagram, What is best way to represent the JSP page? Is it included as a class? Should I create a class diagram for it?
    Any comments? Any help is appreciated.

  2. I'm not sure about this, but I think there is an upcoming standard for representing EJBs in UML diagrams (currently under JCP). I'm not sure how you should represent JSPs... but I'm quite sure you shouldn't do a class diagram for them, as JSPs should only contain very little code (all code should be kept in the "mediator" JavaBeans or tag libs or wherever, the JSP itself should only call them).
    I guess best idea would be representing the JSP in sequence diagrams and maybe component-level diagrams, but definitely not in class diagrams.

    just a suggestion though

    kind regards

  3. I'd agree with messie on this...just have the servlet and related helper classes in along with EJB's in the class diagrams... Leave JSP's, taglibs to component and sequence diagrams. Also if you are showing 'summary' sequences limit to showing home ans demote interfaces for EJB's.... ofcource the detailed sequence would involve the actual EJB implementation.
  4. Sure you can represent jsp in rose/togetherj/etc. For rose you can make them an ordinary class with a JSP stereotype. Check out a book called building web applications with uml.

  5. Hi Hector,

    the EJB to UML mapping is indeed being addressed by a spec now under JCP. You can download the "UML Profile for EJB" from:

    Basically, it consists of stereotypes to be applied to classes and relationships between classes. I suggest you go straight to the Examples section (p. 66) in order to see whether it would fit to your needs.

    Regarding JSP pages, I think it's useful to represent them in a state transition diagram so the navigation among pages can be clearly seen.

    Hope this helps,