State Chart Diagrams.

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 Diagram 1. State diagram: Shows the behavior of one object. They describe all of the possible states that a particular object can get into and how.
UML State Machine Diagrams and Modeling
Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
© 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.
Slide 1 Systems Analysis & Design CS183 Spring Semester Dr. Jonathan Y. Clark Course Website:
Slide 10B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
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.
Slide 1 Chapter 8 Behavioral Modeling. Slide 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports.
SE-565 Software System Requirements More UML Diagrams.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
Class, Sequence and UML Model.  Has actors and use cases.
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.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
Software Engineering 1 Object-oriented Analysis and Design Chap 29 UML State Machine Diagrams and Modeling.
NJIT Modeling Behavior in State Chart Diagrams Chapter 29 Rafael Mello.
Behavioral Modeling Chapter 8.
Session 22 Modeling the Extended Features of the Statechart Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 27, 2011 Presented.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
1 An Introduction to UML Interaction (Sequence and Communication) Diagrams Georgia State University CIS 3300 Spring, 2009.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
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.
Chapter 29 State Machine Diagrams 1CS6359 Fall 2011 John Cole.
Dynamic Models. Outline Dynamic Models Statecharts –States –Transitions –Composite states Interaction Diagrams –Sequence Diagrams The time order of interactions.
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. Events An event is an occurrence at a point in time, such as user depresses left button or.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
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.
State Machine Diagram Chapter 5 Introduction Pages
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
CompSci 280 S Introduction to Software Development
Systems Analysis and Design in a Changing World, Fourth Edition
Activity Diagram.
Chapter 5 System modeling
M301: Software Systems & their Development The Material is Prepared by: Dr. Mohamed Omran Edited, Designed, and Converted to PPT by: Yaser Al-Mtawa.
State Machine Diagram.
Dynamic Modeling of Banking System Case Study - I
Activity and State Transition Diagram
Visit for more Learning Resources
State Machine Diagrams
UML State Diagrams.
CS251 – Software Engineering Lectures 11 State Diagrams
Class Diagrams.
Business System Development
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
States.
Week 12: Activity & Sequence Diagrams
CIS 375 Bruce R. Maxim UM-Dearborn
CS310 Software Engineering Dr.Doaa Sami
States.
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
Modeling Behavior in Statechart Diagrams
UML State Diagrams (Ch. 29)
Presentation transcript:

State Chart Diagrams

UML Statechart Diagram The Statechart diagrams are one of the five diagram in the UML for modeling the dynamic aspects of systems. هو احد طرق التمثيل الخمسه التي تعرض التغير علي النظام A statechart diagram shows a state machine. flow of control from state to state. يوضح هذا النوع : حالات جهازمحدد و شكل او شرط التغير من حالة لاخرى

UML Statechart Diagram(con.) shows the different status of a class or object at different points in time يعرض الحالات المختلفة للبرنامج (class) في نقاط زمنيه مختلفة Use to illustrate aspects of a system that show interesting changes in behavior as time passes. يستخدم لتوضيح او عرض التغيرات الهامة علي النظام مع تغير الزمن

Events and States State – Is the condition of a object at a specific time. هي حالة البرنامج في لحظة زمنية محددة A telephone is on “idle” state until it is taken from the hook. مثال: الهاتف يكون في الوضع المثالي الى ان يتم رفع السماعة Event – Is an occurrence that triggered the state. هو الشرط او حدث الذي يغير من حالة النظام A telephone receiver is taken off the hook. مثال: استقبال مكالمة (يتم رفع سماعة الهاتف)

Illustrating External and Internal Events There are three types of events: هنالك ثلاثة انواع للاحداث: External Event – Events caused by an outside actor, outside of the system’s boundary. احداث خارجية: تتم بواسطة مستخدم او نظام اخر خارج حدود النظام Internal Event – Events caused by an internal action, inside the system’s boundary. احداث داخلية: تتم بواسطة مستخدم او نظام اخر داخل حدود النظام Temporal Event – Events caused by a determined date or time clock. احداث مؤقتة: تتم في تاريخ او زمن محدد

Transitions Transition – Involves going from one state to the other when an event occurs. الانتقال: هو تغير حالة النظام الى اخرى بناء على حدث معين Transitions are label in form: Event [Guard] / Action يتم تمثيلها بالشكل الحدث [الشرط]/ التصرف When the event “off hook” occurs, transition the telephone from the “idle” state to the “active” state. عندما يتحقق الشرط «استقبال مكالمة» تتغير حالة النظام من الوضع «مثالي» الى الوضع «يعمل او نشط »

Statechart Diagrams A Statechart diagram shows the lifecycle of an object state initial State event transition

Statechart Diagrams (Cont.) The state diagram on the previous slide illustrates a simple telephone state chart diagram, with states, events and transitions. المثال السابق يعرض طريقة عمل الهاتف باوضاعه المختلفه و الاحداث و الانتقال من حالة لاخرى The states are shown in round rectangles. The transitions are shown with arrows, and the events are the labels in each transition. حيث تظهر الحالة علي شكل مربع او مستطيل و يمثل الانتقال بسهم و لاحداث المختلفه تظهر على شكل نص على السهم

Concurrent State Diagrams Sometimes, it is relevant to split the path of execution to two or more state diagrams في بعض الاحيان يتم فصل شكل التنفيذ على اكتر من رسم واحد These state diagrams represent paths of execution that execute concurrently هذا النوع من الرسم يوضح انماط التنفيذ المتكررة At some point, the paths of execution will join into the original execution path في بعض الاحيان هذه الانماط المختلفة تلتقي في نقاط تنفيذ اساسية

A Gas Station Example In Service Filling Gas Tank Washing Windshield pumpGas tankFull Filling Gas Tank arrive depart beginWash endWash Washing Windshield

A Gas Station Example Filling Gas Tank Washing Windshield Divergence pumpGas tankFull Filling Gas Tank arrive depart beginWash endWash Washing Windshield Divergence Convergence

When to use Statechart Diagrams The next slide contains a list of common state- dependant objects that might be worth illustrating in a Statechart diagram: بعض انواع الانظمة التي تحتاج ان تمثل بواسطة هذا النوع :

Classes that benefit from Statechart Diagram Stateful sessions – Server-side software objects Systems – classes representing the system Windows – window’s action “Edit-Copy” Transactions – The way transaction respond to events Devices – Microwave oven, Radio

Additional Statechart Diagram Notation Additional features UML notation for statechart diagram: بعض طرق التمثيل للاضافية Transition actions Transition guard condition Nested states

Additional Statechart Diagram Notation (Cont.) Transitions are what makes an action to fire, such as a method invocation. A transition also can have a Boolean test, such as a guard, that only happens if the test succeeds. الانتقال يمكن ان يكون اختبار لشرط محدد يتم فقط عندما يتحقق هذا الشرط Nested states represents substates. The substate inherits the transitions of its superstate. في حالة التداخل هذه يتم التفرع لاكثر من حالة جزئية ، كل منها يرث نفس الشروط الانتقال للحالة الاساسية

Additional Statechart Diagram Notation (Cont.) Example of Transition action and guard notation

Statechart diagram from Sequence diagram: The dynamic model provides two diagrams that model changes over time - Sequence Diagram - Statechart Diagram The key to understanding the relationship between these diagrams is in understanding states and events المفتاح لفهم العلاقة بينهما هي بفهم الحلات و الاحداث المختلفة للنظام

Statechart diagram from Sequence diagram: A basic Sequence diagram with events and transitions: Event1 Event2 A B C

Statechart diagram from Sequence diagram: Each vertical column represents a portion of the total lifeline for one object. كل خط رأسي يمثل جزء من عملية محددة على النظام Each event directed at a lifeline represents an event that might trigger a change in that object. كل سهم او حدث يتم رسمه قد يمثل تغير علي احد مكونات النظام The space between events on the object lifeline represents a period of time when the object remains in the same state . المسافة بين الاسهم تمثل الفترة الزمنية التي يبقى بها النظام على نفس الحالة The events pointing outward from the object lifeline represent either return values sent to other objects or send events .

How we determine the states: The state of the object is defined by the values of one or more of its attributes. Use these values to find adjectives that describe the object's condition . For example, if one of the attributes indicates whether the object has been sold or not, then you might use sold and unsold as part or all of the state name.

How we determine the states: Event1 Event2 Event1/C.event2 Return2 Retuen2/return1 Return1 A B C Draft SD for object B State name1 State name2 State name3

Use case : Purchase show seat Example showseat : select select purchase cancel Use case : Purchase show seat Customer showseat Customer showseat

Example showseat (con t): select select purchase Customer showseat Price ,not held, not sold Price , held, not sold Price ,not held, sold

Example showseat (con t): select select cancel Customer showseat Price ,not held, not sold Price , held, not sold Price ,not held, not sold

Example showseat (con t): Select cancel purchase Price Held Not sold Price Not held Not sold Price Not held Sold