> For the complete documentation index, see [llms.txt](https://leehyokyun.gitbook.io/openbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://leehyokyun.gitbook.io/openbook/2-11.-clean-architecture.md).

# 2-11. Clean Architecture

아키텍칭을 통한 간편한 유지 관리, Clean Architecture에 대하여

### 1. Clean Architecture의 핵심 원칙

Clean Architecture의 핵심은 의존성의 단방향, 의존성 방향의 일관화이다.

* 의존성 방향의 분리: 클린 아키텍처의 핵심은 인접해있어도, 의존성의 방향만 관심이 있고 내부 동작에는 관심이 없다는 점이다.
* Client 측의 역할: Client 측에서는 Usecase를 실행하기 위한 서비스 호출만 하면 된다.
* Usecase 측의 역할: 비즈니스 로직을 구성하는 Usecase 측에서는 비즈니스 규칙에 따른 적절한 Service와 Layer 접근이 중요하다.

### 2. 각 Layer별 역할 및 기술 명세

비즈니스 흐름과 접근은 Layer 기반, 비즈니스 호출 및 구현은 Functional과 Domain 기반으로 책임을 분리한다.

* Domain Layer: Business Service를 위한 영역이며 비즈니스 규칙을 적용한다.
* Application Layer: Application Service를 위한 영역이며 Usecase를 구현한다.
* Adaptor Layer: 외부와 내부의 결합을 중재하는 아키텍처 컴포넌트 역할을 담당한다.
* InfraStructure Layer: Networking 및 Outer System을 위한 영역이며 외부 라이브러리를 사용한 Data Access를 처리한다.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://leehyokyun.gitbook.io/openbook/2-11.-clean-architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
