Skip to content
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

Firestore 및 RemoteSource의 구현을 Coroutines로 migration #14

Merged
merged 5 commits into from
Sep 14, 2023

Conversation

malibinYun
Copy link
Owner

@malibinYun malibinYun commented Sep 14, 2023

Firestore 변경

  1. Firestore의 Callback 방식 구현을 Coroutine를 활용하게 변경함.
  2. 확장 함수로 활용하고 있던 특정 Collection 및 Document 접근을 RemoteSource의 관심사로 변경함
  3. 확장 함수를 정리함.
    • 쓸데없는 형태의 확장함수 모두 제거함.
    • firestore의 collection(), document() 체이닝을 함으로써 데이터를 가져오는 특징을 최대한 살려 가독성을 높임.

RemoteSource와 Firestore 사이 하나의 레이어를 둬야할 지 고민이었음.

현재는 중간 레이어를 두지 않음.
collection 경로 등 remoteSource에서 직접 갖고 있고, 중복되는 경우가 존재함.
Firestore의 응답 값의 필드 명을 직접 가지고 있거나, collection 경로를 직접 알고 있는 것 등은 RemoteSource가 가질 관심이 아닌 것으로 판단됨. 중간 레이어를 두는 것도 좋은 방법이라 생각됨.

RemoteSource 변경

  1. 임시로 CoroutineScope는 하드코딩으로 작성함. 이후 사라질 것임.
  2. 사용하지 않는 메서드에는 UnSupportedOperationException을 발생시키도록 구현함.
    • 애초에 기능이 없으므로, 사용시 아무런 기능을 하기 보다 사용하지 못하도록 의도함.

@malibinYun malibinYun added the enhancement New feature or request label Sep 14, 2023
@malibinYun malibinYun self-assigned this Sep 14, 2023
@malibinYun malibinYun merged commit 3524a3d into refactoring Sep 14, 2023
@malibinYun malibinYun deleted the refactorRemoteSource branch September 14, 2023 14:32
@malibinYun malibinYun linked an issue Sep 17, 2023 that may be closed by this pull request
@malibinYun malibinYun added this to the Refactoring milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firestore 및 RemoteSource Coroutine 변경
1 participant