activity diagram refactoring - shall start with Initial activity? - uml

My activity diagram would be too big and complex, so I decided to split it into many diagrams. I replaced one branch with another diagram and I linked it into the first diagram, which looks well. I designed the second diagram but I do not know, how to start it.
I think that there must be link to the first diagram. But is it enough or shall there be initial activity (circle) before it? See attached images.

On the contrary, the initial node is excessive on the second diagram. It is already included in the start activity. It is OK to say that the whole activity diagram is an activity in another activity diagram. Look at starting diagram here - a group of activities is concluded in activity frame, as a larger activity.
Also think about using Interaction overview diagram. It is just for showing structured activity diagrams.

Related

Number of Activity Diagrams

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.

Good practice to use all SysML Diagrams?

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.

Activity Diagram and SwimLanes

Should activity diagram include detailed information about how the system functions from the start of the application?
Say for example i am making a swing application in which the app loads a JList with images when the application opens, so should i specify that in activity diagram even though user isn't himself performing the task of loading the images in the JList.
Also should swimlanes in activity diagram be divided according to the possible classes my swing application might have.
For example having 1 swimlane for model, view and controller each in a simple swing application.
Below are the Image's that I made,
OR
I feel that even though the first image is correct,the second one helps me visualize how the class diagram is going to shape up in a much better way.
So should I use the second Image?
As always, the answer is "it depends." The level of detail is not dictated by the type of diagram, but the context in which the diagram is used.
If the diagram is intended to show the flow through a use case, it should probably restrict itself to showing the activities performed by the actor(s) and the system as a whole, rather than the parts of the system.
If on the other hand the activity diagram shows the flow through a use case realization, it should definitely show the different parts of the system.
Let's say that halfway through the project you decide to change the design and not use MVC. This means the diagram needs to be redrawn. If the diagram is part of a use case realization, that's to be expected (because that's what you've done, you've decided to realize the use case in a different way). But a diagram that's part of the use case itself shouldn't need to be redrawn just because you've changed the design; the flow of interactions between the actor(s) and the system-as-a-whole shouldn't change.
That said, MVC is such a well-known way of breaking down a user interaction that it may be permissible to go to that level of detail even in a use case. So, assuming that you're documenting a use case and not a realization, if in your project or company user interactions are always designed as MVC, then I say go right ahead -- but keep it strict and use "model" rather than "image service". If the decision to use an MVC design cannot be taken during the use case analysis phase, I'd advise against it.
Swim-lanes have absolutely no model meaning. They are just a line. I recommend to use pools/lanes which are (BPMN stereotyped) UML elements. They are classified accordingly (usually with an actor) and the single actions go into each of those. This gives the activity a clear structure and it also shows responsibilities.

UML activity diagram - how to set ending nodes for sub activities?

in an activity dgm .. if an activity involves two sub activities..
should i make separate ending nodes for sub activities?
Should I make one ending node for main activity only ?
This is what i wants to say
Well, I would say that setting one ending node for your main activity can be enough. The ending node represent the termination of the whole activity you depict in your diagram. Thus the ending nodes as you put them are clearly invalid.
You can however describe ViewDetails and EditDetails with sub-activities. It that case, you can also terminate them with an ending point. In that case the ending is in the context of your activity. See here.
Personally I would create distinct diagrams for such a purpose but it seems that it is possible to represent this inside an action.
The diagram You have drawn so far is wrong. Activity diagrams represent the flow of control from activity to activity in the system.In your diagram "My profile" should not be an activity.And you need to represent activities in rounded rectangles.You can make decision point to separate the "view details" activity from the "Edit details" activity. Typically there is one starting point for the workflow and there may be more than one ending point. (one for each alternate flow in the workflow)

Difference between StateChart and Activity Diagram

I am really unable to understand the real difference between these 2 diagrams. I mean both of these deal is "states" but I am not sure what deals with what?
It might seems so, but the difference is, activity diagrams describe activities and state charts describe states. So those models are orthogonal - you might imagine there is an activity between two states (something that occurs during the transition) and you might say there is a state between two activities. This is rather a simplification, but I think it might suffice to explain the difference, which is primarily focus, both diagrams are for describing behaviours.
An activity diagram is a special case of a state chart diagram in which states are activities (“functions”).
Two types of states:
– Action state:
-- Cannot be decomposed any further.
-- Happens “instantaneously” with respect to the level of abstraction used in the model
– Activity state:
--Can be decomposed further
--The activity is modeled by another activity diagram
For examle an elevator ride.
State chart could contain states such as: entering, standing still, exit, arrived.
These state transitions are caused by activity diagram events.
And events in activity diagram could be:
Walk in to the elevator, push button to correct floor, walk out of the elevator.
I would say these two diagrams overlaps each other.
Activity diagram is used to document the logic of a single operation/method, a single use case or the flow of logic of a business process. It is equivalent to flowchart and data flow diagram from structured development.
The state diagram depict (show)the state of objects as their attributes change from state to the other state. State chart modeling is used to show the sequence of states that an object goes through, the cause the transition from one state to other and the action that result from a state change.
Activity diagram is flow of functions without trigger (event) mechanism, state machine is consist of triggered states.

Resources