-
Notifications
You must be signed in to change notification settings - Fork 269
[지하철 노선도 미션] 손민성 미션 제출합니다. #102
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
bperhaps
wants to merge
26
commits into
woowacourse:main
Choose a base branch
from
bperhaps:bperhaps
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
치하철 역 이름은 값 객체로 취급하며 검증 책임을 부여함
레포지토리는 저장소의 역할만 하도록 하였으며 OCP를 만족하기 위해 인터페이스화 시킴
사용자의 등록 요청을 수행하기 위한 어플리케이션 서비스 객체 생성 검증 과정을 위해 repository 에서 데이터를 불러와야 하는데 이를 위해 도메인 객체에 repository 의존성을 주입하는것이 부자연스러워 명세를 활용한 검증 로직으로 구현 역 이름은 값객체로 하였으며 스스로에 대한 검증은 스스로 하도록 책임을 부여함.
생성 및 등록을 서비스 객체로 생성 -> 모든게 사용자의 요청이기 때문 래핑 exception의 이름 오타 수정
지하철 노선을 생성하기 위한 서비스 객체 생성. 노선 이름은 값 객체로 취급하여 스스로 검증하도록 하였음. 노선 생성 예외는 repository 가 필요하므로 명세를 사용하여 서비스에서 검증. 모든 예외는 래핑하여 던짐.
지하철 역이 존재하는지 판단하기 위해서는 repository가 필요하므로 명세를 이용하여 검증로직을 만들고 서비스 객체에서 수행하게 하였음.
지하철 목록을 가지고 오는 서비스 객체를 생성(StationListService.java) 받아온 데이터를 OutputView로 넘기면 출력.
Line의 이름이 LineName 으로 되어 있어야 하는데 String으로 되어 있어 잘못된 값에 대한 검증이 안돼 수정
지하철 노 8000 선 중복 검증 로직의 경우 repository를 참조해야 하기에 명세로 표현
서비스 객체를 통해 노선 목록을 불러오고 outputView를 통해 출력한다.
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.
장난 아니네요 이번 미션..