Open
Conversation
khcho96
reviewed
Sep 27, 2025
| throw new IllegalArgumentException(Message.ERROR_CAR_NAME); | ||
| } | ||
| for (String car : cars) { | ||
| if (!Pattern.matches(Regex.CAR_NAME, car)) { |
Collaborator
There was a problem hiding this comment.
예외처리로 정규표현식 사용은 생각도 못했네요!👍
| Car[] carArray = cars.getCars(); | ||
| while (tryNumber > 0) { | ||
| race.moveCar(carArray); | ||
| RaceView.printProgress(carArray); |
Collaborator
There was a problem hiding this comment.
MVC패턴의 원칙으로 'Model은 Controller와 View에 의존하지 않아야 한다'라고 알고 있는데,
만약 Service가 Model의 역할을 한다면 View는 따로 분리를 하는게 좋을 것 같아요!
Author
There was a problem hiding this comment.
그러네요 어떻게 분리할지 고민하다가 결국 이대로 마무리 했는데 차라리 이 값도 반환을 하게 해서 컨트롤러에서 view를 호출하게 하면 되겠다는 생각이 드네요! 감사합니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 변경 사항
주요 기능인 "난수를 발생시키고 그 결과에 따라 움직인 거리를 출력하는 프로그램"의 최소 기능 단위를 구현하였습니다.
주요 목표:
요구사항을 만족하는 가장 최소한의 프로그램을 설계 및 구현을 우선 시하였으며
이후 개선 및 리팩토링을 통해서 부족한 부분을 추가해 나가고자 하였습니다.
최대한 세부적으로 단위를 나누고 함수의 책임을 최소화하고자 노력하였습니다.
메인 서비스와 출력을 담당하는 view로 구성하여서 최대한 디자인 패턴에 맞도록 파일을 구분하였습니다.
최대한 많은 경우의 예외를 생각하고자 하였습니다. 이를 기반으로 테스트 코드를 작성하고자 하였습니다.