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.
Standard UML doesn't support well concurrency. So UML has defined "profiles" for specialized needs. See Real time UML: advances in the UML for real-time systems
http://books.google.com/books?id=LewzKVv3A20C&printsec=frontcover&dq=UML+REAL+TIME&source=bl&ots=VcKe_Lj8_P&sig=fpZ8hmokNe-rNUR4WlqTM1_1Fds&hl=en&ei=XIY5TLqrBpiTONnL7IoK&sa=X&oi=book_result&ct=result&resnum=6&ved=0CDIQ6AEwBTgK#v=onepage&q&f=false
Use a sequence diagram. One lifeline for each class, one lifeline for the queue.
Related
How I can illustrate Akka actors in UML diagrams? Especially how to illustrate messages passed between actors? Any example will be fine. Thanks.
Be careful, Akka actors and UML actors mean two very different things. For UML, an actor is something (a human or another system) interacting with the system. For Akka, it is an active object.
So, you can use either, a sequence diagram if you want to illustrate the interaction during the time, or communication diagram if you need only to illustrate messages order.
Aka Actors are self-contained entities with their own lifecycle. Akka actors interact by sending each other messages.
Replace "Akka Actors" with "Objects" in the above statement and you have a pretty good description of the OO model underpinning UML. So you can use Class Diagrams, State Diagrams, Sequence Diagrams etc. to model Actor-based systems.
You could make various refinements depending on your needs. For example, each class that represents an actor is <<active>>. Or you could go further and introduce an <<Actor>> stereotype. Depends on your audience & model purpose.
hth.
I am not a big fan of UML. I believe UML is great in some rare instances, however I do not want to use a UML diagram to show a high level flow of calls through my application. Problem is - most of the tools (visio, lucidchart, websequencediagrams) force the user to either draw a very detailed UML diagram, or a sequence diagram. There is nothing that would be like a high-level version of a UML diagram. Or is there?
There is no such thing as a "higher level" UML diagram. UML has 12 (or was it 12? I can't remember) and you must choose from one of them, the best that fits your needs.
For a high level flow of calls I like activity diagrams, even though the objects that own the functions are harder to see. Sequence diagrams are a waste of time and space IMHO .
As we known . The sequence diagram in UML is a kind of interaction diagram that shows how processes operate with one another and in what order Between the Class or Object.
Now I am trying to find a diagram in UML or some tools to describe interaction and operation order of distributed system. Is there any diagram or tools which model the interaction between Distributed system like sequence diagram ?Thanks.
Activity Diagrams are the UML diagram to use in this situation.
Wikipedia Activity Diagram
Agile Activity Diagrams
Sequence and communication diagrams aim to show how "things" interact. These "things" could be objects, components or complete systems
You can also use sequence diagrams to describe interaction between components in a distributed system, each lifeline designating one of the system components.
After having my use case diagrams, i can't found the logique to follow to implement the sequence diagram, how can i go from analysis the what to design the how from the actors and uses cases to a sequence diagram with many stereotype without thinking about the class diagram (to respect the order).
Or should i have to implement others diagrams to passe from the use case one to the sequence?
I've always created class diagrams and sequence diagrams together (and, at least, the UML modeller Sparx Enterprise Architect is compatible with that point of view), but I was never educated in the proper order if such a thing exist.
Is there any way (official according to UML 2.0) to have sequence diagrams or activity diagrams in multithreaded environment? Or UML is just "singlethreaded"?
In UML Activity Diagrams you can fork the flow of control to more than one stream which will be executed simultaneously and you can join them again to unite (maybe before the end of the activity).
In sequence diagram, you can define block/operator (i dont know the proper english term) par to denote, that some actions are parallel...almost every relevant diagram has its own way to define parallelism.