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.
Related
I just started out with UML and I was wondering should my UML model have multiple activity diagrams?
Each diagram would be for a specific use case.
I am using StarUML for the design.
Yes, anything but the most trivial system would require more than one Activity Diagram to model it's behavior.
One Activity (with owned Activity Diagram) per Use Case is pretty what I would expect.
Which UML diagram is the best for showing dependency between our IT system and other external IT systems?
For example I would like to show on diagram:
system A gets data from system B
system B can call some functionality from system A
I'm wondering between component diagram and sequence diagram.
What do you think?
your question is not very specific as all UML diagrams display some kind of dependency or pathway how to get data or make a call, so I'm not sure if I got substance of your question right
1. there is no such thing as one best UML diagram to show it all
There is usually one system that you are modeling (+ some black boxes in its surrounding environment) and one UML model. At best the tool you use should support Model Driven Architecture (MDA) and perhaps even Executable UML so that the result of your modeling can be more then set of "pictures". It can become skeleton of source code forming the backbone of the application or it can be even model-click-and-run product.
In order to provide full or sufficient description of the system you'll usually need more UML diagrams each representing different point of view with focus on different aspects with different level of detail (yet all of them being parts of one model).
(This ↑ was the hard part for me to understand)
2. before deciding which diagrams to use make some paper & pencil prototypes
It is quite importtant to make sure which diagram fits your needs before you start drawing it in a good looking sharable form using a tool. Even drawing in Enterprise Architect takes some time to get used to and to get it right.
Very good guide how to do a paper & pencil diagrams and which of them is used for what and how to spend only as much time as is needed:
Agile Modeling - Start Here
...
Agile Modeling - UML 2 Component Diagrams: An Agile Introduction
Agile Modeling - UML 2 Sequence Diagramming Guidelines
...
3. sequence diagrams are expressive simple and useful for programmers
There are even tools that can turn sequence diagrams into code or tools that can turn source code into a sequence diagram.
overview UML sequence diagrams overview of graphical notation
overview IBM Rational Edge - UML basics: The sequence diagram
tutorial Enterprise Architect - 14 minute video - Create Sequence Diagram
4. activity diagrams are expressive and useful for programmers
overview Debenedetti Emanuele, Activity diagrams in UML 2.0
background by Conrad Bock (one of UML authors), UML 2 Activity and Action Models, The Journal of Object Technology
UML 2 Activity and Action Models
UML 2 Activity and Action Models, Part 2: Actions
UML 2 Activity and Action Models, Part 3: Control Nodes
UML 2 Activity and Action Models, Part 4: Object Nodes
UML 2 Activity and Action Models, Part 5: Partitions
UML 2 Activity and Action Models, Part 6: Structured Activities
tool manuals
PaceStar UML Diagrammer, UML Diagramming Guide - http://www.pacestar.com/uml/udg60.pdf
Sparx Enterprise Architect, Using UML Part Two – Behavioral Modeling Diagram - http://www.sparxsystems.com.au/downloads/whitepapers/UML_Tutorial_Part_2_Introduction.pdf
Microsoft Visual Studio, UML Activity Diagrams - http://msdn.microsoft.com/en-us/library/vstudio/dd409360.aspx
5. high level overview diagrams useful for programmers and others (not UML)
poster Business Process Model and Notation
Wikipedia - Business Process Model and Notation
clear expressive language easy to comprehend ARIS Event-Driven Process Chain (EPC) (my favorite since the first time I met it back in 1999)
6. = 1 + 2 + you
make some paper & pencil sketches and decide yourself which diagrams best suit your needs
Further to your thoughts and what Aleks has said, people usually use a combination of both to articulate the inter-system relationships
EA allows you to reuse components in component diagram & Sequence diagram, which allows you to update model from one diagram and have the changes reflected in the other.
Below snapshots show how two components in the model are used in a component diagram (for structural relationships) and sequence diagram(for behavioral flow)
Components definitelly, and dependencies. Dependency does not go in direction of the data-flow, but from the component that "knows" other component (invokes something from it, creates an object, etc).
The following diagram shows the idea.
It is common (and highly recommendable) practice, to use interfaces between the components and channel dependencies through interface. This permits clearer specification and better design (if possible of course).
Sequence diagram can further be used to specify concrete usage scenario and is also recommendable. So, components for structural, static dependencies and sequence for dynamic behavior.
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.
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.