# 애플리케이션 아키텍처

## 계층형 구조

![](/files/-Ma3SYreCDzs-jzy683m)

* controller, web
  * 웹 계층
* service
  * 비즈니스 로직, 트랜잭션 처리
* repository
  * JPA를 직접 사용하는 계층
  * EntityManager 사용
* domain
  * Entity가 모여있는 계층
  * 모든 계층에서 사용

controller도 repository에 직접 접근할 수 있되 방향은 단방향으로 흐르도록 작업할 예정이다.

## 패키지 구조

* jpabook.jpashop
  * domain
  * exception
  * repository
  * service
  * web

## 개발 순서

1. service, repository 계층을 개발
2. 테스트 케이스 작성 및 검증
3. 웹 계층 개발


---

# Agent Instructions: 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:

```
GET https://dodeon.gitbook.io/study/kimyounghan-spring-boot-and-jpa-development/03-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
