Skip to content

[이혁진] 자동차 경주 게임 step2 코드리뷰 부탁드립니다 #17

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

Open
wants to merge 4 commits into
base: hyukjin-step2
Choose a base branch
from

Conversation

hyukjin-lee
Copy link
Collaborator

No description provided.

this.name = name;
}

public int getDistance() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

사용하는 곳이 있는 메소드인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

없네요 지워야겠습니다 !


public void moveCars() {
for (Car car : cars) {
moveSelectedCar(car, RandomValueGenerator.generate(BOUNDARY));
Copy link
Collaborator

Choose a reason for hiding this comment

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

랜덤값을 moveSelectedCar() 메소드 안에서 구현해도 될 것 같은데, 매개변수로 넣어준 이유는 테스트를 쉽게하기 위해서 인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네 moveSelectedCar를 테스트하기 위해서 했습니다!


private String name;
private int distance;

Copy link
Member

Choose a reason for hiding this comment

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

domain에서 가지고 있는 정보를 여기서도 가지고 있어야 하나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

domain이 get set을 최대한 하면 안되게 DTO를 사용했습니다. DTO는 Data Transfer Object로, 해당 도메인에서 필요한 데이터를 DTO로 담아서 마치 모델의 분신처럼 다른 레이어들과 데이터 주고 받기를 가능하게하는 역할을 합니다.

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.

3 participants