问题
I have a couple modules. They communicate to each other through events.
What UML diagram would typically be used to show this?
Is there a non uml diagram people use?
Any examples?
回答1:
I think you definitely want a sequence diagram to show all the event interaction between modules in sequence. This is the preferred way to represent sequence of asynchronous messages between components
回答2:
If you want to express the fact that a module A fires an event E that is handled by module B, I suggest a static diagram to show the structure of your architecture.
In particular, I would use a class diagram where I could draw:
- the modules A and B (classes with a stereotype)
- the event E (i.e. still a class with the stereotype
event
) - an association named
subscribe
between B and E - an association named
publish
between A and E.
回答3:
In general you want to use a "behavioral" diagram(s). There are multiple flavors. Which one you choose depends on the intent of what a given diagram wants to convey.
http://www.visual-paradigm.com/product/vpuml/provides/behavioralmodeling.jsp
来源:https://stackoverflow.com/questions/7923455/typical-uml-diagram-for-showing-events