SlideShare a Scribd company logo
1 of 40
Arab Open University
2nd
Semester, 2006-2007
M301
Unit 4.5
States and Activities
reem.attas@arabou.org.sa
Reem AlAttas © 2
Topic Road Map
 Capturing more complex interactions
Design issues
An introduction to state machines
Variation of events and actions
Packages
Conditional Message Sends
in Sequence Diagrams
Reem AlAttas © 4
If Statement
Guard
Reem AlAttas © 5
If .. Else Statement
Mutually
Exclusive
Branch
Iterative Message Sends in
Sequence Diagrams
Reem AlAttas © 7
For Loop
Reem AlAttas © 8
Topic Road Map
Capturing more complex interactions
 Design issues
An introduction to state machines
Variation of events and actions
Packages
Reem AlAttas © 9
Defensive Programming
Pre-conditions should always be checked.
Disadvantage: conditions are repeatedly
checked in different places.
Reem AlAttas © 10
Strategies for Implementing Use Cases
One Central Class.
Actor Class.
Use Cases as Classes.
Reem AlAttas © 11
Topic Road Map
Capturing more complex interactions
Design issues
 An introduction to state machines
Variation of events and actions
Packages
Reem AlAttas © 12
The Essentials of State Machines
 An event is an occurrence of a phenomenon at a
certain moment in time and in a certain place.
 Each state represents a particular period for
which a given set of conditions applies.
 Change takes place through transitions from one
state to another. Transitions are said to be fired
or triggered by events.
Reem AlAttas © 13
Two Simple States for a Room Object
Initial
State
Event
Transition
Reem AlAttas © 14
… The Essentials of State Machines
 An event when it occurs, has consequences.
One consequence is a change of state. Other
consequences are recorded in the action part of
the label on the transition.
 That is, instead of labeling a transition just with a
simple name, we also record the actions
(consequences) that result from the occurrence
of the event.
Reem AlAttas © 15
Check In Sequence Diagram
Reem AlAttas © 16
Adding Detail to a State Machine for a
Room Object
Event
Action
;
aGuest.setRoom (self)
Reem AlAttas © 17
A Simple State Machine for the Hotel
Class
Self
Transition
Reem AlAttas © 18
Self Transition
 Originates in one state and returns to the same
state.
 If the same event is used on more than one
transition, you must make sure that no more
than one guard can evaluate to true. At most,
you want just one transition to fire in such
situations.
Reem AlAttas © 19
Entry and Exit Events
An entry event happens every time an
object enters a state.
An exit event happens every time an
object leaves a state.
Reem AlAttas © 20
… Entry and Exit Events
Reem AlAttas © 21
Internal Transition
A special transition that does not involve a
change of state.
In contrast to a self-transition, an internal
transition does not cause the execution of
any entry or exit actions.
Reem AlAttas © 22
… Internal Transition
 An internal transition may be used to handle an interrupt
where you want some action to take place that does not
affect the current state.
 Internal transitions are written inside the state to which
they refer.
Reem AlAttas © 23
Final State
 A state chart diagram shows no more than one initial
state but there can be zero, one or more final states.
 Initial and final states signify the creation and destruction
of an object.
Reem AlAttas © 24
Topic Road Map
Capturing more complex interactions
Design issues
An introduction to state machines
 Variation of events and actions
Packages
Reem AlAttas © 25
Other Kinds of Events
External Vs. Internal Events.
Synchronous Vs. Asynchronous Actions.
UML defined 4 types of events:
 Call Events.
 Signal Events.
 Change Events.
 Time Events.
Reem AlAttas © 26
Time Event
Reem AlAttas © 27
Looking Inside States
Simple State: a state that contains no
substructure.
Composite State: a state that has other
states nested within it, in order to
represent some internal behavior.
Reem AlAttas © 28
A Simple Telephone State Chart
Diagram
Reem AlAttas © 29
A State Chart Diagram of the
Composite State Active
Default
Sub-
state
Reem AlAttas © 30
No Default Sub-state
Reem AlAttas © 31
Topic Road Map
Capturing more complex interactions
Design issues
An introduction to state machines
Variation of events and actions
 Packages
Reem AlAttas © 32
Package
A general purpose mechanism for
organizing model elements into groups.
Ex. A package allows you to gather
together classes that share some common
feature or behavior, such as order
processing or stock control.
Reem AlAttas © 33
Why to Partition a S/W?
Manage size and complexity.
Information hiding.
Logical decomposition.
Reem AlAttas © 34
Typical MIS
Reem AlAttas © 35
Nested Packages
Reem AlAttas © 36
Packages Present Architecture
 Three-tiered architecture advantages:
 Parallel development.
 Reusability.
 Distribution.
Reem AlAttas © 37
Subsystems
A subsystem has two sets of elements:
 Specification: Uses cases.
 Realization: Classes.
Reem AlAttas © 38
… Subsystems
Or
<<subsystem>>
Operations
TMA4 – Q5
Thank You!

More Related Content

Viewers also liked

Dialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för VälfärdDialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för VälfärdMarcus Linder
 
8 Tipos de Hackers
8 Tipos de Hackers8 Tipos de Hackers
8 Tipos de HackersAgosMarullo
 
BUENOS AIRES
BUENOS AIRESBUENOS AIRES
BUENOS AIRESYuyi Love
 
My Portfolio in Educational Technology
My Portfolio in Educational TechnologyMy Portfolio in Educational Technology
My Portfolio in Educational TechnologyCharlene Morado
 
Four-Square-Vocabulary-Intervention
Four-Square-Vocabulary-InterventionFour-Square-Vocabulary-Intervention
Four-Square-Vocabulary-InterventionBeatrice Luchin
 
Mike Kelley 06122015
Mike Kelley 06122015Mike Kelley 06122015
Mike Kelley 06122015Mike Kelley
 

Viewers also liked (12)

Dialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för VälfärdDialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för Välfärd
 
Interactions
InteractionsInteractions
Interactions
 
8 Tipos de Hackers
8 Tipos de Hackers8 Tipos de Hackers
8 Tipos de Hackers
 
Blockbustermarketingmix
BlockbustermarketingmixBlockbustermarketingmix
Blockbustermarketingmix
 
BUENOS AIRES
BUENOS AIRESBUENOS AIRES
BUENOS AIRES
 
Pkh perempuan
Pkh perempuanPkh perempuan
Pkh perempuan
 
454
454454
454
 
My Portfolio in Educational Technology
My Portfolio in Educational TechnologyMy Portfolio in Educational Technology
My Portfolio in Educational Technology
 
Vista Development Ltd.
Vista Development Ltd.Vista Development Ltd.
Vista Development Ltd.
 
Four-Square-Vocabulary-Intervention
Four-Square-Vocabulary-InterventionFour-Square-Vocabulary-Intervention
Four-Square-Vocabulary-Intervention
 
Mike Kelley 06122015
Mike Kelley 06122015Mike Kelley 06122015
Mike Kelley 06122015
 
The present continuous
The present continuousThe present continuous
The present continuous
 

Similar to States and Activities

From Model to Implementation I
From Model to Implementation IFrom Model to Implementation I
From Model to Implementation IReem Alattas
 
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: BasicsUsing Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: BasicsEd Seidewitz
 
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: ModelingUsing Alf with Cameo Simulation Toolkit - Part 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: ModelingEd Seidewitz
 
04 transaction models
04 transaction models04 transaction models
04 transaction modelsashish61_scs
 
IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...
IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...
IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...IRJET Journal
 
Using ReasonML For Your Next JavaScript Project
Using ReasonML For Your Next JavaScript ProjectUsing ReasonML For Your Next JavaScript Project
Using ReasonML For Your Next JavaScript ProjectRoy Derks
 
Sl virtual apps-131106
Sl virtual apps-131106Sl virtual apps-131106
Sl virtual apps-131106SL Corporation
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machinescodeofficer
 

Similar to States and Activities (9)

Use Cases
Use CasesUse Cases
Use Cases
 
From Model to Implementation I
From Model to Implementation IFrom Model to Implementation I
From Model to Implementation I
 
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: BasicsUsing Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
 
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: ModelingUsing Alf with Cameo Simulation Toolkit - Part 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
 
04 transaction models
04 transaction models04 transaction models
04 transaction models
 
IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...
IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...
IRJET- Fluid Dynamics Simulation of a Car Spoiler for Drag Reduction and to I...
 
Using ReasonML For Your Next JavaScript Project
Using ReasonML For Your Next JavaScript ProjectUsing ReasonML For Your Next JavaScript Project
Using ReasonML For Your Next JavaScript Project
 
Sl virtual apps-131106
Sl virtual apps-131106Sl virtual apps-131106
Sl virtual apps-131106
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machines
 

More from Reem Alattas

Rumble Lights Pitch Deck
Rumble Lights Pitch DeckRumble Lights Pitch Deck
Rumble Lights Pitch DeckReem Alattas
 
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsNASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsReem Alattas
 
She looks just like me 2017
She looks just like me 2017She looks just like me 2017
She looks just like me 2017Reem Alattas
 
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationNasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationReem Alattas
 
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationNasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationReem Alattas
 
She Looks Just Like Me 2017
She Looks Just Like Me 2017She Looks Just Like Me 2017
She Looks Just Like Me 2017Reem Alattas
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary AlgorithmsReem Alattas
 
Evolutionary Robotics
Evolutionary RoboticsEvolutionary Robotics
Evolutionary RoboticsReem Alattas
 
Enhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceEnhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceReem Alattas
 
Skinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceSkinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceReem Alattas
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup LanguageReem Alattas
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event ModelReem Alattas
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTMLReem Alattas
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript ObjectsReem Alattas
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary SearchReem Alattas
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays Reem Alattas
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions Reem Alattas
 

More from Reem Alattas (20)

Rumble Lights Pitch Deck
Rumble Lights Pitch DeckRumble Lights Pitch Deck
Rumble Lights Pitch Deck
 
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsNASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
 
She looks just like me 2017
She looks just like me 2017She looks just like me 2017
She looks just like me 2017
 
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationNasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
 
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationNasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
 
She Looks Just Like Me 2017
She Looks Just Like Me 2017She Looks Just Like Me 2017
She Looks Just Like Me 2017
 
Tran helmet pitch
Tran helmet pitchTran helmet pitch
Tran helmet pitch
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Evolutionary Robotics
Evolutionary RoboticsEvolutionary Robotics
Evolutionary Robotics
 
Create a Need
Create a NeedCreate a Need
Create a Need
 
Enhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceEnhancing input on and above the interactive surface
Enhancing input on and above the interactive surface
 
Skinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceSkinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input Surface
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup Language
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
PHP Scripting
PHP ScriptingPHP Scripting
PHP Scripting
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary Search
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

States and Activities

  • 1. Arab Open University 2nd Semester, 2006-2007 M301 Unit 4.5 States and Activities reem.attas@arabou.org.sa
  • 2. Reem AlAttas © 2 Topic Road Map  Capturing more complex interactions Design issues An introduction to state machines Variation of events and actions Packages
  • 3. Conditional Message Sends in Sequence Diagrams
  • 4. Reem AlAttas © 4 If Statement Guard
  • 5. Reem AlAttas © 5 If .. Else Statement Mutually Exclusive Branch
  • 6. Iterative Message Sends in Sequence Diagrams
  • 7. Reem AlAttas © 7 For Loop
  • 8. Reem AlAttas © 8 Topic Road Map Capturing more complex interactions  Design issues An introduction to state machines Variation of events and actions Packages
  • 9. Reem AlAttas © 9 Defensive Programming Pre-conditions should always be checked. Disadvantage: conditions are repeatedly checked in different places.
  • 10. Reem AlAttas © 10 Strategies for Implementing Use Cases One Central Class. Actor Class. Use Cases as Classes.
  • 11. Reem AlAttas © 11 Topic Road Map Capturing more complex interactions Design issues  An introduction to state machines Variation of events and actions Packages
  • 12. Reem AlAttas © 12 The Essentials of State Machines  An event is an occurrence of a phenomenon at a certain moment in time and in a certain place.  Each state represents a particular period for which a given set of conditions applies.  Change takes place through transitions from one state to another. Transitions are said to be fired or triggered by events.
  • 13. Reem AlAttas © 13 Two Simple States for a Room Object Initial State Event Transition
  • 14. Reem AlAttas © 14 … The Essentials of State Machines  An event when it occurs, has consequences. One consequence is a change of state. Other consequences are recorded in the action part of the label on the transition.  That is, instead of labeling a transition just with a simple name, we also record the actions (consequences) that result from the occurrence of the event.
  • 15. Reem AlAttas © 15 Check In Sequence Diagram
  • 16. Reem AlAttas © 16 Adding Detail to a State Machine for a Room Object Event Action ; aGuest.setRoom (self)
  • 17. Reem AlAttas © 17 A Simple State Machine for the Hotel Class Self Transition
  • 18. Reem AlAttas © 18 Self Transition  Originates in one state and returns to the same state.  If the same event is used on more than one transition, you must make sure that no more than one guard can evaluate to true. At most, you want just one transition to fire in such situations.
  • 19. Reem AlAttas © 19 Entry and Exit Events An entry event happens every time an object enters a state. An exit event happens every time an object leaves a state.
  • 20. Reem AlAttas © 20 … Entry and Exit Events
  • 21. Reem AlAttas © 21 Internal Transition A special transition that does not involve a change of state. In contrast to a self-transition, an internal transition does not cause the execution of any entry or exit actions.
  • 22. Reem AlAttas © 22 … Internal Transition  An internal transition may be used to handle an interrupt where you want some action to take place that does not affect the current state.  Internal transitions are written inside the state to which they refer.
  • 23. Reem AlAttas © 23 Final State  A state chart diagram shows no more than one initial state but there can be zero, one or more final states.  Initial and final states signify the creation and destruction of an object.
  • 24. Reem AlAttas © 24 Topic Road Map Capturing more complex interactions Design issues An introduction to state machines  Variation of events and actions Packages
  • 25. Reem AlAttas © 25 Other Kinds of Events External Vs. Internal Events. Synchronous Vs. Asynchronous Actions. UML defined 4 types of events:  Call Events.  Signal Events.  Change Events.  Time Events.
  • 26. Reem AlAttas © 26 Time Event
  • 27. Reem AlAttas © 27 Looking Inside States Simple State: a state that contains no substructure. Composite State: a state that has other states nested within it, in order to represent some internal behavior.
  • 28. Reem AlAttas © 28 A Simple Telephone State Chart Diagram
  • 29. Reem AlAttas © 29 A State Chart Diagram of the Composite State Active Default Sub- state
  • 30. Reem AlAttas © 30 No Default Sub-state
  • 31. Reem AlAttas © 31 Topic Road Map Capturing more complex interactions Design issues An introduction to state machines Variation of events and actions  Packages
  • 32. Reem AlAttas © 32 Package A general purpose mechanism for organizing model elements into groups. Ex. A package allows you to gather together classes that share some common feature or behavior, such as order processing or stock control.
  • 33. Reem AlAttas © 33 Why to Partition a S/W? Manage size and complexity. Information hiding. Logical decomposition.
  • 34. Reem AlAttas © 34 Typical MIS
  • 35. Reem AlAttas © 35 Nested Packages
  • 36. Reem AlAttas © 36 Packages Present Architecture  Three-tiered architecture advantages:  Parallel development.  Reusability.  Distribution.
  • 37. Reem AlAttas © 37 Subsystems A subsystem has two sets of elements:  Specification: Uses cases.  Realization: Classes.
  • 38. Reem AlAttas © 38 … Subsystems Or <<subsystem>> Operations

Editor's Notes

  1. Synchronous: occurring at regular intervals.