> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/programming/software-design/architecture-and-patterns/rumbaughooa/dynamic-model.md).

# dynamic model

## 동적 모델(Dynamic Model)이란?

* 시간의 흐름에 따라 객체의 상태 변화와 객체 간의 상호작용을 표현하는 모델
* 객체가 어떤 이벤트를 받으면 상태가 어떻게 변하는지 분석하는 것이 핵심이다.

***

## 동적 모델(Dynamic Model)의 주요 개념

* 아래 요소를 활용해 객체의 변화 과정을 분석한다.

| 요소                      | 설명                     |
| ----------------------- | ---------------------- |
| 상태(State)               | 객체가 특정 시점에서 가지고 있는 정보  |
| 이벤트(Event)              | 객체의 상태를 변화시키는 외부 입력    |
| 상태 전이(State Transition) | 한 상태에서 다른 상태로 변화       |
| 상태 다이어그램(State Diagram) | 객체의 상태 변화 흐름을 시각적으로 표현 |

* 동적 모델은 UML의 상태 다이어그램과 유사한 개념
* 시스템에서 발생하는 이벤트에 따라 객체의 상태가 어떻게 변화하는지 분석하는 것이 목적

***

## 상태(State)와 이벤트(Event)

### 상태란?

* 객체가 특정 시점에서 가지는 정보(속성 값) 또는 조건을 의미한다.
* 이벤트(Event)가 발생하면 상태가 변경될 수 있다.

```
학생 미등록 → (등록 신청) → 등록 완료 → (수강 신청) → 수강 중 → (졸업) → 졸업 완료
```

* 객체 Student의 상태는 미등록 > 등록 완료 > 수강 중 > 졸업 완료 순서로 변화 가능

### 이벤트란?

* 객체의 상태를 변경시키는 외부 입력(Trigger)
* 사용자의 행동, 시스템 신호, 시간 이벤트 등이 이벤트가 될 수 있다.

{% stepper %}
{% step %}
"등록 신청 버튼 클릭" → 상태: 미등록 → 등록 완료
{% endstep %}

{% step %}
"수강 신청 완료" → 상태: 등록 완료 → 수강 중
{% endstep %}

{% step %}
"졸업 조건 충족" → 상태: 수강 중 → 졸업 완료
{% endstep %}
{% endstepper %}

* 이벤트에 따라 상태가 변화하는 것이 핵심

***

## 상태 전이(State Transition)

* 한 상태에서 다른 상태로 변화(Transition)하는 과정
* 이벤트가 발생하면 객체의 상태가 새로운 상태로 **전이(변경)** 된다.

```
강의 생성 → (학생 등록) → 강의 진행 → (수업 종료) → 강의 완료
```

***

## 상태 다이어그램(State Diagram)

* 상태 다이어그램은 객체의 상태 변화 흐름을 시각적으로 표현하는 다이어그램이다.
* 주요 구성 요소

| 요소    | 설명             | UML 기호        |
| ----- | -------------- | ------------- |
| 시작 상태 | 객체의 최초 상태      | ●             |
| 상태    | 객체가 가질 수 있는 상태 | ▭ (사각형)       |
| 이벤트   | 상태를 변경시키는 트리거  | 화살표 위에 이벤트 이름 |
| 전이    | 상태 간의 변화       | → (화살표)       |
| 종료 상태 | 객체의 최종 상태      | ◉             |

* \[상태 다이어그램에 대하여]

***

## 동적 모델의 활용 사례

| 사용 사례              | 설명                            |
| ------------------ | ----------------------------- |
| 사용자 로그인 프로세스       | 로그인 버튼 클릭 → 로그인 성공 → 메인 화면 이동 |
| 주문 상태 관리 시스템       | 주문 접수 → 결제 완료 → 배송 중 → 배송 완료  |
| ATM(현금자동입출금기) 프로세스 | 카드 삽입 → PIN 입력 → 출금 요청 → 돈 인출 |

* 각 객체의 상태 변화를 분석하여 시스템 동작을 최적화할 수 있다.

***

## 동적 모델의 장점

1. 객체의 상태 변화를 명확하게 분석 할 수 있다.
2. 실시간 시스템 분석에 유용하다.
3. 객체 모델(Object Model)과 결합하여 완벽한 시스템 설계가 가능하다.
4. UML 상태 다이어그램과 연계 가능


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/programming/software-design/architecture-and-patterns/rumbaughooa/dynamic-model.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
