SEG 2100 Software Design II - Philadelphia University

SEG 2100 Software Design II - Philadelphia University

Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram Objectives To read and write UML activity diagrams To know when and how to use activity diagrams Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions

and Behaviour What is an Activity Diagrams? An activity diagram is like a state diagram. Except most transitions are caused by internal events, such as the completion of a computation. It shows actions and of control and data between them. An activity diagram Can be used to understand the flow of work that an object or component performs. Can also be used to visualize the interrelation and interaction between different use cases. Is most often associated with several classes. One of the strengths of activity diagrams is the representation of

concurrent activities. Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour What is the purpose of activity diagrams? The basic purposes of activity diagrams are similar to other four diagrams; class diagram, object diagram, sequence diagram and state transition diagram. It captures the dynamic behaviour of the system. Other four diagrams are used to show the message flow from one object to another but activity diagram is used to show message flow from one activity to another.

Activity diagram does not show any message flow from one activity to another. Activity diagram is some time considered as the flow chart. Although the diagrams looks like a flow chart but it is not. So the purposes can be described as: Draw the activity flow of a system. Describe the sequence from one activity to another. Describe the parallel, branched and concurrent flow of the system. Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour

When to Use Activity Diagrams The activity diagram is suitable for modeling the activity flow of the system. An application can have multiple systems. Activity diagram also captures these systems and describes flow from one system to another. This specific usage is not available in other diagrams. These systems can be database, external queues or any other system. Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour

Activity Diagram symbols Activity (name of action) start state end state Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour

Activity Diagram symbols guard is noted on a transition between two activities Action 1 [guard 1] Action 2 Lethbridge/Laganire 2005 [guard 2]

Action 3 Chapter 8: Modelling Interactions and Behaviour Activity Diagram symbols branch single incoming transition, several guarded outgoing transitions [guard 1] Lethbridge/Laganire 2005

[guard 2] Chapter 8: Modelling Interactions and Behaviour Activity Diagram symbols merge multiple incoming transitions, single output Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions

and Behaviour Example of branch and merge Dry Clothes merge node Run Drier [still wet] branch node

Lethbridge/Laganire 2005 [else] guard s Fold Clothes Chapter 8: Modelling Interactions and Behaviour

Activity Diagram symbols fork one incoming transitions and several outgoing transitions Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour Activity Diagram symbols joint

several income transitions and one outgoing transitions (taken only when all the state on the incoming transactions have completed their activities) Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour Example of fork and joint fork

node join node Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour Example 1 Lethbridge/Laganire

2005 Chapter 8: Modelling Interactions and Behaviour Example 2 Buying Drinks from a Simple Vending Machine Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour

Swimlanes Activity diagrams are most often associated with several classes. The partition of activities among the existing classes can be explicitly shown using swimlanes. Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour Example with swimlanes Students course registration

Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour Exercise 1 Draw an activity diagram to show the activity of withdrawing money from the ATM machine. Include the following basic activities:i)Enter pin ii)Verify the pin iii)Withdraw the money iv)Print the receipt

Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour Exercise 2 There is one entry gate to a parking lot, which interfaces to the APL controller through a Push-for-ticket button, a Ticket dispenser, and the Entry gate arm. When a driver enters a parking lot by pushing the Push-for-ticket button, tickets will be dispensed from a Ticket dispenser. After the driver removes the ticket, Entry gate arm will be automatically lifted.

There is also one exit gate, which interfaces to the APL controller through a Ticket reader, a Credit card reader, and the Exit gate arm. When a driver exits a parking lot by inserting the ticket into the Ticker reader, the parking fee will be computed, which uses the Credit card reader to read the card and then transfers the payment via an external Credit card banking system. When the payment has been collected, Exit gate arm will be automatically lifted. Draw an activity diagram for the exit gate activity. Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour

Lethbridge/Laganire 2005 Chapter 8: Modelling Interactions and Behaviour

Recently Viewed Presentations

  • Introduction to Computer Science (886200)

    Introduction to Computer Science (886200)

    การจัดเก็บจำนวนเต็มในระบบ Excess-n Notation . การแทนจำนวนเต็มในระบบส่วนเกิน n (Excess-n Notation). เขียนรูปแบบของบิตโดยเริ่มต้นจากศูนย์ และเพิ่มค่าทีละหนึ่งจนถึง ...
  • Module 9: Scheduling

    Module 9: Scheduling

    Scheduled work times are entered into the scheduling tool. This software additionally allows users to enter operator sleep times, which gives a more refined estimate of performance. In this software, the output is an alertness score that, for each moment...
  • Gaming. Sub-acute patients. RIC AND LINDY DRG Workshop

    Gaming. Sub-acute patients. RIC AND LINDY DRG Workshop

    Rehabilitation Client Code 2. Admit Motor Functional Independence Measure (FIM) score 3. Admit Cognitive FIM score 4. Patient Age Rehabilitation Patient Groups - Ontario 2008 -1 of 2 (M = motor FIM score; C=cognitive FIM scores) 1. Stroke 1100. ......
  • General Licensing Class - University of Colorado Boulder

    General Licensing Class - University of Colorado Boulder

    General Licensing Class Subelement G2, Questions Only ... -path heading Toward the North G2D07 Which of the following is required by the FCC rules when operating in the 60-meter band? ... 75 and 40 meter amateur bands G2A08 What is...
  • Chapter 7: Leader-Member Exchange Theory Overview LMX Theory

    Chapter 7: Leader-Member Exchange Theory Overview LMX Theory

    LMX theory . validates. our experience of how people within organizations relate to one another and the leader. LMX theory is the only leadership approach that makes the . dyadic relationship . the centerpiece of the leadership process. LMX theory...
  • An Empire in Transition

    An Empire in Transition

    Reduced colonial government. Permitted Royal officials to be tried in England when accused of a crime. Required quartering of troops. Violated English Bill of Rights. First Continental Congress. 55 delegates from 12 colonies (except Georgia) met in Philadelphia . Decisions...
  • ENVISAT PDS Status & Performance Envisat Validation Workshop

    ENVISAT PDS Status & Performance Envisat Validation Workshop

    ENVISAT PDS Status & Performance PDS Overall Status and Plans: Points to be addressed Operation strategy (the Kiruna-only and Kiruna-Svalbard scenario) Encountered difficulties and progress Objectives for the validation Stabilisation of the PDS towards a sustained throughput Consolidation of the...
  • Invasive Species

    Invasive Species

    In New Zealand for example, the introduction of non-native species has caused an irreversible decline in many of the islands' bird species, such as the kakapo, the world's only flightless parrot. Water discharged from ships can potentially transport a huge...