is it good practice to use all diagrams of SysML in one project, or is it even required to use all diagrams for a complete SysML model?
Let's take an example project, where a customer uses an online calculator.
A complete Behavior Diagram model includes Use-case, Sequence Diagram, Activity Diagram, and State Diagram.
Starting with a Use-Case Diagram would show the customer interacting with the online calculator which he can use and "calculate".
A Sequence Diagram would show the customer send data to the online calculator, and wait until results are send back.
I could then use a Activity Diagram to show which data comes in and which goes out. Something like "data_in --> process --> data_out".
With a State Diagram I could show that the online calculator "waits for incoming data" and is triggered into "process" state, not accepting incoming data during "process".
You see, the diagrams are quite redundant and with little to none additional information.
Should I go for it, or is this a diagram overkill?
You create as many diagrams as you need to transport your thoughts. The model is the important part. The diagrams are just graphic views on the model that help humans to understand it.
Related
I want to verify that i correctly understand the rational unified process.
My understanding is:
For the requirements specification activity, i have to design the use case diagram (a general one), the class diagram (classes, attributes, relations), and a general sequence diagram.
For the analysis activity, i have to design a detailed use case, the sequence diagram (using control, view and model classes), the analysis class diagram, the collaboration diagram
For the conception diagram, i have to design the class diagram and the deploiement diagram
is that correct please?
for my questions:
When can i use the activity and the state-transition diagrams?
Is it correct to first design a class diagram in the requirement acquisition phase?
In the implementation phase, which diagrams do i have to use? Or do you only have to generate code from some diagrams?
thank you a lot !!
Your assumptions are right.
ADs are used to illustrate scenarios from a use case. State transitions are usually created for classes. The can be used in code generation.
Not really. To sketch a class diagram of your solution you need a rough idea how that could look like. Just taking it from requirements works only for simple systems. You need to go through the use cases first to settle a usable construct.
To implement a system some class diagrams are essential. SDs help the coder to see how the classes collaborate. You can not generate code from that. Only code stubs from classes.
I know that an activity diagram is:
More simple;
More standardized;
Support concurrent flows.
compared to a flow chart.
But what are the possible reasons for using an activity diagram instead of a flow chart apart from those mentioned above?
An activity diagram is not simpler than a flow chart. A flow chart is a simpler (earlier) version of an Activity Diagram.
Flow charts were invented at least 20 years earlier and are commonly used by non-programmers to document workflows. Any business process where people have to make decisions can be described as a flow chart. So, for example, a clerk making decisions about how to file complicated information might have a flow chart on the wall.
Because a flow chart is a subset of an activity diagram, there's actually no decision to make. A flow chart naturally grows into an activity diagram if you need to add more complex descriptions.
Sparx have a good explanation of the range of things you can describe in an Activity Diagram
A UML Activity Diagram is a type of "flowchart" .. in UML, with bells and whistles. There is no such thing as a "UML Flowchart". If using UML it is an Activity Diagram. If using something else, then something else is being used.
[UML] Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency ..
.. Activity diagrams may be regarded as a form of flowchart.
For better or worse, UML is a standardization. This is nice because it is well, "standardized", but also means that it is not appropriate for all tasks: the chosen "flowchart" model (and extensions thereof) might be a better fit for a particular problem/domain.
An activity diagram assigns responsibilities to the objects involved in collaboration using swim lanes. So the diagram clearly shows the work to be done by each object in collaboration.
As i read through UML specification superstructure that there is sequence diagram and there is a collaboration diagram
so,What is the differences between
sequence diagram and collaboration diagram?
Sequence and collaboration diagrams both aim at describing the dynamic interactions between objects.
The information you can describe are basically the same, but the two models have a different focus:
Sequence diagrams highlight more the temporal aspect, by showing invocation and responses along a (vertical) timeline and by explicitly showing the activation time of objects.
Sequence diagrams show how objects communicate with each other in terms of a temporal sequence of messages. The time flow is the most visible aspect in these diagrams, as messages are sequenced according to a vertical timeline and also the lifespan of objects associated to
those messages is reported. The figure below (taken from our book) shows an example of a sequence diagram describing 3 objects (instances of classes Shipment, Invoice and PartList) and the messages exchanged between each other. Interaction diagrams describe execution scenarios of the system.
Collaboration diagrams aim at showing the communications that happen between objects, by defining messages that flow between each other. They basically consist of superimposing the communication actions upon an object diagram. The temporal aspect can be shown here too, by numbering the interactions with sequential labels.
A collaboration diagram shows the interactions between objects or classes in terms of links (solid undirected lines connecting the elements that can interact) and messages that flow through the links. This describes at the same time some kind of static structure (links and nodes) and dynamic behavior (messages) of the system. An example is shown below.
UML1: These diagrams are the same, but present data from different points of view.
UML2: The Collaboration diagram is renamed to Communication diagram (there were misunderstanding since people thought that Collaboration diagram was used to show collaborations).
These diagrams are almost the same, but present the Sequence diagram has much more possibilities for visualization (for example, combined fragments, state invariants).
Sequence diagrams specify interaction in a time sequence manner which may be among objects and/or classes. These diagrams are created during early elaboration phase where each flow of the use case is defined in terms of sequences , i.e. after each step what is going to happen next. This kind of representation is very helpful to understand & discuss the use cases with the customer, where both can come out with all possible functional aspects.
On the other hand collaboration diagram provides a direct interaction among the object. These diagram seem to used more in the design phase of the development when you are designing the implementation of the relationship.
There is a difference between sequence diagrams and collaboration diagrams. Sequence diagrams shows object interaction in timely manner(so no need of numbering the messages). But collaboration diagram doesn't show object interaction in timely manner. (need to numbering the messages).
NOTE:
Now Collaboration diagrams are also called as communication diagrams.
A Sequence diagram is dynamic, and, more importantly, is time ordered. A Collaboration diagram is very similar to a Sequence diagram in the purpose it achieves; in other words, it shows the dynamic interaction of the objects in a system. A distinguishing feature of a Collaboration diagram is that it shows the objects and their association with other objects in the system apart from how they interact with each other. The association between objects is not represented in a Sequence diagram.
Link : http://www.developer.com/design/article.php/3102981/Collaboration-Diagram-in-UML.htm
Use sequence diagrams to show time and to emphasize the sequence or
the ordering of the interactions.
Use communication diagrams to emphasize the links among the
participants. Communication diagrams can be a helpful supplement
to the object diagrams.
What is the practical difference between using flowchart diagrams and UML activity diagrams?
I have some thoughts, but maybe I'm missing an elephant in the room?
Flowchart diagram:
Widely used;
Easily understood by non-programmers;
Old?
UML Activity diagram:
Standardized;
Supports concurrency;
Less known syntax, but still simple enough.
For my case of ad-hoc documenting a particular block of application logic, I decided to go with the flowchart diagrams. More people in the company will be able to understand them.
It might seem as a preference, but if we have a standardized language for describing software systems, Why do we use something else? This can lead to bad habit of overusing flowcharts. Activity diagrams are really simple. But if you decide to describe a more complicated aspect of the system or try to change the part you are describing, you might have to switch anyway. So just use UML and prevent confusion in the future.
As you note, Activity diagrams inherently can include concurrency and timing. If you look at this example cribbed from Wikipedia, shown below, you can observe the section with two heavy horizontal bars, and two parallel activities of "present idea" and "record idea". That is read as "start these activities in parallel, and continue only when both are complete." Flowcharts can't express this within the notation.
Practically, using activity diagrams lets you think clearly about concurrent processes. I think you'll find that anyone who can read a flowchart will quickly adapt.
Activity diagram by ​spanish Wikipedia user Gwaur CC BY-SA 3.0, via Wikimedia Commons:
According to the Agile Modeling site:
In many ways UML activity diagrams are the object-oriented equivalent of flow charts and data flow diagrams (DFDs) from structured development.
From IBM:
However, flow charts do not include And states, and flow charts for operations cannot receive events.
Probably this is why flow charts are easier to understand because activity diagrams have the notion of object-oriented development and concurrency.
You can generate source code from UML, and vice versa; hence the "standardized" characteristic you talked about.
UML in itself is used to share your understanding. Share the understanding in a standardized way. Since your case is ad hoc and the primary usage of an UML diagram is to provide an informal sketch, activity diagram can be used here. But so can flow charts as there are no parellism involved here. I have always found the following argument to be helpful. The artifct that i am producing is going to benefit whom? And can i express the flow in a self explanatory way using a flow chart. And if yes, then you should go ahead and use flow chart. But if your class diagrams, sequence etc are in UML format, it would make sense to have your activity diagrams in UML as well for consistency sake(The argument here would be, if people can understand class,sequence UML semantics, then y not activity diagrams.).
I'm currently architecting a design for an application that communicates with an inventory system. I don't need to design a class in my class diagram for this inventory system, but a class has to communicate with that inventory system in a sequence diagram. Can I simply model a lifeline for that inventory system without having modeled it in my class diagram?
My short answer is yes, you can include something in a sequence diagram which doesn't appear in any class diagrams.
My long answer is: making UML diagrams is not modeling, it's a way of illustrating how you plan to model; it's a tool for communicating ideas. A comprehensive, complete set of UML diagrams probably won't translate into a working system which meets your customer's needs, because while the system is being built your customer is very likely to change their mind about what they want, and you're very likely to discover things you didn't know up front which force some of your carefully-diagrammed plans to change.
With this in mind, I use UML only as a tool to get an idea across to a particular audience at a particular time. As such, I consider everything which isn't vital to illuminating a particular concept or part of the system I'm looking at at the time as irrelevant. This includes whether my UML diagram covers every part of the system, whether every entity in a sequence diagram has a corresponding symbol in a class diagram, etc. I'd say the only measure of whether a UML diagram is 'correct' is if it helps illustrate the part of the model you intend - if it does don't spend any time worrying about the details.