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

5단계 - 자동차 경주(리팩토링) #6080

Merged
merged 1 commit into from
Mar 22, 2025
Merged

Conversation

irnd04
Copy link

@irnd04 irnd04 commented Mar 21, 2025

요구사항

  • 핵심 비지니스 로직을 가지는 객체를 domain 패키지, UI 관련한 객체를 view 패키지에 구현한다.
  • MVC 패턴 기반으로 리팩토링해 view 패키지의 객체가 domain 패키지 객체에 의존할 수 있지만, domain 패키지의 객체는 view 패키지 객체에 의존하지 않도록 구현한다.
  • 테스트 가능한 부분과 테스트하기 힘든 부분을 분리해 테스트 가능한 부분에 대해서만 단위 테스트를 진행한다.

작업내용

package를 요구사항에 맞게 이동했습니다.
객체의 이름을 적절하게 변경했습니다.

Copy link
Member

@testrace testrace left a comment

Choose a reason for hiding this comment

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

안녕하세요 재국님 😃
5단계 리팩토링도 잘해주셨네요 👍
기존에 책임이 잘 분리되었기에 변경이 많지 않네요.

자동차 경주 미션은 여기서 마무리 하겠습니다.
소소하게 코멘트 남겼는데 확인해 주세요.
다음 미션도 화이팅입니다 🔥

}

private List<RacingCar> sort(List<RacingCar> racingCars) {
racingCars = new ArrayList<>(racingCars);
Copy link
Member

Choose a reason for hiding this comment

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

파라미터로 받은 인자를 재할당하지 않고 새로운 지역 변수를 선언하는 방법도 고려해 보시면 좋을 것 같아요.

Copy link
Author

Choose a reason for hiding this comment

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

@testrace
네 새로운 지역변수가 좋다고 생각하는데 이게 이름짓기가 만만치 않은 것 같아요.
리뷰 감사합니다.
첫미션이 용주님과 함께여서 참 좋았던 것 같습니다.

@testrace testrace merged commit b5614fb into next-step:irnd04 Mar 22, 2025
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