SlideShare une entreprise Scribd logo
1  sur  19
+
Activity Diagrams
Systems Analysis and Design
Michael Heron
+
Introduction
 Last week we talked about use-case diagrams.
 These let us define the interactions an actor can have with our
systems.
 However, we also need to define how those actions work.
 If we don’t have those, our diagrams are no more effective than
back of the envelope calculations.
 Many of you will be familiar with the idea of a flow chart.
 One of the simplest formal mechanisms by which the flow of logic
through a computer can be modeled.
 Today we talk about activity diagrams.
 These are the UML equivalent of flow charts.
+
Activity Diagrams
 Once we have a feel for the static design of a system and the
interactions that actors will have with it, we need to start
mapping out the flow of logic.
 And how different parts of the system are going to handle the
responsibilities.
 That is out activity diagram.
 It’s a diagram of workflow – how individual objects are going to
share out the work between them.
 It outlines the flow of activity associated with a particular
process from start to finish.
 They can get pretty complex.
+
Activity Diagram Notation
Element Description
Swim lane A swim lane is used to indicate which actors are responsible for the action in
question. This is represented by a series of lines indicating a partition in the
diagram.
Initial Node The initial node is the starting point for the diagram, and indicates from which
point the diagram should be read. This is represented by a single filled circle.
Activity Final Node This is the ending point for the diagram, and shows the termination point for the
activities. There may be several of these in a diagram. This is indicated by a
filled circle surrounded by a border.
Flow The flow represents the order in which activities are performed. Flows are
represented by arrows.
Fork A fork indicates parallel processing of an activity - when two activities are
undertaken at the same time, a fork is used to represent this. A fork is indicated
by a thick bar into which a single flow enters and multiple flows leave.
Join When parallel processing indicated by a fork is ended, it is merged back into a
single flow. This is indicated by a thick bar into which several flows enter and a
single flow leaves.
Decision A decision indicates a choice that must be decided upon, and takes the form of
a diamond with a single flow entering it and several flows leaving.
Activity An activity is a discreet step of processing within the system, and is indicated
by a rounded oval.
+
A Simple Flow Chart
+
Activity Diagrams
 Activity diagrams work like flow charts except that they enforce
swim lanes.
 What object is responsible for handling which part of the logic.
 This will be informed by your static design.
 Which object will have the attributes and methods needed to
implement the behaviour.
 In some scenarios, it’s possible for actions to occur in parallel.
 Or as close to parallel is needed for diagramming.
 Consider the following simple example of a company building
physical arcade machines.
+
An Activity Diagram
+
How Do We Create Them?
 As with all the tools we talk about in this module, an issue is
just where do we begin?
 We begin in pseudocode.
 Luckily this diagram comes in after the use-case and class
diagrams.
 So you should already have a reasonable grasp of what needs to be
done and what’s going to be responsible for doing it.
 We outline the actual process in English, as in a problem
statement.
 We then represent the flow of logic in the process as pseudocode.
+
An Example
 One of the things you’re expected to do for the assessment is to
come up with some game mechanics.
 These would be perfect self contained examples of how to do an activity
diagram.
 Let’s come up with a simple mechanic.
 Each player gets a hand of cards. Each card has a class, an action and
a name. Every round, a player can play two cards of different classes
face down. If they only have one card in their hand, they can draw one
from the deck. At the same time, the opponent quietly decides whether
the left or right card will be countered. When this has been done, the
countered card is removed and the action of the remaining card is
performed.
 Our first step is to convert this into pseudocode.
 Have a go at that yourselves.
+
Our Next Step
 Our next is to translate that into an activity diagram.
 Breaking it up into separate modules means that we can slot them
neatly into swim-lanes.
 We’ll do this in three discreet stages.
 Fleshing out the flow chart.
 This lets us look to see where the work is going to flow.
 Identifying swim lanes.
 Indicating parallelism.
 The opponent can be doing things at the same time as the player.
 I used an online tool called gliffy for these diagrams.
+
Activity Diagram (1)
+
Activity Diagram (2)
+
Activity Diagram (3)
+
An Activity Diagram
 The diagram lets us describe a number of things.
 The relationship between each object
 The methods that will be triggered in each.
 Ownership of particular processes
 It ensures that we know how each part of the mechanic is going
to link to each other part.
 And this will be important when it comes time to code it.
 This ties into our sequence diagram.
 This is where the ‘mystery functionality’ of the sequence diagram
finally gets resolved into outline processes.
+
Developing the Steps
 Activity diagrams and pseudocode are two ways of
representing the same basic set of information.
 They both follow the same rules for being developed.
 Identify the process to be documented
 Limit the scope of the process only to the relevant aspects
 Methodically document each step of the process.
 When a decision is called for, precisely enumerate all possible
options.
 When a repetition is called for, precisely enumerate the
termination condition.
 When an activity is called for, analyse and make sure that it
represents one distinct step of the system.
+
Activity Diagrams in Context
 The activity diagram we developed during this lecture is an
example only.
 It covers a mechanic rather than an actual section of code.
 They are useful for analysis purposes.
 Which is how they’re used here.
 But they’re also useful for design purposes.
 Remember the difference between the two?
 They represent two separate views of the same system.
 One shows how it works logically.
 The other shows how it works concretely.
+
Activity Diagrams in Context
 We’ll return to the subject of activity diagrams for design in a
later lecture.
 For now, it’s just sufficient to know where they fit into the whole
system.
 They’re used to outline code algorithms and object relationships.
 Each diagram in UML has a role to fill.
 They will eventually direct influence the code that is written.
 Activity diagrams in the end will show exactly what methods are
called, in which order, by which objects.
 They will eventually translate directly into your OO code.
+
Activity Diagrams in Context
 Activity diagrams for design usually look at a system at the level of
a method in the system.
 Some of these will be simple.
 Some will be complex.
 As a result, they allow for us to effectively abstract.
 ‘I need to make a method call here, although I don’t need to know what
the method does’
 Abstraction is the key tool of an analyst.
 To be able to see things in their general form.
 We can treat whole sections of a program as a black box provided
we can respect the interface that the static model presents.
+
Conclusion
 Activity Diagrams form part of the dynamic model of a system.
 How different modules of code mesh together.
 They’re useful for both analysis and design.
 We have focused on the former here, since that’s where we
currently are for the assessment.
 They are a graphical representation of what pseudocode is for.
 They show us the flow of logic through modules of a computer
program.

Contenu connexe

Tendances

Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction Diagram
Niloy Rocker
 

Tendances (20)

Activity Diagram Examples by Creately
Activity Diagram Examples by Creately Activity Diagram Examples by Creately
Activity Diagram Examples by Creately
 
Uml sequence diagrams
Uml sequence diagramsUml sequence diagrams
Uml sequence diagrams
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction Diagram
 
Activity diagrams
Activity diagramsActivity diagrams
Activity diagrams
 
Activity sequence -class and swimlane
Activity  sequence -class  and swimlaneActivity  sequence -class  and swimlane
Activity sequence -class and swimlane
 
4 activity diagrams
4 activity diagrams4 activity diagrams
4 activity diagrams
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Lecture6 activity diagrams
Lecture6 activity diagramsLecture6 activity diagrams
Lecture6 activity diagrams
 
Object diagram
Object diagramObject diagram
Object diagram
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 
Uml
UmlUml
Uml
 
Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction Modeling
 
Interaction overview & Timing diagram
Interaction overview & Timing diagramInteraction overview & Timing diagram
Interaction overview & Timing diagram
 
UML tutorial
UML tutorialUML tutorial
UML tutorial
 
Basic behavioral modeling chapter 3 of OMD
Basic behavioral modeling chapter 3 of OMDBasic behavioral modeling chapter 3 of OMD
Basic behavioral modeling chapter 3 of OMD
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
3 interaction and_state_modeling
3 interaction and_state_modeling3 interaction and_state_modeling
3 interaction and_state_modeling
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
Interaction overview and Profile UML Diagrams
Interaction overview and Profile UML DiagramsInteraction overview and Profile UML Diagrams
Interaction overview and Profile UML Diagrams
 

Similaire à SAD09 - Activity Diagrams

Software Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdfSoftware Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdf
MeagGhn
 
Lab # 05
Lab # 05Lab # 05
Lab # 05
Mr SMAK
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2
Sisir Ghosh
 

Similaire à SAD09 - Activity Diagrams (20)

Uml examples
Uml examplesUml examples
Uml examples
 
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
 
SAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsSAD11 - Sequence Diagrams
SAD11 - Sequence Diagrams
 
Introduction to Rational Rose
Introduction to Rational RoseIntroduction to Rational Rose
Introduction to Rational Rose
 
ACTIVITY DIAGRAM.pptx
ACTIVITY DIAGRAM.pptxACTIVITY DIAGRAM.pptx
ACTIVITY DIAGRAM.pptx
 
Csallner algorithms1
Csallner algorithms1Csallner algorithms1
Csallner algorithms1
 
Activity Diagram part8
Activity Diagram part8Activity Diagram part8
Activity Diagram part8
 
Collaboration Diagram
Collaboration DiagramCollaboration Diagram
Collaboration Diagram
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Case tool lab-Reg2013 by Karthick Raja
Case tool lab-Reg2013 by Karthick RajaCase tool lab-Reg2013 by Karthick Raja
Case tool lab-Reg2013 by Karthick Raja
 
SubirTarea.pdf
SubirTarea.pdfSubirTarea.pdf
SubirTarea.pdf
 
UML.pptx
UML.pptxUML.pptx
UML.pptx
 
Basic Behavioral Modeling
Basic Behavioral ModelingBasic Behavioral Modeling
Basic Behavioral Modeling
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Software Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdfSoftware Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdf
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
Lab # 05
Lab # 05Lab # 05
Lab # 05
 
Ooad unit 1
Ooad unit 1Ooad unit 1
Ooad unit 1
 
Uml
UmlUml
Uml
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2
 

Plus de Michael Heron

Plus de Michael Heron (20)

Meeple centred design - Board Game Accessibility
Meeple centred design - Board Game AccessibilityMeeple centred design - Board Game Accessibility
Meeple centred design - Board Game Accessibility
 
Musings on misconduct
Musings on misconductMusings on misconduct
Musings on misconduct
 
Accessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS FrameworkAccessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS Framework
 
ACCESS: A Technical Framework for Adaptive Accessibility Support
ACCESS:  A Technical Framework for Adaptive Accessibility SupportACCESS:  A Technical Framework for Adaptive Accessibility Support
ACCESS: A Technical Framework for Adaptive Accessibility Support
 
Authorship and Autership
Authorship and AutershipAuthorship and Autership
Authorship and Autership
 
Text parser based interaction
Text parser based interactionText parser based interaction
Text parser based interaction
 
SAD04 - Inheritance
SAD04 - InheritanceSAD04 - Inheritance
SAD04 - Inheritance
 
GRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityGRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and Radiosity
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - Textures
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)
 
GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)
 
GRPHICS03 - Graphical Representation
GRPHICS03 - Graphical RepresentationGRPHICS03 - Graphical Representation
GRPHICS03 - Graphical Representation
 
GRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D GraphicsGRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D Graphics
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
 
GRPHICS09 - Art Appreciation
GRPHICS09 - Art AppreciationGRPHICS09 - Art Appreciation
GRPHICS09 - Art Appreciation
 
2CPP18 - Modifiers
2CPP18 - Modifiers2CPP18 - Modifiers
2CPP18 - Modifiers
 
2CPP17 - File IO
2CPP17 - File IO2CPP17 - File IO
2CPP17 - File IO
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
2CPP15 - Templates
2CPP15 - Templates2CPP15 - Templates
2CPP15 - Templates
 

Dernier

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Dernier (20)

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

SAD09 - Activity Diagrams

  • 1. + Activity Diagrams Systems Analysis and Design Michael Heron
  • 2. + Introduction  Last week we talked about use-case diagrams.  These let us define the interactions an actor can have with our systems.  However, we also need to define how those actions work.  If we don’t have those, our diagrams are no more effective than back of the envelope calculations.  Many of you will be familiar with the idea of a flow chart.  One of the simplest formal mechanisms by which the flow of logic through a computer can be modeled.  Today we talk about activity diagrams.  These are the UML equivalent of flow charts.
  • 3. + Activity Diagrams  Once we have a feel for the static design of a system and the interactions that actors will have with it, we need to start mapping out the flow of logic.  And how different parts of the system are going to handle the responsibilities.  That is out activity diagram.  It’s a diagram of workflow – how individual objects are going to share out the work between them.  It outlines the flow of activity associated with a particular process from start to finish.  They can get pretty complex.
  • 4. + Activity Diagram Notation Element Description Swim lane A swim lane is used to indicate which actors are responsible for the action in question. This is represented by a series of lines indicating a partition in the diagram. Initial Node The initial node is the starting point for the diagram, and indicates from which point the diagram should be read. This is represented by a single filled circle. Activity Final Node This is the ending point for the diagram, and shows the termination point for the activities. There may be several of these in a diagram. This is indicated by a filled circle surrounded by a border. Flow The flow represents the order in which activities are performed. Flows are represented by arrows. Fork A fork indicates parallel processing of an activity - when two activities are undertaken at the same time, a fork is used to represent this. A fork is indicated by a thick bar into which a single flow enters and multiple flows leave. Join When parallel processing indicated by a fork is ended, it is merged back into a single flow. This is indicated by a thick bar into which several flows enter and a single flow leaves. Decision A decision indicates a choice that must be decided upon, and takes the form of a diamond with a single flow entering it and several flows leaving. Activity An activity is a discreet step of processing within the system, and is indicated by a rounded oval.
  • 6. + Activity Diagrams  Activity diagrams work like flow charts except that they enforce swim lanes.  What object is responsible for handling which part of the logic.  This will be informed by your static design.  Which object will have the attributes and methods needed to implement the behaviour.  In some scenarios, it’s possible for actions to occur in parallel.  Or as close to parallel is needed for diagramming.  Consider the following simple example of a company building physical arcade machines.
  • 8. + How Do We Create Them?  As with all the tools we talk about in this module, an issue is just where do we begin?  We begin in pseudocode.  Luckily this diagram comes in after the use-case and class diagrams.  So you should already have a reasonable grasp of what needs to be done and what’s going to be responsible for doing it.  We outline the actual process in English, as in a problem statement.  We then represent the flow of logic in the process as pseudocode.
  • 9. + An Example  One of the things you’re expected to do for the assessment is to come up with some game mechanics.  These would be perfect self contained examples of how to do an activity diagram.  Let’s come up with a simple mechanic.  Each player gets a hand of cards. Each card has a class, an action and a name. Every round, a player can play two cards of different classes face down. If they only have one card in their hand, they can draw one from the deck. At the same time, the opponent quietly decides whether the left or right card will be countered. When this has been done, the countered card is removed and the action of the remaining card is performed.  Our first step is to convert this into pseudocode.  Have a go at that yourselves.
  • 10. + Our Next Step  Our next is to translate that into an activity diagram.  Breaking it up into separate modules means that we can slot them neatly into swim-lanes.  We’ll do this in three discreet stages.  Fleshing out the flow chart.  This lets us look to see where the work is going to flow.  Identifying swim lanes.  Indicating parallelism.  The opponent can be doing things at the same time as the player.  I used an online tool called gliffy for these diagrams.
  • 14. + An Activity Diagram  The diagram lets us describe a number of things.  The relationship between each object  The methods that will be triggered in each.  Ownership of particular processes  It ensures that we know how each part of the mechanic is going to link to each other part.  And this will be important when it comes time to code it.  This ties into our sequence diagram.  This is where the ‘mystery functionality’ of the sequence diagram finally gets resolved into outline processes.
  • 15. + Developing the Steps  Activity diagrams and pseudocode are two ways of representing the same basic set of information.  They both follow the same rules for being developed.  Identify the process to be documented  Limit the scope of the process only to the relevant aspects  Methodically document each step of the process.  When a decision is called for, precisely enumerate all possible options.  When a repetition is called for, precisely enumerate the termination condition.  When an activity is called for, analyse and make sure that it represents one distinct step of the system.
  • 16. + Activity Diagrams in Context  The activity diagram we developed during this lecture is an example only.  It covers a mechanic rather than an actual section of code.  They are useful for analysis purposes.  Which is how they’re used here.  But they’re also useful for design purposes.  Remember the difference between the two?  They represent two separate views of the same system.  One shows how it works logically.  The other shows how it works concretely.
  • 17. + Activity Diagrams in Context  We’ll return to the subject of activity diagrams for design in a later lecture.  For now, it’s just sufficient to know where they fit into the whole system.  They’re used to outline code algorithms and object relationships.  Each diagram in UML has a role to fill.  They will eventually direct influence the code that is written.  Activity diagrams in the end will show exactly what methods are called, in which order, by which objects.  They will eventually translate directly into your OO code.
  • 18. + Activity Diagrams in Context  Activity diagrams for design usually look at a system at the level of a method in the system.  Some of these will be simple.  Some will be complex.  As a result, they allow for us to effectively abstract.  ‘I need to make a method call here, although I don’t need to know what the method does’  Abstraction is the key tool of an analyst.  To be able to see things in their general form.  We can treat whole sections of a program as a black box provided we can respect the interface that the static model presents.
  • 19. + Conclusion  Activity Diagrams form part of the dynamic model of a system.  How different modules of code mesh together.  They’re useful for both analysis and design.  We have focused on the former here, since that’s where we currently are for the assessment.  They are a graphical representation of what pseudocode is for.  They show us the flow of logic through modules of a computer program.