스프링부트패키지
-
Spring boot 패키지 구조Java 2023. 10. 17. 15:32
계층형 vs 도메인형 계층형 구조 각 계층을 대표하는 디렉터리를 기준으로 패키지를 나눈 것 장점: 프로젝트의 이해도가 낮아도 전체적인 구조를 빠르게 파악 가능 단점: 디렉터리 안에 클래스들이 많이 모이게 됨 도메인형 구조 도메인 디렉터리를 기준으로 패키지를 나눈 것 장점: 도메인의 관련 코드를 응집할 수 있음 단점: 프로젝트의 이해도가 낮을 경우 전체적인 구조 파악 어려움 계층형 Directory 구조 src/main/java 자바 파일들을 담음 controller service db repository (dao) entity global (공통적으로 사용되는 것들) auth exception model (dto) config: JpaConfig.java src/main/resources 리소스 파일들을..