Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1, 2단계 - 체스] 제이미(임정수) 미션 제출합니다. #470

Merged
merged 88 commits into from
Mar 23, 2023

Conversation

JJ503
Copy link
Member

@JJ503 JJ503 commented Mar 17, 2023

안녕하세요 춘식!
이번 체스 게임 미션 리뷰이 제이미입니다!
아직 부족한 부분이 많지만 리뷰 잘 부탁드립니다. 감사합니다! ☺️

의문이 든 사항에 대해선 코드에 코멘트를 작성해 두었습니다.
천천히 확인해 주시면 감사하겠습니다!

추가적으로 이번 미션에서는 객체를 객체스럽게 구현하기 위해 많은 고민을 해보았습니다.
실제로 해당 미션에서 이를 잘 지켰는지에 궁금합니다!

지키려고 노력한 점은 다음과 같습니다.
"각 클래스의 상태에 대한 기능은 해당 클래스에서만 이루어져야 한다"

Comment on lines +16 to +29
public static Row from(final int value) {
validate(value);
return new Row(value);
}

public static Row fromWithoutValidate(final int value) {
return new Row(value);
}

private static void validate(final int value) {
if (isOutOfRange(value)) {
throw new IllegalArgumentException("[ERROR] 유효하지 않은 행의 값입니다.");
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 답변 참고
row는 0 ~ 7 사이의 값이어야 한다는 조건에 대한 로직 및 두 가지로 정의한 팩토리 메서드입니다.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위 리뷰에 코멘트 달았으니 확인 부탁드립니다!

Comment on lines +10 to +21
public Coordinate(final Row row, final Column column) {
this.row = row;
this.column = column;
}

public static Coordinate fromOnBoard(final int row, final int column) {
return new Coordinate(Row.from(row), Column.from(column));
}

public static Coordinate from(final int row, final int column) {
return new Coordinate(Row.fromWithoutValidate(row), Column.fromWithoutValidate(column));
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 답변 참고
Coordinate에서 정의한 두 가지 방법의 팩토리 메서드입니다.
네이밍에 대한 의견도 궁금합니다..!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네이밍에 관해선 권장되는 정적 팩토리 메서드 네이밍 컨벤션 이 있어서 참고하면 좋을 것 같습니다.

(+) 팩토리 메서드를 사용할 경우 생성자는 접근제어자는 private으로 돌려주세요!

@JJ503
Copy link
Member Author

JJ503 commented Mar 22, 2023

안녕하세요 춘식!
1, 2 단계에 대한 리뷰 및 질문 답변 감사합니다 😊
피드백에 대한 수정 후 리뷰 재요청 드립니다.

해결 및 추가 궁금한 사항에 대해 코멘트 남겨두었습니다.
이번 리뷰도 잘 부탁드립니다!


변경 사항

  • 클래스 네이밍에 대해 수정 사항이 생겨 이해를 돕기위해 작성합니다.
기존 클래스 명 변경된 클래스 명
Square Piece
Piece PieceType
PieceType PieceTypeSymbol

Copy link

@bimppap bimppap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 제이미, 춘식입니다!
고민을 많이 하면서 리팩토링을 많이 한게 느껴지네요. 수고하셨습니다 👍👍
이번 단계는 여기서 머지하도록 하겠습니다.
질문과 이전에 나눴던 코멘트에 부가 답변들이 있으니 확인 부탁드려요. 🔥
궁금한 점이 있으면 편하게 DM 주세요!

@bimppap bimppap merged commit 4b8e384 into woowacourse:jj503 Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants