com.team.gogym.user (예시입니다)
ㄴ controller // API 컨트롤러
ㄴ service // 비즈니스 로직
ㄴ repository // 리포지토리
ㄴ entity // 엔티티
ㄴ dto // 데이터 객체
ㄴ exception // 예외 처리 (루트 디렉토리)
ㄴ config // 설정 클래스 (Security 등) (루트 디렉토리)
ㄴ util // 유틸리티 클래스 (루트 디렉토리)
패키지명은 모두 소문자 사용하고 하위 패키지로 기능 분리
파스칼 케이스로 명사형으로 작성.
public class Service {}
접두사를 붙이지 않고 구현체는 명확히 구분되도록 접미사를 추가.
public interface Repository {}
public class RepositoryImpl implements UserRepository {}
클래스 이름에 Controller 접미
public class UserController {}
데이터 전송 객체는 Dto 접미사
public class UserDto {}
클래스 이름은 단수형으로 작성
public class User {}