Skip to content

[level3]정윤주 학습 PR 제출합니다.#14

Open
dbswn0 wants to merge 4 commits intoCOW-edu:mainfrom
dbswn0:main
Open

[level3]정윤주 학습 PR 제출합니다.#14
dbswn0 wants to merge 4 commits intoCOW-edu:mainfrom
dbswn0:main

Conversation

@dbswn0
Copy link
Contributor

@dbswn0 dbswn0 commented Feb 9, 2025

No description provided.

Copy link
Contributor

@KoSeonJe KoSeonJe left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.

main클래스부터 작성하는 습관을 들이면 좋을 것 같습니다.
MVC패턴을 사용한다면 그것을 이해하시는 것은 필수입니다.

다른사람이 코드를 봤을 때 이해를 할 수 있는지 main메소드부터 흐름따라가면서 이해안되는 부분은 고쳐보시면 좋은 코드가 될 수 있을 것 같습니다

Copy link
Contributor

Choose a reason for hiding this comment

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

현재 main메소드에 구현 코드가 없습니다.
이말은 실행되지 않는 코드인 것을 알 수 있는데, 아무리 객체지향적으로 코드를 잘 짜도 실행되지 않는 코드는 의미가 없습니다.
한번 실행해보고 과제를 제출해보는 것이 좋을 것 같아요!

Comment on lines 13 to 18
Copy link
Contributor

Choose a reason for hiding this comment

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

메소드 명이 구체적이지 않은 것 같아요.
단순히 move의 역할만 하고 있는 거라고 생각할 수 있는데,
실제 구현 로직을 보면 랜덤으로 움직이고 있습니다.

Suggested change
public void move() {
int randomValue = Randoms.pickNumberInRange(0, 9);
if (randomValue >= 4) {
position ++;
}
}
public void randomMove() {
int randomValue = Randoms.pickNumberInRange(0, 9);
if (randomValue >= 4) {
position ++;
}
}

Comment on lines 14 to 15
Copy link
Contributor

Choose a reason for hiding this comment

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

0, 9가 어떤 숫자를 의미하는지, 4가 어떤 숫자를 의미하는지
상수로 선언하여 코드 가독성을 높여보는 것이 좋을 것 같습니다

Copy link
Contributor

Choose a reason for hiding this comment

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

controller는 어떤 역할을 하는지 공부해보면 좋을 것 같아요

Comment on lines 6 to 11
Copy link
Contributor

Choose a reason for hiding this comment

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

입력문이 controller클래스 내에 있는것이 괜찮을까요?

Copy link
Contributor

Choose a reason for hiding this comment

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

입력만하고 반환하지 않는다면 입력하는 의미가 없어보입니다!

Copy link
Contributor

@KoSeonJe KoSeonJe left a comment

Choose a reason for hiding this comment

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

스터디 하느라 고생하셨습니다~

MVC 패턴을 사용하셨는데, 각각의 역할에 맞게 책임을 분배하지 못하신 것 같아요.
model은 view를 의존하면 안되는데 의존하는 부분이 있네요.
그리고 view가 해야할 일을 외부에서 하고 있는 것 같아요
책임을 가진 객체를 생성했다면 그 책임을 해당 객체 내부에만 구현하면 좋을 것 같아요

화이팅입니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

의존성을 외부에서 주입해주면 좋을 것 같네요~

Copy link
Contributor

Choose a reason for hiding this comment

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

현재 depth가
while -> for -> if
3개인데,
1개로 줄이도록 노력해보는 것이 좋아요

Copy link
Contributor

Choose a reason for hiding this comment

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

startRace에 view를 넘겨주는 것이 괜찮을지 생각해보면 좋을 것 같아요

Copy link
Contributor

Choose a reason for hiding this comment

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

이 출력문은 view에 넣지 않으신 이유가 있을까요?

Copy link
Contributor

Choose a reason for hiding this comment

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

static 키워드는 어떤 경우에 사용할지 고민해보면 좋을 것 같아요.
여기의 static은 올바르게 쓰였을까?

Copy link
Contributor

Choose a reason for hiding this comment

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

inputValidator가 Input을 검증하는 객체의 의미같은데,
메소드의 구현은 validate와 input을 함께 하고 있네요... 클래스명이 조금은 적절치 않은 것 같아요
좀더 해당 객체의 역할을 명확히 나타낼필요가 있는 것 같습니다

Comment on lines 17 to 25
Copy link
Contributor

Choose a reason for hiding this comment

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

Race는 도메인 클래스같은데, 도메인이 view에 의존해도 괜찮은지 고민해보면 좋을 것 같아요

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.

2 participants