15
ACTIVITY DIAGRAMS

ACTIVITY DIAGRAMS

Embed Size (px)

DESCRIPTION

Forking and Joining

Citation preview

ACTIVITY DIAGRAMS

ACTIVITY DIAGRAMSForking and JoiningSimple and branching sequential transitions are the most common, however you might encounter flows that are concurrentUse a synchronization bar to specify the forking and joining of parallel flows of controlA synchronization bar is rendered as a thick horizontal or vertical lineForkA fork may have one incoming transitions and two or more outgoing transitionseach transition represents an independent flow of controlconceptually, the activities of each of outgoing transitions are concurrenteither truly concurrent (multiple nodes)or sequential yet interleaved (one node)JoinA join may have two or more incoming transitions and one outgoing transitionabove the join, the activities associated with each of these paths continues in parallelat the join, the concurrent flows synchronizeeach waits until all incoming flows have reached the join, at which point one flow of control continues on below the joinFork

To partition the activity states on an activity diagram into groupseach group representing the business organization responsible for those activitieseach group is called a swimlaneEach swimlane is divided from its neighbor by a vertical solid lineA swimlane specifies a locus of activities

SwimlanesEach swimlane has a name unique within its diagramEach swimlane may represent some real-world entityEach swimlane may be implemented by one or more classesEvery activity belongs to exactly one swimlane, but transitions may cross lanesSwimlanesSwimlanes: Example

Object FlowObjects may be involved in the flow of controlInstances of these classes may produced by certain activities will create objectsOther activities may modify these objects.you can specify things involved by placing these objects in the diagramconnected using a dependency to the activity or transition that creates, destroys, or modifies them.

Object Flow

In addition to showing the flow of an object through an activity diagram, you can also show howits role, state and attribute values changeCommon UsesYou use activity diagrams to model the dynamic aspects of a systemmay involve the activity of any kind of abstraction in any view of a system's architectureyou can do so in the context of virtually any modeling element, (system as a whole, a subsystem, an operation, or classes, interfaces, components, nodes, use cases, and collaborations.)2 ways1. Model a workflow

2. Model an operation (flowchart)

Forward and Reverse EngineeringPossible for activity diagrams, especially if the context of the diagram is an operation.a Forward engineering tool could generate code for the operationReverse engineering : the creation of a model from code.

Forward and Reverse EngineeringPoint Line::intersection (l : Line) {if (slope == l.slope) return Point(0,0);int x = (l.delta - delta) / (slope - l.slope);int y = (slope * x) + delta;return Point(x, y);}