Components and classes in the same diagram


Now with Java EE 5 entity beans are simple Pojos but stateless can still be seen as components with their remote or/and local interface.

If I want to represent on a diagram a relation between a stateless (a component) and some entities (classes) how do I do that ? I can’t use a component diagram because there are no classes and can’t use a class diagram because there’s no component. I don’t want to use a class for a stateless but rather a component because I can show their interfaces in a nice manner.

Does any body have an idea to combine components and classes in the same diagram ? I haven’t seen anything in the UML spec, I don’t know if it allows it or not.



Hi agoncal,

It is possible to create components in class diagram. In fact, you can create any kinds of model in any diagram. I attached several screenshot to illustrate this to you.

Screen 1 - You can add the Component category to the palette inside a Class Diagram to make it able to use the models provided by Component Diagram

Screen 2 - You can use Generic Connector to connects your Class and Components

Screen 3 - You can even customize the connector to suit your need (colors, arrow heads, styles…)

Hope this helps.

Best regards,

Fantastic, I love this tool ;o)