Open
Conversation
whdgks
reviewed
May 20, 2025
| if (selected == 4) { | ||
| throw new ProgramTerminateException(); | ||
| } | ||
| throw new IllegalArgumentException("[ERROR] 잘못된 입력입니다."); |
There was a problem hiding this comment.
여기처럼 에러 메세지를 출력하는 부분에서 에러 메시지를 직접 하드코딩하는 것이 아닌 모든 메시지를 하나의 클래스에 상수로 정의한다면 어떨까 싶어요. 클래스에 정의해서 사용한다면 메시지 수정이 편해지고, 혹시 모를 실수를 방지할 수 있을 것 같아요
| throw new IllegalStateException("잉크가 부족해 출력이 중단되었습니다."); | ||
| } | ||
| ink -= consume; | ||
| printInterface.print(line); |
There was a problem hiding this comment.
Printer클래스에서 직접 출력하는 부분은 Controller 또는 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.
No description provided.