WEEK 7 CS2002 Software Development and Management: Activity Diagrams

Brunel University of London

  • Course: CS2002 Software Development and Management

  • Instructor: Dr. Yani Xue

The Activity Diagram

  • Focus on visualizing the flow of activities in a system, particularly in software processes.

Reference Material

  • Textbook:

    • "UML @ Classroom: An Introduction to Object-Oriented Modeling"

    • Authors: Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel

    • Publisher: Springer Publishing, 2015

    • ISBN: 3319127411

Content Overview

  • Key components of the discussion include:

    • Introduction and purpose of Activity Diagrams

    • Basic elements and their functions

    • Object nodes and their roles

    • Central buffers and data stores for information management

    • Connectors to enhance diagram readability

    • Event-based actions and call behavior actions

    • Use of partitions in diagrams

    • Exception handling strategies

Introduction to Activity Diagrams

  • Purpose: Model the processes within a system, focusing on procedural aspects.

  • Related concepts:

    • Business process languages

    • Petri net token concept for describing concurrent processes

  • Broad application across object-oriented and non-object-oriented system modeling.

Levels of Granularity

  • User-defined behavior can be specified at multiple levels:

    • Business process functions

    • Use case action flows

    • Detailed instruction behaviors for operations

Understanding Activities

  • Definition:

    • Directed graph where:

      • Nodes represent actions

      • Edges indicate control and object flow necessary for execution

  • Optional elements:

    • Parameters

    • Pre- and postconditions

Action Specifications

  • Fundamental unit for defining user behavior:

    • Actions are atomic but can be aborted.

    • Can be described using natural language or programming languages.

    • Notation for predefined action types includes event-based actions and call behavior actions.

Edges: Connecting Components

  • Functionality:

    • Connect activities and define execution order.

  • Types of edges:

    • Control flow edges: Specify order of execution between nodes.

    • Object flow edges: Facilitate data/object exchange between nodes, showing dependencies.

Control and Object Flow

  • Control flow connects actions sequentially, while object flow illustrates data dependencies.

Conditions and Guards

  • Guards (conditions) determine flow continuity; execution continues if conditions in brackets evaluate to true.

Tokens

  • Managing execution:

    • Tokens regulate execution permission for actions.

  • Process: Action receiving a token can execute, then transfers token to subsequent actions, contingent upon guard evaluations.

  • Types of tokens:

    • Control tokens (execution permissions)

    • Object tokens (carry data)

Activity Initialization

  • Initial Node:

    • Commences activity execution, generating tokens for outflow.

    • Supports multiple nodes for modeling concurrent activities.

Activity Termination

  • Final Nodes:

    • Activity Final Node: Terminates all execution paths upon receiving first token.

    • Flow Final Node: Ends specific execution paths without affecting others.

Decision Nodes

  • Define alternative paths with guard conditions facilitating flow selections based on evaluations.

Merge Nodes

  • Consolidate alternative paths into a single flow, capable of modeling loop structures.

Parallelization Nodes

  • Split execution paths into concurrent subpaths, duplicating tokens for distribution.

Synchronization Nodes

  • Merge concurrent paths, waiting for tokens at all inflows before processing and passing on control tokens.

Example Flow

  • Illustrative examples demonstrate complex interactions, decision-making and parallel workflows within the context of attending lectures and registering for assignments.

Object Nodes

  • Contain data eligible for flow, referencing data exchange, with additional typological information as needed.

Central Buffers and Data Stores

  • Central Buffer:

    • Temporary storage for object tokens, Read operations delete token from memory.

  • Data Store:

    • Permanent memory for saving object tokens, allowing copies for distribution.

Weight of Edges

  • Minimum token requirement for action execution; defaults and variations signify token consumption logic.

Connectors

  • Used to connect actions spread apart, enhancing diagram readability.

Event-Based Actions

  • Different actions, such as sending signals or accepting events, include specific notations and illustrate varied interaction triggers within the system.

Call Behavior Actions

  • Allows for the hierarchical structuring of actions, promoting clarity and reusability of modeling components.

Partitions

  • Organizational units in diagrams, grouping nodes and edges for clarity reflecting responsible roles or units.

Exception Handling

  • Defined responses to error situations, employing exception handlers that replace actions, ensuring continuity of process.

  • Interruptible Activity Region:

    • Categorizes actions that terminate upon specific event occurrences, triggering alternative behaviors.

Notation Elements for Diagramming

Basic Symbols

  • Action Node: Represents an entity executing an action.

  • Activity Node: Depicts broader processes that can be subdivided.

  • Final Nodes: Marks the end of execution flows.

Advanced Symbols

  • Decision/Merge Nodes: Shapes indicating branching and merging of execution paths.

  • Parallelization/Synchronization Nodes: Nodes for concurrent execution path management.

Additional Symbols

  • Object Nodes: Represent data exchange points within the flow.

  • Exception Handlers: Depict responses to faults in execution.