-
Notifications
You must be signed in to change notification settings - Fork 1
Java ToyProject upload by JoonheeJeong #13
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
Open
JoonheeJeong
wants to merge
61
commits into
FastCampusKDTBackend:main
Choose a base branch
from
JoonheeJeong:JoonheeJeong
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Java ToyProject upload by JoonheeJeong #13
JoonheeJeong
wants to merge
61
commits into
FastCampusKDTBackend:main
from
JoonheeJeong:JoonheeJeong
Conversation
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
…extMenu()` of `StartMenu`
…InputMisMatchException`
…dInputAndGetNextMenu()` of `ViewParameterMenu`
각 사용자 정의 예외들의 더 정확한 의미 표현을 위해 `Exception` 대신에 `IllegalArgumentException`을 상속합니다.
의미를 좀더 명확하게 하기 위해서 각종 이름을 변경합니다.
클래스가 많아져서 보기가 복잡해서 편의를 위해 여러 패키지로 나눕니다.
최상위 `Menu` 클래스에 추상 메소드 `setNextMenus()`를 추가합니다. 상호참조로 인해 뒤로 돌아가는 메뉴에 대해 싱글톤을 활용하려면 결국 호출되는 메소드 안에서 어떤 메뉴 객체로 돌아가야 하는지 명시적으로 지정해주었어야 했습니다. 그럴거면 아예 모든 다음 메뉴를 동적으로 지정해줌으로써 모든 메뉴의 동작의 일관성을 증진시키고, 더불어 InstanceHolder를 활용하여 메모리 낭비를 최소화할 수 있습니다.
코드 재사용성을 높이기 위해 추상클래스를 새로 하나 만듭니다. 더불어 예외의 의미를 조금 더 정확하게 표현하기 위하여 몇몇 예외들의 상속 구조를 변경합니다.
불필요한 dummy를 지웁니다. 1. nextMenus의 dummy null (idx:0) 2. List의 dummy null (idx:0) 3. SetParameter의 dummy null (idx:0) 을 지우되 외부 코드에는 영향을 최소화하여 지웁니다.
1. formatting 2. `nextMenus` 필드의 접근제어자를 private으로 변경했습니다. 3. 불필요한 `inputGroupName()`을 다른 메소드로 대체했습니다.
me.day10.smartstore -> me.smartstore
to `totalPaidAmount`
처음부터 Parameter가 null인 상태로 존재하기 때문에 Set과 Update를 둘 다 두기보다 Update 하나로 둘 모두의 역할을 수행하도록 합니다. 이를 위해 기존의 미구현 Update를 지우고 Set을 Update로 변경합니다.
1. parameter 업데이트할 때 입력 받는 구조를 변경했습니다. 2. parameter 업데이트했을 때 기존 유저들의 group에도 반영될 수 있도록 수정했습니다. 3. test를 진행할 수 있도록 테스트 데이터를 삽입했습니다.
fe02264
to
14aa100
Compare
1. rename `classification` -> `summary` 2. extract `Summary` 3. move `Order` and the static constant Comparators of `Customer` 4. `CustomerRepository` extends `List<Customer>` 5. fix some typos
14aa100
to
fc7a869
Compare
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.
기본 골자는 크게 2가지입니다.
다만 구현 중에 중복코드가 많이 발생해서 상속구조가 많이 생기다 보니 클래스 구조가 많이 복잡해진 것 같습니다. 처음부터 템플릿 메서드 패턴을 고려했으면 더 깔끔하게 구현이 됐을 것 같은데, 설계할 때는 세부 구현을 모르니까 구현하다 보니 많이 복잡해진 것 같습니다. 그리고 전반적으로 싱글톤으로 구현하려고 의도했는데, 중복코드가 너무 많이 발생해서 고심하다가 지금과 같은 상속 구조가 자리 잡혔는데, 이것이 맞는지도 궁금합니다.
설계측면에서 조언을 많이 해주시면 감사하겠습니다. 🤗
느낀 점은, 한 가지 문제를 놓고 구현하고 있을 때 다른 문제가 보이더라도 건들지 말고 일단 하던 거 마저 하고 나서 고쳐야 커밋이 깔끔해진다는 것이었습니다.. 그런데 아직 실력이 미흡해서 코드를 볼 때마다 지저분한 게 너무 많아서 지금은 커밋과 변경 내용이 뚜렷하게 일관성이 있지는 않게 됐습니다 ㅜㅜ