Object Oriented System Design

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
5/24/2015CPSC , CPSC , Lecture 71 Software Engineering, CPSC , CPSC , Lecture 7.
Software engineering Methods Software Engineering Methods State Diagrams Zvi Avidor Written By With additions by Zvika Gutterman and Adam Carmi.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
State Change Modelling. Aim: To introduce the concept and techniques for describing the changes in state that may occur to an object in its lifetime.
Advanced Behavioral Modeling
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
CS451 Introduction to Software Engineering Behavioral Modeling.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
State Modeling.
1 Software Engineering Dr. K. T. Tsang Lecture 8 State modeling
Behavioral diagrams Lecture p4 T120B pavasario sem.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
CSIS3600 System Analysis and Design Statechart Diagrams.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 1 object states an object state is a condition or situation during the life.
Information System Design IT60105
Software Engineering Design & Modeling Statechart Diagram.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
State Chart diagram Week objective Describe State chart Diagrams in Dynamic Modelling 2.
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 6: Restaurant.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
Design Review.
Appendix 3 Object-Oriented Analysis and Design
Case Study -- Weather system
State Machine Model.
State Machine Diagram.
State Machine Diagrams
State Machine Diagrams
UML State Diagrams.
CS251 – Software Engineering Lectures 11 State Diagrams
Business System Development
Object Oriented System Design COS 50-3
CSC 422 Kutztown University Dr. Spiegel
Object Oriented Design Model
UML State machine diagram
States.
Chapter 5 state Modeling
States.
Object Oriented System Design Class Diagrams
Information Systems Engineering
UML State Diagrams.
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
Object Oriented System Design Responsibilities
Presentation transcript:

Object Oriented System Design Marc Conrad D104 (Park Square Building) Email: Marc.Conrad@luton.ac.uk This week: State Diagrams 22/11/2018 08:58:07 Marc Conrad - University of Luton

Static Models and Dynamic Models Class diagrams model the static behaviour of objects, i.e. Attributes of objects Operation of objects Relationships between objects. Statechart diagrams model the dynamic behaviour of objects. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Statechart diagrams State diagrams illustrate the dynamical behaviour of an object. State diagrams are about events and transitions. Events trigger a state change. Transitions show the change from one state to another. See google (images, statechart) for real-life examples. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton States (definition) A state is a condition in which an object can be at some point during its lifetime, for some finite amount of time. An object can perform an activity wait for an event 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example of a state Typing Password entry/ set echo invisible exit/ set echo visible do/ handle characters event request help/ display help The UML notation for a state is a rectangle with rounded corners. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example of a state Typing Password entry/ set echo invisible exit/ set echo visible do/ handle characters event request help/ display help The name of the state. Each state must have a different name. Nameless states are also allowed and are considered as being different. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example of a state Typing Password entry/ set echo invisible exit/ set echo visible do/ handle characters event request help/ display help An action which is performed when the state is entered. entry/ is a keyword in states 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example of a state Typing Password entry/ set echo invisible exit/ set echo visible do/ handle characters event request help/ display help An action which is performed on exit from the state. exit/ is a keyword in states 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example of a state Typing Password entry/ set echo invisible exit/ set echo visible do/ handle characters event request help/ display help An action which is performed while the machine is in this state. do/ is a keyword. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example of a state Typing Password entry/ set echo invisible exit/ set echo visible do/ handle characters event request help/ display help An event which triggers an internal transition. The object is not leaving its state while the event is dealt with. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Transitions A transition is a change of an object from one state (the source state) to another (the target state). A transition is triggered when an event of interest of the given object occurs. Alternatively, a transition may be executed unconditionally when the activity associated with the source state is complete (triggerless transition) . 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Transitions Printing press button entry/ print Transition triggered by the press button event. Triggerless transition (executed when the receipt is printed) 22/11/2018 08:58:07 Marc Conrad - University of Luton

Transitions and Actions There may be an action associated with a triggered transition. This action executes before the object enters the target state. Action 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Self-transition A self-transition is a transition whose source state and target state are the same. Note that entry and exit actions are executed at a self-transition. Example: redraw is executed each time at backup. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example: not a self-transition redraw is not executed when the backup is made. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Guard conditions A guard condition is a condition which must be true before a given transition is triggered. Notation of event with guard: eventName[guard condition] Event, guard, and action: eventName[guard condition]/action Guard only: [guard condition] 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example for a guard condition Transition is triggered only when password is correct. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example for an eventless guard condition Guard condition with self transition. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Transition (Summary) Logical condition Event [Guard]/Action Transition -- Trigger event that causes the execution of the action. Action whose execution makes state change happen 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton What is an event? The following occurrences are considered as events in UML: A signal A call event A time event A change event 22/11/2018 08:58:07 Marc Conrad - University of Luton

What is an event? SignalEvent A signal An asynchoronous communication between objects. A call event A time event A change event Wait for Fax Receive incoming call 22/11/2018 08:58:07 Marc Conrad - University of Luton

What is an event? Call Events A signal A call event A synchronous communication where an object sends a message to another object. A time event A change event There is no notational difference between Signal Events and Call Events in Statechart diagrams. 22/11/2018 08:58:07 Marc Conrad - University of Luton

What is an event? Time Events A signal A call event A time event An event that occurs after a specified period of time. A time event is expressed using the word “after” followed by a time expression. A change event 22/11/2018 08:58:07 Marc Conrad - University of Luton

What is an event? Change Events A signal A call event A time event A change event An event that occurs when some condition is satisfied. A change event is expressed using the keyword “when”. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton What is an action? An action is a procedural expression that is executed when the transition fires. The action must be executed entirely before any other actions are considered. It is not interruptible. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Initial state and final state There are special symbols for a state where the flow of control starts and a symbol for a final state. Final state Initial state 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton Substates A state diagram can be refined further by dividing a state into several substates. This will give much richer information about the system to be developed. Faxing Dialing Waiting Sending 22/11/2018 08:58:07 Marc Conrad - University of Luton

Substates and transitions (1) Transitions can be drawn directly to and from nested states. Idle Faxing Dialing Dialing Waiting Waiting Sending Sending 22/11/2018 08:58:07 Marc Conrad - University of Luton

Substates and transitions (2) When a transition ends in the composite state the flow continues with the initial state in the composite state. Idle Faxing Dialing Dialing Waiting Waiting Sending Sending 22/11/2018 08:58:07 Marc Conrad - University of Luton

Marc Conrad - University of Luton State Machines A statechart diagram shows an object’s state machine: The states that an object can assume during its life. The events to which that object can respond. The possible responses the object can make to those events. The transitions that occur between the object’s states. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Statechart diagrams and state machines Semantics A state machine is a graph of states and transitions that describes the response of an object of a given class to the receipt of outside stimuli. A state machine is attached to a class or a method Notation A statechart diagram represents a state machine. The states are represented by state symbols and the transitions are represented by arrows connecting the state symbols. States may also contain subdiagrams by physical containment and tiling. 22/11/2018 08:58:07 Marc Conrad - University of Luton

Example: The statechart diagram of a stack pushl[ not full ] create stack Empty push pop/error Loaded pop[ empty ] pop Full push[full ] pop[ not empty ] push / error 22/11/2018 08:58:07 Marc Conrad - University of Luton

Detailed Statechart diagram for the Deposit Item Receiver object, 1st version. Add Item to Receipt basis Add Item to Process item Receipt basis / create deposit item Create Receipt basis Create Receipt basis [ further item ] / create deposit item idle Classify item in slot( i ) [ first item ] Classify item item do/ wait for user press receipt button Print Receipt Sum items Sum items print print 22/11/2018 08:58:07 Marc Conrad - University of Luton

Statechart diagram for the Deposit Item Receiver object, 2nd version Idle do/ wait for user Print Receipt Process item entry/ classify item entry/ add item receipt printed item in slot( i ) button pressed[ item inserted ] 22/11/2018 08:58:07 Marc Conrad - University of Luton