Object-Oriented Design Activity Diagrams Sharif University of - - PowerPoint PPT Presentation

object oriented design
SMART_READER_LITE
LIVE PREVIEW

Object-Oriented Design Activity Diagrams Sharif University of - - PowerPoint PPT Presentation

Object-Oriented Design Activity Diagrams Sharif University of Technology 1 Department of Computer Engineering Analysis Workflow: Analyze a Use Case The analysis workflow consists of the following activities: Architectural analysis


slide-1
SLIDE 1

Department of Computer Engineering

1 Sharif University of Technology

Object-Oriented Design

Activity Diagrams

slide-2
SLIDE 2

2 Sharif University of Technology

Analysis Workflow: Analyze a Use Case

  • The analysis workflow consists of the following activities:
  • Architectural analysis
  • Analyze a use case
  • Outputs:
  • analysis classes
  • use case realizations
  • Analyze a class
  • Analyze a package
slide-3
SLIDE 3

3 Sharif University of Technology

Activity Diagrams

  • Activity diagrams are OO flowcharts:
  • used for modeling all types of processes;
  • can be attached to any modeling element to capture its behavior;
  • a good activity diagram communicates one specific aspect of a

system's behavior;

  • in UML 2, activity diagrams have Petri Net semantics.
slide-4
SLIDE 4

4 Sharif University of Technology

Activities

  • Activities are networks of nodes connected by edges.
  • Categories of nodes:
  • action nodes - atomic units of work within the activity;
  • control nodes - control the flow through the activity;
  • bject nodes - represent objects used in the activity.
  • Categories of edges:
  • control flows - represent the flow of control though the activity;
  • bject flows - represent the flow of objects through the activity.
  • Activities can have preconditions and postconditions.
slide-5
SLIDE 5

5 Sharif University of Technology

Activities: Example

slide-6
SLIDE 6

6 Sharif University of Technology

Activity Diagrams: Use Case Modeling

slide-7
SLIDE 7

7 Sharif University of Technology

Activities: Tokens

  • Tokens flow around the network and can represent:
  • the flow of control;
  • an object;
  • some data.
  • Tokens move from a source node to a target node across an edge depending on:
  • source node postconditions;
  • edge guard conditions;
  • target preconditions.
slide-8
SLIDE 8

8 Sharif University of Technology

Activity Partitions

  • Activity partitions - a high-level grouping of related actions.
  • Partitions form a hierarchy rooted in a dimension.
slide-9
SLIDE 9

9 Sharif University of Technology

Action Nodes

  • Execute when there is a token simultaneously on each of their input edges AND

their preconditions are satisfied.

  • After execution, action nodes offer tokens simultaneously on all output edges

whose postconditions are satisfied:

slide-10
SLIDE 10

10 Sharif University of Technology

Action Nodes: Types

slide-11
SLIDE 11

11 Sharif University of Technology

Action Nodes: Call

  • Call action node:
  • call an activity - use the rake symbol;
  • call a behavior;
  • call an operation.
slide-12
SLIDE 12

12 Sharif University of Technology

Action Nodes: Accept Time Event

  • Accept time event action node - executes when its time expression

is true:

  • an event in time (e.g., end of business year);
  • a point in time (e.g., on 11/03/1960);
  • a duration (e.g., wait 10 seconds).
slide-13
SLIDE 13

13 Sharif University of Technology

Control Nodes

slide-14
SLIDE 14

14 Sharif University of Technology

Control Nodes: Decision and Merge

slide-15
SLIDE 15

15 Sharif University of Technology

Control Nodes: Fork and Join

slide-16
SLIDE 16

16 Sharif University of Technology

Object Nodes

  • Object nodes represent instances of a classifier.
  • Input and output edges are object flows - represent the movement of objects.
  • Object node output edges compete for each output token.
slide-17
SLIDE 17

17 Sharif University of Technology

Object Nodes: Buffer Semantics

  • Object nodes act as buffers:
  • {upperBound= n};
  • {ordering= FIFO} XOR {ordering= LIFO};
  • {ordering= FIFO} is the default;
  • may have a «selection».
  • Object nodes can represent objects in a particular state.
slide-18
SLIDE 18

18 Sharif University of Technology

Object Nodes: Activity Parameters

  • Activity parameters are object nodes input to or output from an activity:
  • drawn overlapping the activity frame;
  • input parameters have one or more output edges into the activity;
  • utput parameters have one or more input edges out of the activity.
slide-19
SLIDE 19

19 Sharif University of Technology

Pins

  • A Pin is an object node that represents one input to or output from an action or

activity.

slide-20
SLIDE 20

20 Sharif University of Technology

Connectors

slide-21
SLIDE 21

21 Sharif University of Technology

Interruptible Activity Regions

  • interrupted when a token traverses an interrupting edge.
  • all flows in the region are aborted when it is interrupted.
  • interrupting edges are drawn as a zigzag arrow or as a normal arrow with a

zigzag icon above it.

slide-22
SLIDE 22

22 Sharif University of Technology

Exception Handling

  • Exception pins:
  • output an exception object from an action;
  • are indicated with an equilateral triangle.
  • Protected nodes:
  • have an interrupting edge leading to an exception handler;
  • abort when an exception of the right type is raised, and flow passes to the exception

handler node.

slide-23
SLIDE 23

23 Sharif University of Technology

Expansion Nodes

  • Represent a collection of objects flowing into or out of an expansion region.
  • The region is executed once per input element.
  • Constraints:
  • the type of the output collection must match the type of the input collection;
  • the type of object held in the input and output collections must be the same.
  • Modes:
  • Iterative - process each element of the input collection sequentially;
  • Parallel - process each element of the input collection in parallel;
  • Stream - process each element of the input collection as it arrives at the node;
  • there is no default mode.
slide-24
SLIDE 24

24 Sharif University of Technology

Expansion Nodes: Example

slide-25
SLIDE 25

25 Sharif University of Technology

Sending Signals and Accepting Events

  • Signals:
  • information that is passed asynchronously between objects;
  • class stereotyped «signal»;
  • the information is held in the attributes.
slide-26
SLIDE 26

26 Sharif University of Technology

Sending Signals and Accepting Events: Action Nodes

  • Send Signal action node:
  • starts when there is a token on all input pins;
  • executes - a signal object is constructed and sent;
  • then ends and offers control tokens on its output edges.
  • Accept Event action node:
  • started by an incoming control edge or if no incoming edge, when its
  • wning activity starts;
  • waits for an event of the specified type:
  • utputs a token that describes the event;
  • continues to accept events while the owning activity executes;
  • for a signal event, the output token is a signal.
slide-27
SLIDE 27

27 Sharif University of Technology

Sending Signals and Accepting Events: Examples

slide-28
SLIDE 28

28 Sharif University of Technology

Streaming

slide-29
SLIDE 29

29 Sharif University of Technology

Advanced Object Flows

  • input and output effects show the effects an action has on its input

and output objects:

  • write the effect in braces close to the pin;
  • selection - a condition on an object flow that causes it to accept
  • nly those objects that satisfy the condition:
  • put the selection condition in a note stereotyped «selection» attached to

the object flow;

  • transformation - transforms objects in an object flow to a different

type:

  • put the transformation expression in a note stereotyped «transformation»

attached to the object flow.

slide-30
SLIDE 30

30 Sharif University of Technology

Input and Output Effects

slide-31
SLIDE 31

31 Sharif University of Technology

Multicast and Multireceive

  • Multicast sends an object to many receivers:
  • stereotype the object flow «multicast».
  • Multireceive receives objects from many senders:
  • stereotype the object flow «multireceive».
slide-32
SLIDE 32

32 Sharif University of Technology

Parameter Sets

  • Parameter sets allow an action to have alternative sets of input and output pins:
  • input parameter sets contain input pins;
  • utput parameter sets contain output pins;
  • nly one input parameter set and one output parameter set may be used per

execution of the action.

slide-33
SLIDE 33

33 Sharif University of Technology

Central Buffer Nodes

  • Central buffer node - object nodes that are used specifically as

buffers:

  • stereotype the object node «centralBuffer».
slide-34
SLIDE 34

34 Sharif University of Technology

Interaction Overview Diagrams

  • Interaction overview diagrams show flow between interactions

and interaction occurrences

slide-35
SLIDE 35

35 Sharif University of Technology

Reference

  • Arlow, J., Neustadt, I., UML 2 and the Unified Process: Practical Object-

Oriented Analysis and Design, 2nd Ed. Addison-Wesley, 2005.