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.
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
[오렌지] 치킨집 미션 제출합니다 #4
base: tdd-orange
Are you sure you want to change the base?
[오렌지] 치킨집 미션 제출합니다 #4
Changes from 11 commits
9638e7e
056cb1b
9b20a0a
ca2b4a8
8214868
7a54454
fd3024c
36cd899
29c1c06
bfad1c2
381b6f7
7cc1762
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메서드를 분리하면 depth를 줄일 수 있지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run 예외처리에 대한 답변과 비슷한 맥락이라 메소드를 분리해도 크게 달라질 것 같진 않네요 ㅠㅠ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어차피 run에서 예외처리를 하는데, 여기서 해야 할 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run에서는 메인기능 선택에 대한 예외처리를 받으려고 한 거고,
이 예외처리는 Count 입력의 실패만을 위한 처리라... 사용자 입장에서 중간에 실패했는데 처음부터 다시 하라하면 짜증나니까 이렇게 구현을 해 보았습니다 . . .ㅜㅜ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count를 싱글인스턴스로 사용하는건 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불변을 보장하고 싶어서 새 Count객체를 반환하도록 구현했습니다.
앨런은 어떻게 생각하시나요? 정식 리뷰어가 아니어서.. ㅎㅎ 귀찮으시면 대답은 안하셔도 됩니다 ㅋㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orders의 자료구조를 List를 사용하고 있습니다.
여러개의 주문이 있을때, 각 주문한 메뉴들을 찾아가는 경우가 많을걸로 예상되는데요. (추가 주문)
다른 자료구조를 사용해보는건 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어차피 중복 허용도 아니고 순서가 중요한 것도 아니니까 성능상 List보단 Set이 나을 것 같네요.
아마 앨런의 의도는 Map이겠죠? 처음 구현할 땐 Map이랑 고민을 했었어요!
검색에 대한 성능은 메뉴를 기준으로 탐색하는 Map이 더 좋긴 하겠지만,
map(Map<Menu, Count>)으로 관리를 하게 되면 order 클래스에서 하는 일을 orders 에서 해야 하기도 하고
주문한 종류마다 따로 관리를 하고 싶어서 메뉴과 수량을 갖고 있는 Order객체를 따로 만들었습니다.
그래서 결과적으로 Map을 사용하지 않게 되었습니다. Set을 사용하게 되면 성능상으로도 비슷하지 않을까요...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order를 넘기지 않고 order에 있는 menu만 넘기는게 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떻게 하든 getMenu()를 호출하는건 똑같아서 order를 넘기나, menu를 넘기나 똑같은데...
우선 저는 같은 Order끼리 비교하고 싶어서 order를 넘겨준 것인데
자연스러운건 menu를 넘기는 게 자연스러워 보이네요.
흠... 뭐가 더 좋은건지는 잘 모르겠네요 ㅜㅜ