Statecharts: Modeling State-Dependent Responses to Events for Each Class, Slides of Object Oriented Programming

An overview of statecharts, their role in uml diagrams, and how they capture all possible responses of an object to use cases. It includes examples of statecharts for various classes such as course, cashcard, graderate, dropdownmenu, and garage door. Statecharts define the possible states and transitions of an object and the actions that occur when moving between states.

Typology: Slides

2011/2012

Uploaded on 07/17/2012

banani
banani 🇮🇳

4.3

(3)

91 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Specifying Control
Lecture 24
2
Overview
nHow statecharts fit with other UML diagrams?
nStates and Events
nBasic statechart notation
nSome example statecharts
3
Control and State
nDifferent UML diagrams portray different aspects of
an Information System
nClass Diagrams
nStatic Structure
nInteraction Diagrams
nThe way in which objects interact
nStatecharts
nHow the system responds to events
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Statecharts: Modeling State-Dependent Responses to Events for Each Class and more Slides Object Oriented Programming in PDF only on Docsity!

Specifying Control

Lecture 24

Overview

n How statecharts fit with other UML diagrams?

n States and Events

n Basic statechart notation

n Some example statecharts

Control and State

n Different UML diagrams portray different aspects of

an Information System

n Class Diagrams

n Static Structure

n Interaction Diagrams

n The way in which objects interact

n Statecharts

n How the system responds to events

docsity.com

Statecharts

n Model "state dependent" responses to events

n One statechart for each class

n A statechart captures all possible responses of a

single object to all the use cases in which it is

involved

n Describes the possible life cycles an object of a class

can follow

Statecharts:

One Statechart for Each Class

Example:

Statechart for Course class

Initialization Open entry: Register student exit: Increment count

Closed

Canceled

do: Initialize course

do: Finalize course

do: Notify registered students

Add Student / Set count = 0

Add student[ count < 10 ]

[ count = 10 ]

Cancel

Cancel

Cancel

teach

Possible life cycles

docsity.com

Transitions and Events

n Transition

n Movement from one state to another

n Event

n Change event: condition become true

n Call event: receives a call from another object

n Signal event: receives a signal

n Time event: caused by passage of designated period of time

or after a specific event

Basic Statechart Notation

Basic Statechart Notation

Internal Actions and Activities

docsity.com

Example

MenuVisible state for DropDownMenu

Example

Statechart for Garage Door

Example

Alternative statechart for Garage Door

docsity.com