TeamFILL-IN / server-renew

spring base

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

구조 변경 논의

daehwan2da opened this issue · comments

고민

  • core 로 패키지별 의존을 정리할지?
    • interface 로 행위를 추상화시키면, 각 구현체에 대한 오버엔지니어링이 되지 않을지?

1) 패키지 구조 변경 요청

AS-IS

  • fillin
    • api
    • domain
      • account
      • user
      • studio
      • ...

위와 같이 representation 과 관련된 class (Controller, interceptor, argumentResolver, request/response 는 api package 에,
이 외 각 도메인별 응용, 도메인모델, 엔티티 등을 domain package 하위에 각각 위치시켰음

TO-BE

  • fillin
    • api
    • domain
      • account
      • user
      • studio
      • ...
    • core

core package 추가
-> 각 도메인별 모델 (POJO class, interface) 를 core 로 분리해 패키지를 별도로 구성합니다.
이유는, 각 도메인에서 모델들을 서로 공유하기 위함입니다.
core 에서는 각 도메인에서 핵심적인 모델, 행위만 정의하고, 그 구현체는 각 도메인의 응용, 인프라 level 에서 필요에따라 구현해 사용합니다.

  • ex) User 를 조회한다.
    • core.user 에는 User, UserRepository interface 만 구성
    • domain.user 에서는 UserMySQLRepository 를 구현 (UserRepository 에 정의된 행위를 MySQL 로써 접근하는 구현체)

2) layer 간 dto 정의

  • api, service
    • api to service : ~Command
    • service to api : ~Result