19
상태전이도면 (State Transition Diagram) 시스템분석 및 설계 (Systems Analysis & Design) 10주차

상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

상태전이도면(State Transition Diagram)

시스템분석 및 설계(Systems Analysis & Design)

10주차

Page 2: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

목차

♥ 상태전이도(State Machine Diagram)♥ 도면 기호(Diagram Symbols)♥ 도면 유형

♦ 복합 상태(Composite States)♦ 동시 경로(Concurrent Paths)♦ 자기복귀 전이(Self-transition)♦ 선택 유사상태 (Choice Pseudo-state)♦ 결합 유사상태 (Junction Pseudo-state)

♥ 도면 예제

Page 3: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

State Transition Diagram

♥ 상태전이도♦ UML에서는 State machine diagram 이라고 부름

♦ 개체의 일생을 상태(state)와 전이(transitions)로 보여주는 도면

♥ 상태(State)♦ 상태를 바꾸는 사건이 일어나기를 기다리고 있는 상태

♦ A condition during an object’s life when it satisfies some criterion, performs some action, or waits for an event

♥ 전이(Transition)♦ 개체가 한 상태에서 다른 상태로 변화하는 중간 과도기

♦ The movement of an object from one state to another state♥ 격발(Trigger)

♦ 전이를 시작시키는 원인이 되는 신호 또는 사건♦ the cause of the transition

Page 4: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

State Transition Diagram

♥ 유사 상태(Pseudo state)♦ 단지 도면을 그리기 위해 표시하는 상태

♦ The starting point of a state machine diagram (black dot)♥ 시점 상태(Origin state)

♦ 전이가 시작되기 전 상태

♦ The original state of an object before transition♥ 종점 상태(Destination state)

♦ 전이가 끝난 후의 상태

♦ The state to which the object moves after the transition♥ 안전장치 해제조건(Guard condition)

♦ 조건이 충족되어야 격발로 인해 전이가 시작되는 조건

♦ A true false test to see whether a transition can fire♥ 행동(Action Expression)

♦ 전이가 일어나고 있는 중에 기술시스템이 수행하는 활동

♦ A description of activities performed as part of a transition

Page 5: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

State Transition Diagram Symbols

♥ state ♦ a round-cornered rectangle with the name of the state written

inside it♥ Initial pseudo-state

♦ 도면에서 모든 상태의 시작을 나타내는 유사 상태♦ a filled black circle♦ Label을 가질 수 있다

♥ Final pseudo-state♦ 도면에서 모든 상태의 종료를 나타내는 유사 상태♦ a circle with a dot♦ Label을 가질 수 있다

♥ Transitions♦ lines with arrowheads♦ may have a trigger, a guard and an action-expression

Idle

Trigger[guard]/action-expression

Page 6: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example: Printer

♥ First draft 상태전이도면

OffonButtonPushed [Safety cover closed] / run self-test

on

offButtonPushed [no printing going-on]

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 7: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example: Printer♥ 복합 상태(Composite States)

♦ State containing other STD♦ 프린터가 ‘켜져 있는 상태’를 다시 ‘인쇄 중’ 인지 ‘아닌지’ 구분할 때

Printer can be On and either Idle or Working

OffonButtonPushed [Safety cover closed] / run self-test

On

offButtonPushed [no printing going-on]

On

Idleprint(document)

Printing

[finished]

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 8: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example: Printer♥ 동시 경로(Concurrent Paths )

♦ Multiple paths in composite state♦ Printer On paths are independent♦ Add paper tray status

OffonButtonPushed()

offButtonPushed()

On

Idleprint(document)

Printing

[finished]

Emptyfill()

Low

trayEmpty()

FulllowMsg()

fill()

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 9: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example: Printer♥ 동시 경로(Concurrent Paths )

♦ Add printer ink status

OffonButtonPushed()

offButtonPushed()

On

Idleprint(document)

Printing

[finished]

Emptyfill()

Paper Low

trayEmpty()

Paper FulllowMsg()

fill()

Emptyfill()

Ink Low

inkEmpty()

Ink FulllowMsg()

fill()

Page 10: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example: Order♥ Self-Transition

♦ a transition that returns to itself♦ most useful when an action-expression is associated with the

transition♦ 판매원이 동일 고객으로부터 여러 종류의 상품들을 주문받고

있을 때

Open for another itemstartSale()

addItem()

http://www.sparxsystems.com.au/resources/uml2_tutorial/uml2_statediagram.html

Page 11: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example:♥ Choice Pseudo-State

♦ a diamond with one transition arriving and two or more transitions leaving

Selecting Message Format

CreatingVoice Message

CreatingSMS Message

CreatingFax Message

[Voice]

[SMS]

[Fax]

http://www.sparxsystems.com.au/resources/uml2_tutorial/uml2_statediagram.html

Page 12: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Example:♥ Junction Pseudo-State

♦ chain together multiple transitions

ReceivingVoice Message

ReceivingSMS Message

ReceivingFax Message

[Reply=voice] [Reply=SMS] [Reply=fax]

CreatingVoice Message

CreatingSMS Message

CreatingFax Message

http://www.sparxsystems.com.au/resources/uml2_tutorial/uml2_statediagram.html

Page 13: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Steps for Developing STD

♥ Select classes that might require STD

♥ For each class, make a list of status conditions (states)

♥ Begin building diagram fragments by identifying transitions

that cause an object to leave the identified state

♥ Sequence these states in the correct order and aggregate

combinations into larger fragments

♥ Review paths and look for independent, concurrent paths

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 14: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Steps for Developing STD

♥ Look for additional transitions and test both directions

♥ Expand each transition with appropriate message event,

guard condition, and action expression

♥ Review and test the state machine diagram for the class♦ Make sure state are really state for the object in the class♦ Follow the life cycle of an object coming into existence and being

deleted♦ Be sure the diagram covers all exception condition♦ Look again for concurrent paths and composite states

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 15: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Sample: OrderItem Object

♥ First draft

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 16: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Sample: OrderItem Object

♥ Final STD♦ addItem() and archive() transitions added♦ markBackOrdered() transition added

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 17: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Sample: Order Object

♥ First draft

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 18: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Sample: Order Object♥ Final STD

Source: Introduction to Systems Analysis and Design, 6th Edition

Page 19: 상태전이도면 (State Transition Diagram)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · State Transition Diagram ♥상태전이도 ♦UML에서는State

Extending & Integrating Requirements Models♥ Use cases

♦ Use case diagram♣ Use case description♣ Activity diagram♣ System sequence diagram (SSD)

♥ Domain Classes ♦ Domain model class diagram

♣ State machine diagram

Source: Introduction to Systems Analysis and Design, 6th Edition