공통 코드 스타일

https://github.com/woowacourse/woowacourse-docs/blob/main/styleguide/java/intellij-java-wooteco-style.xml

  1. 위의 링크로 이동하여 raw file을 다운받는다.
  2. IntelliJ를 켜고, Preference → Editor → Code Style 로 이동한다.
  3. schema 옆 톱니바퀴를 누르고 Import Scheme → IntelliJ IDEA code style XML 을 클릭하여 1에서 다운받은 파일을 설정해준다.
  4. 매 작업 후 수정된 파일에서 control + command + L (mac 기준) 을 눌러주면 code convention에 따라 formatting 된다.

패키지 구조

패키지 구조는 기능 별로 나누어 가독성을 높인다.

com.example.project
├── controller
├── service
├── repository
├── model
├── dto
    |-- user
    |-- review
    |-- ...
├── config
└── util

DTO

DTO 작성 시 보일러플레이트 코드를 줄이기 위해 record 타입을 도입한다.

public class UserJoinDto {
		
		public static class Request {
					private String name;
		}
		
		public static class Response {
					prviate String name;
		}		

}

네이밍 규칙

기본적인 네이밍 컨벤션

카멜 표기법을 사용한다.