> 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/object-model.md).

# object model

## 객체 모델이란?

* 시스템을 구성하는 객체와 객체 간의 관계를 표현하는 모델
* **객체(Object), 클래스(Class), 속성(Attribute), 연산(Operation), 관계(Relationship)** 을 정의하여 시스템의 구조를 분석하고 시각적으로 표현하는 것이 핵심
* UML의 클래스 다이어그램과 유사한 개념
* 객체 간 관계를 정의하고, 시스템의 정적인 구조를 표현할 수 있다.

***

## 객체 모델(Object Model)의 주요 요소

* 객체지향 개념을 기반으로 클래스, 속성, 연산, 관계를 정의한다.

| 요소                    | 설명                         |
| --------------------- | -------------------------- |
| 객체(Object)            | 시스템에서 다루는 실제 데이터 (실세계의 개체) |
| 클래스(Class)            | 공통 속성과 연산을 가진 객체들의 집합      |
| 속성(Attribute)         | 객체가 가지는 데이터 (변수)           |
| 연산(Operation, Method) | 객체가 수행하는 기능 (메서드)          |
| 관계(Relationship)      | 객체 간의 연결 (연관, 상속, 포함)      |

***

## 객체(Object)와 클래스(Class)

* 객체는 실세계의 개체를 표현하는 단위
* 비슷한 객체를 묶어서 클래스라는 개념을 사용해 정리할 수 있다.

```
객체 (Object) - 실제 데이터  
==========================
학생1 → 이름: 홍길동, 학번: 101, 전공: 컴퓨터공학  
학생2 → 이름: 김철수, 학번: 102, 전공: 전자공학  

클래스 (Class) - 공통 속성과 기능을 가진 객체 그룹  
==========================
클래스명: Student (학생)  
- 속성: 학번, 이름, 전공  
- 연산(메서드): 등록(), 수강신청(), 졸업()
```

* 객체는 클래스의 인스턴스(Instance)이며, 속성(데이터)과 연산(기능)을 가진다.
* 객체 모델 UML 표현 (클래스 다이어그램 형태)

```
+----------------+
|   Student      |
+----------------+
| - studentID    |
| - name         |
| - major        |
+----------------+
| + enroll()     |
| + graduate()   |
+----------------+
```

***

## 속성(Attribute)과 연산(Operation)

* 객체는 속성(Attribute)과 연산(Operations, Methods)을 가질 수 있다.

| 개념            | 설명                | 예제                     |
| ------------- | ----------------- | ---------------------- |
| 속성(Attribute) | 객체가 가지는 데이터 (변수)  | studentID, name, major |
| 연산(Operation) | 객체가 수행하는 기능 (메서드) | enroll(), graduate()   |

* 속성은 객체의 상태(state)를 나타내고, 연산은 객체가 수행하는 기능을 정의한다.

***

## 객체 간 관계(Relationships)

* 객체 모델에서는 객체 간의 관계(Relationship)를 정의하는 것이 중요하다.
* 객체 간 관계의 종류

| 관계                        | 설명                  | UML 기호 |
| ------------------------- | ------------------- | ------ |
| 연관(Association)           | 두 개의 객체가 서로 연결됨     | ───    |
| 집합(Aggregation, 포함 관계)    | 부분-전체 관계 (약한 결합)    | ◇──    |
| 합성(Composition, 강한 포함 관계) | 부분이 전체에 종속됨 (강한 결합) | ◆──    |
| 일반화(Generalization, 상속)   | 객체가 부모 클래스를 상속받음    | △──    |

***

## 객체 모델을 활용한 시스템 설계

{% stepper %}
{% step %}

### 객체 식별

* 시스템에서 필요한 객체(클래스)를 정의
  {% endstep %}

{% step %}

### 속성과 연산 정의

* 각 객체가 가져야 할 데이터(속성)와 수행해야 할 기능(연산) 정의
  {% endstep %}

{% step %}

### 객체 간 관계 정의

* 객체 간의 연관, 상속, 집합 관계를 정의
  {% endstep %}

{% step %}

### UML 클래스 다이어그램으로 표현

* 객체 모델을 다이어그램으로 작성하여 시스템을 시각적으로 표현
  {% endstep %}
  {% endstepper %}

***

## 객체 모델의 장점

* 시스템 구조를 직관적으로 표현할 수 있다.
* 재사용성 증가
* 설계와 구현의 일관성 유지
* 변경에 유연한 설계 가능


---

# 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/object-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.
