开发者

What kind of UML diagram is this?

What kind of UML diagram is this开发者_JAVA技巧?

What kind of UML diagram is this?

(source: tripod.com)


This is a class diagram, with added stereotypes


This is Class Diagram in a very abstract or initial form because all relationship are shown as Association.

Usually we start with such class diagram and then keep on refining by converting association (arrow as shown above) into more stronger relationship like generalization,composition,implementation etc.

Association is considered as weaker form of relationship between classes. So final class diagram should have fewer associations.


What is the emphasis or goal of this diagram? If it's the classes and relationships, then it's a class diagram. If it's the mapping between the classes and layers of function or responsiblity in the system, then it looks like a layer diagram. Those columns look like layers: presentation, business logic, data...


Ok now I see the problem after a good sleep :-)

It seems it is a powerpoint and not a class diagram because you can not have straight line in a class diagram. I mean you can not have 3 separators like Presentation/ objectos .......etc

This powerpoint tried to use class diagram and have added titles in order to separate 3 layers. The problem is that the class diagram is incorrect and it is not because you present it with 3 layer that it would become correct !! This is a bad understanding of what means JPA stereotypes inside a class diagram.


It looks like a Class Diagram that uses "swimlanes" on the background to facilitate some kind of MVC.


This class diagram is not correct because there is confusion between Java EE stereotypes and class names!

What are the << class module>> , << module>> stereotypes and Session, Session persistence names should be Java EE stereotypes. If it persists in the database then it is an entity! Persistence etc...can be written on attributes. This diagram doesn't make sense!

The main advantage of scheme in this diagram is that if you use a code generator such as AndroMDA, MIA software or Blue Age, then you can then generate your database directly from the model. These tools look at stereotypes during code generation.

If you don't want to generate code from a model but prefer to let hibernate mapping do the job, then the "entity" stereotype can be written as an annotation in your java code. Then thanks to live code and model synchronization, hibernate can take the annotation and produce a mapping.

This is why stereotyping is really very important and using the wrong stereotype can be a very serious mistake!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜