Post on 04-Nov-2020
상태전이도면(State Transition Diagram)
시스템분석 및 설계(Systems Analysis & Design)
10주차
목차
♥ 상태전이도(State Machine Diagram)♥ 도면 기호(Diagram Symbols)♥ 도면 유형
♦ 복합 상태(Composite States)♦ 동시 경로(Concurrent Paths)♦ 자기복귀 전이(Self-transition)♦ 선택 유사상태 (Choice Pseudo-state)♦ 결합 유사상태 (Junction Pseudo-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
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
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
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
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
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
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()
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
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
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
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
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
Sample: OrderItem Object
♥ First draft
Source: Introduction to Systems Analysis and Design, 6th Edition
Sample: OrderItem Object
♥ Final STD♦ addItem() and archive() transitions added♦ markBackOrdered() transition added
Source: Introduction to Systems Analysis and Design, 6th Edition
Sample: Order Object
♥ First draft
Source: Introduction to Systems Analysis and Design, 6th Edition
Sample: Order Object♥ Final STD
Source: Introduction to Systems Analysis and Design, 6th Edition
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