SlideShare ist ein Scribd-Unternehmen logo
1 von 19
UsingUML,Patterns,andJava
Object-OrientedSoftwareEngineering Chapter 5,
State Modeling
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2
Overview:
 Events
 States
 Transitions and Conditions
 State Diagrams
 State Diagram Behavior
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3
Events
 An event is an occurrence at a point in time, such as user
depresses left button or flight 123, departs from Chicago.
 Events often correspond to verbs in the past tense (power
turned on, alarm set)
 Events are messages sent to objects.
 An event is an occurrence at a point in time, such as user
depresses left button to know various options. Another example
Rail departs from Mysore to Bangalore.
 Events corresponds to verbs in the past tense or to the onset of
some condition. The time in which an event occurs is an
implicit attribute of the event.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4
Events
 One event may logically precede or follow another or the two
events may be unrelated.
 For example two flight can arrive at two different airports. Two
events are casually unrelated are said to be concurrent , they
have no effect on each other.
 Events include error conditions and also normal occurrences.
Example timeout events , paper jammed in printer, transaction
aborted etc.,
 There are several kinds of events
• Change event
• Signal event
• Time event
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5
Signal Event
 A signal is an explicit one-way transmission of information
from one object to another.
 A signal event is the event of sending or receiving a signal.
Here we are more concerned about the receipt of a signal,
because it causes effects in the receiving object.
 A signal is a message between objects while a signal event is
an occurrence in time.
 Every signal transmission is a unique occurrence, but we group
them into signal classes and give each signal class a name to
indicate common structure and behavior.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6
Signal Event
 Every signal transmission is a unique occurrence, but we group
them into signal classes and give each signal class a name to
indicate common structure and behavior.
 Let us consider an example Kingfisher flight 123 departs from
Mysore on March 23, 2010 is an instance of signal class Flight-
Departure.
 Some signals are simple occurrences, but most signal classes
have attributes indicating the values they convey.
 The UML notation is the keyword signal in guillements(<< >>)
above the signal class in the top section of a box. The second
section lists the signal attributes.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7
Change Event
 A change event is an event that is caused by the satisfaction of
a Boolean expression.
 Event of the expression is continually tested – whenever the
expression changes from false to true , the event occurs.
 The UML notation for change event is the keyword when
followed by a parenthesized Boolean expression.
Time Event
 A time event is an event caused by the occurrence of an
absolute time or the elapse of a time interval.
 The UML notation for an absolute time is the keyword when
followed by a parenthesized expression involving time. The
notation for a time interval is the keyword after followed by a
parenthesized expression that evaluates to a time duration.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8
States
 A state is an abstraction of the values and links of an object. Set
of values and links are grouped together into a state according
to the gross behavior of objects.
 UML notation for a state – a rounded box, containing an
optional state name.
 The objects in a class have finite number of possible states.
Each object can only be in one state at a time. Objects pass
through one or more states during their lifetime.
 A state specifies the response of an object to input events. All
events are ignored in a state, except those for which behavior is
explicitly prescribed. For example, if a digit is dialed in state
Dial tone, the phone line drops the dial tone and enters state
Dialing.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9
Event Vs. States
 Events represent points in time. State represent intervals of
time. A state corresponds to the interval between two events
received by an object.
 Both events and states depend on the level of abstraction. A
travel agent planning an itinerary would treat each segment of a
journey as a single event, an air traffic control system would
break each flight into many geographical legs.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10
Transitions and conditions
 A transition is an instantaneous change from one state to
another. For example, when a phone is answered , the phone
line transitions from the Ringing state to the Connected state.
The choice of next state depends on both the original state and
the event received.
 A guard condition is a Boolean expression that must be true in
order for a transition to occur.
 A guard condition is checked only once, at the time the event
occurs and the transition fires, if the condition is true.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11
State diagrams
 A state diagram is a graph whose nodes are states and whose
directed arcs are transitions between states.
 A state diagram specifies the state sequences caused by events.
 The state model consists of multiple state diagrams, one state
diagram for each class with important temporal behavior.
Sequences.
 State names must be unique within the scope of a state
diagram.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12
One shot state diagram
 The state model consists of multiple state diagrams, one state
diagram for each class with important temporal behavior.
 One shot state diagrams represent objects with finite lives and
have initial and final states.
 The initial state is entered on creation of an object, entry of the
final state implies destruction of the object.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13
Summary of Basic State Diagram Notation
 State: Drawn as rounded box containing an optional name.
 Transition: Drawn as a line from the origin state to the target
state.
 Event: A signal event is shown as a label on a transition and
may be followed by parenthesized attributes.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14
State diagram behavior
 An effect is a reference to a behavior that is executed in
response to an event.
 An activity is the actual behavior that can be invoked by any
number of effects.
 An activity may be performed upon a transition, upon the entry
to or exit from a state, or upon some other event within a state.
Activities can also represent internal control operations, a
program might increment an internal counter every time a
particular event occurs.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 15
Activity effect
 The notation for an activity is a slash(/) and the name (or
description) of the activity, followed the event that causes it.
The keyword do is reserved for indicating an ongoing activity
and may not be used as an event name.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 16
Do-activities
 A do-activity is an activity that continues for an extended time.
Do-activity can only occur within a state and cannot be
attached to a transition.
 The notation “do /” denotes a do-activity that may be
performed for all or part of the duration that an object is in a
state.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 17
Entry and exit activity
 One can bind activities to entry or to exit from a state.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 18
Guard Conditions
 Selection tools are not, however, non-deterministic.
 The transition that is followed is determined completely by
where the user clicks the mouse.
 We can show this by adding guard conditions to the transitions,
written in brackets after the event name.
 Guard conditions are boolean expressions.
 They are evaluated when a press event is received, and
depending which one is true at the time of the event being
received, the tool will transition to either of the “Moving” or
“Error” states.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 19
Guard Conditions

Weitere ähnliche Inhalte

Was ist angesagt?

4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using umlAPU
 
Implications of Substitution
Implications of SubstitutionImplications of Substitution
Implications of Substitutionadil raja
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling TechniquesShilpa Wadhwani
 
State Pattern In Flex
State Pattern In FlexState Pattern In Flex
State Pattern In Flextcab22
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III pkaviya
 
6. activity diagrams
6. activity diagrams6. activity diagrams
6. activity diagramsAPU
 

Was ist angesagt? (10)

Jar chapter 4, part 1
Jar chapter 4, part 1Jar chapter 4, part 1
Jar chapter 4, part 1
 
Ooad 3
Ooad 3Ooad 3
Ooad 3
 
Seminar State Chart1
Seminar State Chart1Seminar State Chart1
Seminar State Chart1
 
State Diagram
State DiagramState Diagram
State Diagram
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using uml
 
Implications of Substitution
Implications of SubstitutionImplications of Substitution
Implications of Substitution
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling Techniques
 
State Pattern In Flex
State Pattern In FlexState Pattern In Flex
State Pattern In Flex
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III
 
6. activity diagrams
6. activity diagrams6. activity diagrams
6. activity diagrams
 

Ähnlich wie Ooad ch 5

Lecture 13 requirements modeling - flow & behavior (2)
Lecture 13   requirements modeling - flow &  behavior (2)Lecture 13   requirements modeling - flow &  behavior (2)
Lecture 13 requirements modeling - flow & behavior (2)IIUI
 
STATE DIAGRAM.pptx
STATE DIAGRAM.pptxSTATE DIAGRAM.pptx
STATE DIAGRAM.pptxssuser2d043c
 
Software engineering.pptx
Software engineering.pptxSoftware engineering.pptx
Software engineering.pptxNourhanTarek23
 
Software engineering.pptx
Software engineering.pptxSoftware engineering.pptx
Software engineering.pptxNourhanTarek23
 
Q6. In a UML state machine diagram, 1. What is an event How is it re.pdf
Q6. In a UML state machine diagram, 1. What is an event How is it re.pdfQ6. In a UML state machine diagram, 1. What is an event How is it re.pdf
Q6. In a UML state machine diagram, 1. What is an event How is it re.pdfarshadkhan4488
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsAmr E. Mohamed
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsAmr E. Mohamed
 
UML Diagrams For Online Course Portal
UML Diagrams For Online Course PortalUML Diagrams For Online Course Portal
UML Diagrams For Online Course PortalHarieHaren GV
 
Unit two concept of classes and objects
Unit two concept of classes and objects Unit two concept of classes and objects
Unit two concept of classes and objects Dr Chetan Shelke
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsDang Tuan
 
Objec oriented Analysis and design Pattern
Objec oriented Analysis and design PatternObjec oriented Analysis and design Pattern
Objec oriented Analysis and design PatternAshish Kumar Thakur
 
ch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all studentsch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all studentstalldesalegn
 
A LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMS
A LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMSA LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMS
A LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMSijseajournal
 
Free ebooks download ! Edhole
Free ebooks download ! EdholeFree ebooks download ! Edhole
Free ebooks download ! EdholeEdhole.com
 

Ähnlich wie Ooad ch 5 (20)

Lecture 13 requirements modeling - flow & behavior (2)
Lecture 13   requirements modeling - flow &  behavior (2)Lecture 13   requirements modeling - flow &  behavior (2)
Lecture 13 requirements modeling - flow & behavior (2)
 
States machine
States machineStates machine
States machine
 
STATE DIAGRAM.pptx
STATE DIAGRAM.pptxSTATE DIAGRAM.pptx
STATE DIAGRAM.pptx
 
Chapter7
Chapter7Chapter7
Chapter7
 
Software engineering.pptx
Software engineering.pptxSoftware engineering.pptx
Software engineering.pptx
 
Software engineering.pptx
Software engineering.pptxSoftware engineering.pptx
Software engineering.pptx
 
ch2lect.ppt
ch2lect.pptch2lect.ppt
ch2lect.ppt
 
Q6. In a UML state machine diagram, 1. What is an event How is it re.pdf
Q6. In a UML state machine diagram, 1. What is an event How is it re.pdfQ6. In a UML state machine diagram, 1. What is an event How is it re.pdf
Q6. In a UML state machine diagram, 1. What is an event How is it re.pdf
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
UML Diagrams For Online Course Portal
UML Diagrams For Online Course PortalUML Diagrams For Online Course Portal
UML Diagrams For Online Course Portal
 
Unit two concept of classes and objects
Unit two concept of classes and objects Unit two concept of classes and objects
Unit two concept of classes and objects
 
ch04lect1.ppt
ch04lect1.pptch04lect1.ppt
ch04lect1.ppt
 
Ch05lect2 ud
Ch05lect2 udCh05lect2 ud
Ch05lect2 ud
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral Diagrams
 
Objec oriented Analysis and design Pattern
Objec oriented Analysis and design PatternObjec oriented Analysis and design Pattern
Objec oriented Analysis and design Pattern
 
ch02lect1.ppt
ch02lect1.pptch02lect1.ppt
ch02lect1.ppt
 
ch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all studentsch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all students
 
A LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMS
A LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMSA LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMS
A LITERATURE SURVEY OF COGNITIVE COMPLEXITY METRICS FOR STATECHART DIAGRAMS
 
Free ebooks download ! Edhole
Free ebooks download ! EdholeFree ebooks download ! Edhole
Free ebooks download ! Edhole
 

Mehr von anujabeatrice2 (7)

Chapter 8 ooad
Chapter  8 ooadChapter  8 ooad
Chapter 8 ooad
 
Chapter 7 ooad
Chapter 7 ooadChapter 7 ooad
Chapter 7 ooad
 
Ooad ch 4
Ooad ch 4Ooad ch 4
Ooad ch 4
 
Ooad ch 3
Ooad ch 3Ooad ch 3
Ooad ch 3
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
 
Ooad ch 6
Ooad ch 6Ooad ch 6
Ooad ch 6
 

Kürzlich hochgeladen

Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 

Kürzlich hochgeladen (20)

Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 

Ooad ch 5

  • 2. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2 Overview:  Events  States  Transitions and Conditions  State Diagrams  State Diagram Behavior
  • 3. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3 Events  An event is an occurrence at a point in time, such as user depresses left button or flight 123, departs from Chicago.  Events often correspond to verbs in the past tense (power turned on, alarm set)  Events are messages sent to objects.  An event is an occurrence at a point in time, such as user depresses left button to know various options. Another example Rail departs from Mysore to Bangalore.  Events corresponds to verbs in the past tense or to the onset of some condition. The time in which an event occurs is an implicit attribute of the event.
  • 4. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4 Events  One event may logically precede or follow another or the two events may be unrelated.  For example two flight can arrive at two different airports. Two events are casually unrelated are said to be concurrent , they have no effect on each other.  Events include error conditions and also normal occurrences. Example timeout events , paper jammed in printer, transaction aborted etc.,  There are several kinds of events • Change event • Signal event • Time event
  • 5. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5 Signal Event  A signal is an explicit one-way transmission of information from one object to another.  A signal event is the event of sending or receiving a signal. Here we are more concerned about the receipt of a signal, because it causes effects in the receiving object.  A signal is a message between objects while a signal event is an occurrence in time.  Every signal transmission is a unique occurrence, but we group them into signal classes and give each signal class a name to indicate common structure and behavior.
  • 6. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6 Signal Event  Every signal transmission is a unique occurrence, but we group them into signal classes and give each signal class a name to indicate common structure and behavior.  Let us consider an example Kingfisher flight 123 departs from Mysore on March 23, 2010 is an instance of signal class Flight- Departure.  Some signals are simple occurrences, but most signal classes have attributes indicating the values they convey.  The UML notation is the keyword signal in guillements(<< >>) above the signal class in the top section of a box. The second section lists the signal attributes.
  • 7. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7 Change Event  A change event is an event that is caused by the satisfaction of a Boolean expression.  Event of the expression is continually tested – whenever the expression changes from false to true , the event occurs.  The UML notation for change event is the keyword when followed by a parenthesized Boolean expression. Time Event  A time event is an event caused by the occurrence of an absolute time or the elapse of a time interval.  The UML notation for an absolute time is the keyword when followed by a parenthesized expression involving time. The notation for a time interval is the keyword after followed by a parenthesized expression that evaluates to a time duration.
  • 8. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8 States  A state is an abstraction of the values and links of an object. Set of values and links are grouped together into a state according to the gross behavior of objects.  UML notation for a state – a rounded box, containing an optional state name.  The objects in a class have finite number of possible states. Each object can only be in one state at a time. Objects pass through one or more states during their lifetime.  A state specifies the response of an object to input events. All events are ignored in a state, except those for which behavior is explicitly prescribed. For example, if a digit is dialed in state Dial tone, the phone line drops the dial tone and enters state Dialing.
  • 9. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9 Event Vs. States  Events represent points in time. State represent intervals of time. A state corresponds to the interval between two events received by an object.  Both events and states depend on the level of abstraction. A travel agent planning an itinerary would treat each segment of a journey as a single event, an air traffic control system would break each flight into many geographical legs.
  • 10. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10 Transitions and conditions  A transition is an instantaneous change from one state to another. For example, when a phone is answered , the phone line transitions from the Ringing state to the Connected state. The choice of next state depends on both the original state and the event received.  A guard condition is a Boolean expression that must be true in order for a transition to occur.  A guard condition is checked only once, at the time the event occurs and the transition fires, if the condition is true.
  • 11. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11 State diagrams  A state diagram is a graph whose nodes are states and whose directed arcs are transitions between states.  A state diagram specifies the state sequences caused by events.  The state model consists of multiple state diagrams, one state diagram for each class with important temporal behavior. Sequences.  State names must be unique within the scope of a state diagram.
  • 12. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12 One shot state diagram  The state model consists of multiple state diagrams, one state diagram for each class with important temporal behavior.  One shot state diagrams represent objects with finite lives and have initial and final states.  The initial state is entered on creation of an object, entry of the final state implies destruction of the object.
  • 13. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13 Summary of Basic State Diagram Notation  State: Drawn as rounded box containing an optional name.  Transition: Drawn as a line from the origin state to the target state.  Event: A signal event is shown as a label on a transition and may be followed by parenthesized attributes.
  • 14. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14 State diagram behavior  An effect is a reference to a behavior that is executed in response to an event.  An activity is the actual behavior that can be invoked by any number of effects.  An activity may be performed upon a transition, upon the entry to or exit from a state, or upon some other event within a state. Activities can also represent internal control operations, a program might increment an internal counter every time a particular event occurs.
  • 15. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 15 Activity effect  The notation for an activity is a slash(/) and the name (or description) of the activity, followed the event that causes it. The keyword do is reserved for indicating an ongoing activity and may not be used as an event name.
  • 16. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 16 Do-activities  A do-activity is an activity that continues for an extended time. Do-activity can only occur within a state and cannot be attached to a transition.  The notation “do /” denotes a do-activity that may be performed for all or part of the duration that an object is in a state.
  • 17. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 17 Entry and exit activity  One can bind activities to entry or to exit from a state.
  • 18. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 18 Guard Conditions  Selection tools are not, however, non-deterministic.  The transition that is followed is determined completely by where the user clicks the mouse.  We can show this by adding guard conditions to the transitions, written in brackets after the event name.  Guard conditions are boolean expressions.  They are evaluated when a press event is received, and depending which one is true at the time of the event being received, the tool will transition to either of the “Moving” or “Error” states.
  • 19. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 19 Guard Conditions