Presentation Layer
Business Layer(Service Layer)
Data Access Layer(Repository Layer)
DTO (Data Transfer Object)
Model
DAO (Data Access Object)
Client에서 요청(request)이 들어오면 먼저 Presentation Layer에서 DispatcherServlet이 HandelerMapping(적합한 Controller을 선택함)을 통해 Controller에게 Client요청을 해석하여 무엇인지 알리고, Controller은 Client 요청 처리를 Business Layer 에게 요구한다.
Business Layer은 Presentation Layer와 Interface를 통해서 통신하며, Client 요청을 적절하게 처리한 후 데이터베이스에 데이터를 저장(save)하거나 데이터를 꺼내(select)기 위해 Data Access Layer을 요청한다. 이때 비지니스 로직을 수행하기 위해 데이터가 필요하면 Domain Object에서 가져오고 Data Access Layer로 넘겨줄 데이터가 있으면 Domain Object에 담아 전달한다.
Data Access Layer은 Business Layer와 Interface를 통해서 통신하며 Business Layer의 요청(request)를 처리한다. 이때, 데이터베이스에 저장하기 위해 필요한 데이터를 Domain Object에서 가져오고, 데이터베이스에서 데이터를 가져와 반환할 데이터가 있다면 Domain Objecct에 저장하여 반환한다.
모든 처리가 끝나면 Controller는 Client 요청(request)이 처리된 데이터와 사용할 View정보를 Domain Object에서 가져와서 ModelAndView에 담는다. 그리고 나서 ModelAndView객체를 DispatcherServlet에 넘긴다.
ModelAndView 객체가 DispatcherServlet에 전달되면, DispatcherServlet은 ViewResolver를 통해서 View를 선택하고 Client에게 요청(request)이 처리된 데이터를 화면에 출력한다.
⁕Domain Object
참고 사이트 : https://rypro.tistory.com/216, https://velog.io/@gayeong39/SPRING-레이어드-아키텍처