Spring
-
Spring 구조2Java 2023. 10. 17. 09:48
용어 정리 DAO ( Data Access Object ) DB에 접근하기 위한 객체 DB에 접근하기 위한 로직과 비즈니스 로직을 분리하기 위해 사용 DTO ( Data Transfer Object) 계층 간 데이터 교환을 하기 위한 객체 로직을 갖지 않고 Getter, Setter만 존재 Spring Web Layer Web Layer 컨트롤러(@Controller)가 대표적이고 필터(@filter), 인터셉터 등 포함 외부 요청과 응답에 대한 전반적인 영역을 의미 Service Layer 말 그대로 서비스(@Service) 일반적으로 컨트롤러와 저장소(Repository, Dao) 중간에 위치 트랜잭션(@Transaction)과 도메인 간의 연산 순서를 보장해 줌 Repository Layer DB와..
-
Spring 구조1Java 2023. 10. 17. 07:57
MVC 패턴 MVC는 프로젝트를 구성할 때 Model, View, Controller의 역할로 구분함 Model 애플리케이션의 정보, 데이터 나타냄 DB, 변수, 상수 등을 의미 이러한 데이터를 파싱하거나 DB와의 통신 또한 책임지는 컴포넌트 (비즈니스 로직) 규칙 사용자가 다루길 원하는 모든 데이터를 가지고 있어야 함 View나 Controller에 대해서 어떤 정보도 알면 안 됨 변경이 일어나면 변경 통지에 대한 처리 방법 구현 View 사용자가 보는 화면 input, 체크박스, 라디오 버튼 같은 사용자 인터페이스 요소 의미 데이터를 기반으로 사용자들이 볼 수 있는 화면 규칙 Model이 가지고 있는 정보를 따로 저장하면 안 됨 Model이나 Controller에 대해서 알면 안 됨 변경이 일어나면 ..