tags:

views:

44

answers:

3

What would be the best UML diagram to show decoupling of two multithreaded classes, joined by a producer consumer queue.

I've done a whole bundle of class diagrams in the past, but they seem to be really static. Is it possibly the case that UML is not very good at modelling threading.

Thanks.

A: 

Use a sequence diagram. One lifeline for each class, one lifeline for the queue.

Bernd
+1  A: 

You can create views of the same model elements in more than one class diagram. I did very complex modeling with EclipseUML Omondo which allows you to have a single model and create as many as needed diagrams. The diagram is not therefore anymore the model itself but just a viewer of the metamodel. Using diagrams like viewer and not as model allows to reduce modeling not needed transformation complexity. It also add advanced heavy weight project modeling features.

I would say that with omondo I can model 50 larger models than I previously did with traditional diagram oriented tool. The metamodel UML diagram viewer (e.g. the diagram is only a view of the metamodel) versus the UML diagram model (e.g. the diagram is the model) is really a very very powerful approach !!