Search code examples
umluse-caseactivity-diagramuse-case-diagram

Is that true that one bubble (use case) represent an activity diagram?


I ever made an activity diagram to represent a use case with 3 actors. I made a swimlane for each actor, so I have 3 swimlanes in an activity diagram. But my lecturer said that it was wrong because I should have more activity diagrams. He meaned that an activity diagram based on one bubble (use case) in use case diagram, not based on actor. However I browse more, then I found that my lecturer's words should be a sequence diagram, not activity diagram. So what's the true statement? My first activity diagram or my lecturer words?


Solution

  • Your instructor is right:

    • Use-case diagrams are about what the systems has to offer to fulfil the requirements. Each use-case correspond to a set of behaviors that may be performed in interaction with the actors for helping them achieving their goals.
    • The activity diagram is about how the system performs elementary behaviors, or more complex sets of behaviors

    Use-case isn't about the internals of the system. It's about its purpose and main relation with the outside world. There is absolutely no sequential order between the use-cases shown in such diagram. A user may read it and get an answer to the question "what's in for me?".

    Activity is on contrary not about the outside world and not about actors. It's about the internals of the system: its internal flows, which follow an order that can be deduced from the control and dataflow semantics. A developer may read it and get an answer to the question "How shall this work?"

    If you know that certain activities are performed in interaction with certain actors, and if you think it's important, you may communicate this knowledge in the model with an activity partition, graphically represented as a “swimlane”. But be aware that partitions are not intended for being mapped to actors or other elements of the environment. Partitions allow to visually group activity nodes that have some characteristics in common. They are typically used to highlight which component or class is doing what.

    In conclusion, there is not necessarily a direct mapping between activity and use-cases, since they represent different realities. However, if such a mapping exist, it's at least one activity diagram per use-case (bubble).

    P.S: Slightly edited to avoid any confusion in the terminology: “swimline” is a non-UML term coming from process modeling, that describes a graphical layout, and “partition” is a subdivision of an activity diagram in the model