-
Notifications
You must be signed in to change notification settings - Fork 13
[3주차] 객체지향 코드 연습(서아영) #1
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
Seooooo24
wants to merge
41
commits into
COW-edu:main
Choose a base branch
from
Seooooo24:main
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
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
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.
로또에서 받았던 피드백들을 수용하고자 노력했습니다.
TDA 원칙을 지키면서 getter를 남용하지 않으려 애썼습니다.....
기능 정의와 설계도 최대한 상세하게 하여 커밋이 저번 보다는 나아진 것 같습니다.
서비스를 만들지 않으려고 노력했습니다... 하지만 도메인 객체 생성 책임을 controller가 가지면 안 될 것 같아서 RacingCarService를 하나 만들었습니다. (사용을 안 하고 객체지향적으로 설계할 수 있는지가 궁금합니다!)
도메인도 인터페이스를 다 분리하려 했으나, 패키지 구조가 너무 복잡해지고 static 메서드는 인터페이스에 정의해두어야 하길래 그냥 클래스로 두었습니다. 검색해서 공부해보니 도메인은 추상화 하지 않아도 된다는 말도 있고... 어떤 기준으로 인터페이스를 분리하고, static 메서드는 인터페이스에서 정의해버려야 하는지 궁금합니다.
현재 RacingCar가 position이라는 가변적인 상태를 가지고 move라는 메서드가 이 상태를 변화시키는데, 이러면 캡슐화를 깨는 것인지도 궁금합니다.
이펙티브 자바 내용은 훑어본 내용은 모두 반영하고자 노력하였습니다. 주로 신경 쓴 부분은 정적 팩토리 메서드 사용, 클래스와 멤버 캡슐화입니다.