전공/소프트웨어공학

sequence diagram

nongdamgom 2024. 4. 17. 00:56

class diagram 이 전반적인 표현이라면, interaction diagram은 특정 상황에서의 디테일을 표현한다.

 

Sequence diagram

  • two = dimensional diagram
  • 가로로는 interaction parter들 과의 interaction
  • 세로로는 time

 

Exchanging Messages

  • continuous bar

Messages

  • synchronous message : 채워진 화살표
  • asynchronous message : 걍 화살표
  • response message : 점선 화살표(보통 생략)
  • object creation = > 점선 화살표 사용, keyword => new, 생성자 부르기 => create()
  • object destruction : 없앨 때 lifeline에  x 표시
  • found message : 동그라미에 걍화살표 => 누가보냈는지 알바 아님
  • lost message : 화살표에 동그라미 => 누구한테 보냈는지 알바 아님
  • timing consuming message : 보내고-받는데 걸리는 시간이 중요할 때 사용 약간 사선으로

 

Sequence diagram frames

  • 오각형, sd interactionIdentifier 표시
  • interactionIdentifier : class diagram의 simple name이나 operation
  • self : 자기자신 
  • attribute는 note로 달거나, 아니면 아래에 작성

 

combined fragment

  • sequence diagram이 많아질 때, sd frame을 두고 그 안에서 여러 variation 형성
  •  

Branches & loop
  • alt : switch 문 같이 조건 하나씩 걸고 맞는 operand 안으로 들어가서 실행 (operand 여러개 가능)
  • opt : if만 있음 ( operand 딱 하나만 가짐)
  • loop : loop(min,max) => 빠져나가는 guard 조건이 있어도, min 만큼은 무조건 돌고, guard 체크 (opearnd 딱 1개만)
  • break : break 문이 실행되면, 바로 상위 단계 fragment를 무시함, 예외처리에 사용

 

 

concurrency & order
  • seq : operand 내의 interaction 간의 default 순서 : lifeline 공유 => 순서대로, 아니면 => 아무순서나
  • strict : operand 간의 순서 => 무조건 위 operand 먼저 =>  operand 내에서는 seq를 따름
  • par : opearand 간의 순서 없음.  => operand 내에서는 seq를 따름 => lifeline을 다른 operand에서 공유해도.. 어떤 operand가 먼저 오게 될 지 모르니까.. operand 내의 순서만 지켜지면, 어디서 어떻게 끼어들든 상관 ㄴㄴ
  • cirtical : atomic area, opearand 내부 순서에 다른거 못끼어듦 => 안에서는 seq로 (operand 딱 하나만)
filters & assertion
  • ignore : 무시해도 되는 메세지 알려줌 => opeand 딱 하나만
  • consider : 중요한 메세지를 알려줌 => operand 딱 하나만
  • assert : 내부의 시나리오 이외의 시나리오는 적합하지 않다고 판단 => operand 딱 하나만
  • neg : 내부의 시나리오는 절대 일어나면 안됨 => operand 딱 하나만.

 

Time constraints

  • event 발생한 시간 체크 => 언제, 얼만큼 동안 발생해야 하는지 제한

State Invariant

  • 특정 상황 이후에서만 event가 발생하게 assert
  • 타원 똥글뱅이 혹은 comment

 

 

Interaction diagram

  • sequence diagram
  • communication diagram => seq과 표기법만 다르고 내용은 같음 => 누가, 누구와 < 여기에 더 집중
  • Timing diagram => seq 눕힌거 
  • Interaction overview diagram => activity + sequence : 전체 플로우 보여주면서, 특정 디테일