Skip to content

[Feature] core datastore 모듈 추가#66

Open
citytexi wants to merge 6 commits into
developfrom
feature/add-core-datastore
Open

[Feature] core datastore 모듈 추가#66
citytexi wants to merge 6 commits into
developfrom
feature/add-core-datastore

Conversation

@citytexi

@citytexi citytexi commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

📌 Summary (필수)

  • core datastore 모듈 추가

✅ Checklist (필수)

  • 셀프 코드 리뷰 완료
  • 코드 컨벤션 확인 완료
  • UI 변경 시 스크린샷 첨부
  • 관련 테스트 추가 / 수정
  • 로컬 테스트 통과
  • 머지 대상 브랜치 확인 (develop / main / 기타)

🔗 Related Issue (선택)

Closes #이슈번호


📱 Screenshots / Screen Recording (선택)

Before After

💬 Notes for Reviewer (선택)

커스텀 갤러리 캐싱 작업을 위해 datastore 모듈을 추가합니다


🧪 How to Test (선택)

@citytexi citytexi self-assigned this Jun 7, 2026
@citytexi citytexi requested review from JeonK1 and moonsbsb as code owners June 7, 2026 06:04
@citytexi citytexi added the 기능 새로운 기능 또는 요청 사항 label Jun 7, 2026

@JeonK1 JeonK1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음음 맛있는 주제 이야기들 들고왔습니다.
많은 의견 남겨주시면 감사드립니다~

Comment thread app/build.gradle.kts
Comment thread core/datastore/build.gradle.kts Outdated
Comment thread core/datastore/build.gradle.kts Outdated

import kotlinx.coroutines.flow.Flow

interface TempPreferencesDataSource {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Q]
희훈이는 DataSource 를 어떤 기준으로 생성하남!?

DataSource 는 Android 클린아키텍처에서 많이 쓰이는 패턴인 것 같아. 여기서 나는 DataSource 를 Data 가 어디에서 왔는지에 대한 원천에 대한 내용으로 이해하고 있어.
그렇기에 Android 공식문서의 Data Layer 에 대한 설명(Link)에서도 LocalDataSource 와 RemoteDataSource 를 구분하는 것이 같은 종류의 정보이지만, 그게 내부 DB 에서 온 것인지, Network 를 통해 전달된 것인지 다를 수 있고, 이를 구분하기 위해 만든 것이라고 이해하고 있어.
=> (물론 해당 문서가 Clean Architecture 를 지향하고 있진 않지만 DataSource 라는 용어 자체에 대한 사용 배경 관점에 이야기야!)

그렇다보니 정보가 넘어올 수 있는 DataSource 가 1곳 뿐이라면 현 아키텍처 구조에서 DataSource 라는 객체를 만드는 것은 불필요한 작업이 아닐까라는 생각을 해.
그래서 DataSource 를 만든다면 어떤 기준으로 만드는지, 그리고 우리는 앞으로 어떤 기준으로 만들어가면 좋을지에 대한 이야기를 하고 싶어서 코멘트 남겨봤어!

+) 아 물론 TempPreferencesDataSource 가 예시코드라서 만들었다는걸 알고 있구 지금 코드에서 DataSource 클래스를 제거하자는 의미는 아니었어!

cc. @moonsbsb 설빈이도 같이 이야기 나눠보면 좋을 것 같아서 태그했음~ 의견 주심 감사드립니당

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 mapping 용도, memcache 용도로 source layer를 사용합니다

지금은 일단 임시 파일이라서 파일 위치나 네이밍이 어색하긴 한데

remote, local로 분리하는 경우에

  1. remote는 dto -> vo 로 mapping 해서 repository 단으로 연결
  2. local은 내부 db 또는 StateFlow를 이용한 local memcache

이러한 구조로 datasource를 분리해서 repository로 주입하는 용도로 사용합니다
이런 구조로 쓰면 다른 repo에서 ssot 작업이 편하더라구요

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그럼 dataSource 는 무조건 만드는 방향인건가?!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나는 만들었으면 좋겠긴한데 어떻게 생각하시는쥐

@JeonK1 JeonK1 Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

글쿤 사실 DataSource 가 한 곳임에도 만드는건 불필요하다는 점은 해소되진 않긴 했는뎅
결국 이게 클린아키텍처의 각 구성요소들의 역할을 어떻게 해석했냐의 차이라고 봐서 어느 방향이어도 크게 문제는 없을 것 같아!

우리는 DataSource 는 무조건 만드는 방향으로 가보자!

@citytexi citytexi force-pushed the feature/add-core-datastore branch from b80e5eb to b67bfe2 Compare June 8, 2026 07:38
@citytexi

citytexi commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@JeonK1 @moonsbsb
PR 닫고 다시 올릴려다가 코멘트가 다 논의 해야할 내역이 많은 것 같아서 남기려고 rebase 했습니다

@citytexi citytexi force-pushed the feature/add-core-datastore branch from b67bfe2 to 9d0ce71 Compare June 9, 2026 07:48
@citytexi citytexi requested a review from JeonK1 June 9, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

기능 새로운 기능 또는 요청 사항

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants