[SWAD] Ep. 10 OOD(5)

GLICO·2024년 10월 25일

SWAD

목록 보기
10/12

Contents

  • Combined Fragments in Sequence Diagram
  • Branches and Loops
  • Order and Concurrency
  • Other Stuff

Combined Fragment

Combined Fragments in Sequence Diagram

  • 시퀀스 다이어그램의 요소를 그룹화 하고 조건에 따른 실행 흐름을 시각화하기 위해 사용

Predefined types of operators

Branches and Loops

Alternative Interation

Usage of alt fragment

  • 조건에 따라 다른 흐름을 표현해야 할 때 사용

Guard condition

  • Square brackets []으로 표시
    ([else]는 predefined 됨)

Usage of opt fragment

  • 조건이 성립할 때만 수행
    Else가 없는 If statement와 유사 (하나의 operand만 존재)

Usage of loop fragment

  • 반복적으로 수행되는 sequence를 표현
  • Usage: loop (min, max) of (min..max)
  • Guard condition : Guard가 false가 될 때 loop가 종료

Usage of break fragment

  • 예외처리와 비슷함
    Guard condition 명시 해주어야 함

  • Guard가 True라면...(= 예외가 발생한다)
    Break안의 operand가 수행 됨

    break 실행 시, b-> c -> e 순으로 실행 됨

Order and Concurrency

Weak Order of Sequences

Usage of seq fragment

  • Operands간의 weak sequence를 나타낼 때 사용
  • Weak sequence?
    다른 lifeline에서의 메시지들의 순서는 자유로우나, 하나의 lifeline에서의 메시지들의 경우 순서는 시간 축을 따름

seq fragment with mulitple operands

  • Operand 내에서 이벤트들은 그 순서를 유지함
  • 서로 다른 생명선(lifeline)에서 작동하고 동일한 operand 내에서 발생하지 않는 이벤트들은 어느 순서로든 발생

Usage of strict fragment

  • 서로 다른 operand간 수선도 엄격히 제약하고자 할 때 사용

    Operand 내부는 기본적으로 seq임.

Usage of par fragment

  • 서로 다른 operand의 동시 수행 (concurrency)를 표현할 때 사용
    Operand내의 순서는 유지되나, 서로 다른 operand내의 순서는 상관 없음

Atomic Interaction

Usage of critical fragment

  • Critical region (atomic area)을 나타낸 것으로, 해당 영역 내에 있는 메시지들 사이에 region 밖의 다른 메시지들이 껴들 수 없음
    아래 두 operand들은 병렬적으로 수행되나, c->d사이에 다른 메시지가 껴들 수 없다.

Ohter stuffs

Interaction Reference

Usage of ref fragment

  • ref fragment를 통해 다른 sequence diagram을 가리키게 할 수 있다.

Usage of time constraints

  • 메시지 전송, 수신 기간, duration 등의 제약을 표기할 수 있음

Recap.

Combined Fragments in Sequence diagram

  • 시퀀스 다이어그램에서 요소를 그룹화 하고 조건에 따른 실행 흐름을 시각화하기 위해 사용
  • Branches and loops
    alt, opt, loop, break
  • Order and Concurrency
    seq, strict, par, critical
  • Other stuff
    Interaction reference, Iteration over a collection, Time constraints
profile
Its me Glico

0개의 댓글