UML Review: State Machines. Sept. 17, 2003Lecture 5: CS660 Fall 20032 Overview States Transitions Activities Modeling object lifeline Creating well-structured.

Slides:



Advertisements
Similar presentations
NCKU EE RTES LAB.1 Unified Modeling Language - Events and State Machines.
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.
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
© 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.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
SE 555 Software Requirements & Specification 1 Activity Diagrams.
Introduction to UML Visual modeling Models and its importance
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
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.
Common Mechanisms in UML
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.
Department of Computer Science 1 CSS 496 Business Process Re-engineering for BS(CS)
Department of Computer Science 1 CSS 496 Business Process Re-engineering for BS(CS)
SEG4110 – Advanced Software Design and Reengineering
Chapter 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Introduction to the Unified Modeling Language “The act of drawing a diagram does not constitute analysis or design. … Still, having a well-defined and.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Guide to State Transition Diagram. 2 Contents  What is state transition diagram?  When is state transition diagram used?  What are state transition.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
Uml is made similar by the presence of four common mechanisms that apply consistently throughout the language. After constructing or developing the architecture.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
1 Interaction diagrams and activity diagrams Speaker: 陳 奕 全 Real-time and Embedded System Lab 15 August 2002.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Software Engineering Design & Modeling Statechart Diagram.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Modelling Class T07 Conceptual Modelling – Behaviour References: –Conceptual Modeling of Information Systems (Chapters 11, 12, 13 and 14)
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
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.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
Test Generation from UML Specifications Michael A. Gray American University Washington, DC.
UML (Unified Modeling Language)
Systems Analysis and Design in a Changing World, Fourth Edition
UML Chapter 17.
UML Diagrams By Daniel Damaris Novarianto S..
State Machine Diagrams
Course Outcomes of Object Oriented Modeling Design (17630,C604)
COMPONENT & DEPLOYMENT DIAGRAMS
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Unified Modeling Language
Activity and State Transition Diagram
UML Diagrams Jung Woo.
State Machine Diagrams
Business System Development
Interactions.
CSC 422 Kutztown University Dr. Spiegel
UML Activity Diagrams & State Charts
States.
Object Oriented System Design
CIS 375 Bruce R. Maxim UM-Dearborn
States.
CIS 375 Bruce R. Maxim UM-Dearborn
UML State Diagrams.
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

UML Review: State Machines

Sept. 17, 2003Lecture 5: CS660 Fall Overview States Transitions Activities Modeling object lifeline Creating well-structured algorithms

Sept. 17, 2003Lecture 5: CS660 Fall Thermostat Example

Sept. 17, 2003Lecture 5: CS660 Fall Terms & Concepts State machine--behavior that specifies –the sequences of states an object goes through during its lifetime, and –the events and transitions between those states, and –responses to the events. State--condition or situation during the life of an object during which it satisfies some condition, performs some activity, or waits for some event.

Sept. 17, 2003Lecture 5: CS660 Fall Terms & Concepts (cont.) Event--specification of a significant occurrence that has a location in time and space. Transition--relationship between two states indicating that an object in the first state will perform certain actions and enter the second state upon occurrence of a specified event.

Sept. 17, 2003Lecture 5: CS660 Fall Terms & Concepts (cont.) Activity--ongoing non-atomic execution within a state machine. Action--executable atomic computation that results in a change in state of the model or the return of a value.

Sept. 17, 2003Lecture 5: CS660 Fall States State parts: –Name--distinguishing textual string; note: some states may be anonymous –Entry/exit actions--action executed on traversing a transition. –Internal transitions--no change in state. –Substates--nested structure of states –Deferred events--events not handled by a state, but are queued for later processing.

Sept. 17, 2003Lecture 5: CS660 Fall State Depicted in UML Rectangle with rounded corners. Initial state is filled black circle. Final state is an unfilled circle containing a filled black circle.

Sept. 17, 2003Lecture 5: CS660 Fall Transitions Transition parts: –Source state--the active state preceding the transition; it is affected by the transition. –Event trigger--event received by the source that causes the transition to “fire”. –Guard--boolean expression which must be true before the transition can fire. –Action--atomic computation that occurs during the transition. –Target state--the active state following the transition.

Sept. 17, 2003Lecture 5: CS660 Fall Transitions Depicted in UML

Sept. 17, 2003Lecture 5: CS660 Fall Advanced States Entry & exit actions--actions that always occur upon entry into or exit away from a state regardless of transition. Internal Transitions--triggered by events but don’t change state. Activities--ongoing behavior which continues until interrupted. Deferred events--events ignored by the current state, but postponed for later processing.

Sept. 17, 2003Lecture 5: CS660 Fall Advanced States (cont.)

Sept. 17, 2003Lecture 5: CS660 Fall Substates Substate--state nested inside of another state. Sequential substates History states Concurrent substates

Sept. 17, 2003Lecture 5: CS660 Fall Modelling Object Lifetime Set the context for the state machine: class, use case, or whole system. –Collect neighboring classes with any relationship; these are potential targets for actions and candidates for guards. –For an entire system, focus on one behavior of the system. Identify the initial and final states; define pre- and post-conditions

Sept. 17, 2003Lecture 5: CS660 Fall Modeling Object Lifetime (cont.) Decide on events to which the element will respond. Layout the top-level states and connect with appropriate transitions. Identify entry/exit actions. Expand states as necessary (identify substates)

Sept. 17, 2003Lecture 5: CS660 Fall UML is not Enough UML can represent many features But UML still cannot represent something –To model a network, how to represent routers & hubs. –How to keep track of the version number of a subsystem. –How to represent some constraints in a system.

Sept. 17, 2003Lecture 5: CS660 Fall UML Extension Mechanism Adornments –Notes Extensibility mechanisms –Stereotypes –Tagged values –Constraints Modeling Techniques Extending UML

Sept. 17, 2003Lecture 5: CS660 Fall Notes Notes—graphical symbol for rendering constraints or comments attached to an element or collection of elements. Representing the meaning of the model. Specify things like –Requirements –Observations –Reviews –Explanations –Constraints Rendered as a rectangle with a dog-eared corner.

Sept. 17, 2003Lecture 5: CS660 Fall Notes (cont.) May contain combination of text and graphics. May contain URLs linking to external documents. See for related information. See encrypt.doc for details about this algorithm.

Sept. 17, 2003Lecture 5: CS660 Fall Stereotypes Stereotype—extension of the UML vocabulary. Metatype Allows for new building blocks. Graphically rendered as –Name enclosed in guillemets > «stereotype» –New icon «metaclass» ModelElement Internet

Sept. 17, 2003Lecture 5: CS660 Fall Tagged Values Tagged value—extension of the properties of a UML element. Metadata—data applies to the element; not to instances of the element. Rendered as a text string enclosed in braces { } Placed below the name of another element. Properties; name/value pairs {name=value} > Billing {version=3.2}

Sept. 17, 2003Lecture 5: CS660 Fall Constraints Constraint—extension of the semantics of a UML element. Allows new or modified rules. –Conditions that must hold true. Rendered in braces {}. –Free-form text. –UML’s Object Constraint Language (OCL). –Can be contained in note.

Sept. 17, 2003Lecture 5: CS660 Fall Modeling Comments Place as text in note next to related element. Connect notes using dependencies if necessary. Hide or show as appropriate; Place lengthy comments in external files linked to the diagram through a note. Keep comments that record decisions. Keep historic comments.

Sept. 17, 2003Lecture 5: CS660 Fall Modeling New Building Blocks First attempt to use basic UML. Identify a basic UML component that closely approaches the new concept and define a stereotype. Specify properties and semantics using tagged values and constraints. For a distinctive visual cue, define a new icon.