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.
🔥 Pull requests
🌴 작업한 브랜치
✅ 작업한 내용
❗️PR Point
서버통신 과정에서 의존성 주입을 신경쓰면서 개발했습니다.
repository 패턴 적용
데이터를 받아오고 가져오는 과정을 비즈니스 로직과 분리하기 위해서 Repository 패턴을 사용했습니다.
=> repository 패턴의 가장 큰 역할 외부 서비스에 들어오는 값을 내부 입맛에 맡게 잘 가공해주는 역할입니다.
지금은 서버통신을 통해서만 데이터를 받아오지만, Realm, UserDefault 등 다양한 서비스에서 가져오는 데이터는 그 형식도 각기 다를것이다. 그런 데이터를 UseCase에서 통일된 데이터로 받아올 수 있게 repository 패턴을 적용했습니다.
WeatherNetworkService로 분리
서버통신을 담당하는 부분으로 분리했습니다! + 커스텀했습니다!
Moya처럼 URLRequest하는 부분을 커스텀했습니다. 확실히 서버통신하는 부분과 requset 객체를 생성하는 부분을 분리할 수 있어서 좋았습니다.
📸 스크린샷
✏️ 배운점 & 참고 레퍼런스
closed #15