Skip to content

Conversation

@DongChyeon
Copy link
Member

@DongChyeon DongChyeon commented Jun 22, 2025

Related issue 🛠

closed #222

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

CheckPoint ✅

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

Work Description ✏️

Before
before
After
after
  • 사용되지 않는 더미 데이터 및 불필요한 모듈 제거
  • feature 모듈이 core:datastore를 직접 참조하지 않고, core:data의 repository를 통해 간접 참조하도록 구조 수정
  • feature 모듈이 core:alarm의 AlarmHelper를 직접 호출하지 않고, domain의 AlarmScheduler 인터페이스를 통해 접근하도록 리팩토링
  • feature:navigator 모듈 제거 → app 모듈이 전체 네비게이션의 책임을 직접 소유하도록 구조 통합

Uncompleted Tasks 😅

To Reviewers 📢

혼란하다 혼란해

feature:alarm-interaction에서는 BroadcastReceiver 등록을 위해 core:alarm 모듈 종속성을
feature:mission에서는 createDissmissPendingIntent() 함수 사용을 위해 core:alarm 모듈 종속성을 가지고 있는데
알람 스케쥴링과 같이 domain layer에서 인터페이스를 선언해서 하는게 좋을지... 아니면 그냥 직접적으로 core:alarm 모듈을 사용하도록 하는 것이 좋을까요?

image G선생님의 답변

@DongChyeon DongChyeon requested a review from MoonsuKang June 22, 2025 16:27
@DongChyeon DongChyeon self-assigned this Jun 22, 2025
@DongChyeon DongChyeon added the ♻️ REFACTOR 코드 리팩토링(전면 수정) label Jun 22, 2025
Copy link
Member

@MoonsuKang MoonsuKang left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!!
저희 코어모듈이 10개라 그래프가 이쁘게 그려지지 않는건 쩔수 인거 같습니다 ㅠㅠㅠ
image


@Inject
lateinit var userPreferences: UserPreferences
lateinit var userDataRepository: UserDataRepository
Copy link
Member

Choose a reason for hiding this comment

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

굿굿~

Comment on lines 5 to 27
interface UserLocalDataSource {
val userIdFlow: Flow<Long?>
val userNameFlow: Flow<String?>
val onboardingCompletedFlow: Flow<Boolean>
val fortuneIdFlow: Flow<Long?>
val fortuneDateFlow: Flow<String?>
val fortuneImageIdFlow: Flow<Int?>
val fortuneScoreFlow: Flow<Int?>
val hasNewFortuneFlow: Flow<Boolean>
val firstDismissedAlarmIdFlow: Flow<Long?>

suspend fun saveUserId(userId: Long)
suspend fun saveUserName(userName: String)
suspend fun setOnboardingCompleted()
suspend fun saveFortuneId(fortuneId: Long)
suspend fun markFortuneAsChecked()
suspend fun saveFortuneImageId(imageResId: Int)
suspend fun saveFortuneScore(score: Int)
suspend fun saveFirstDismissedAlarmId(alarmId: Long)
suspend fun clearDismissedAlarmId()
suspend fun clearUserData()
suspend fun clearFortuneId()
}
Copy link
Member

Choose a reason for hiding this comment

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

P4
지금 UserLocalDataSource에 사용자, 운세, 알람 관련 데이터가 함께 들어가 있는데요,
책임 관점에서 분리하면 유지보수나 테스트 코드 작성 시 더 유리할 것 같아요!
User, Fortune, 이렇게? 그리고 firstDismissedAlarmIdFlow 요건 지금 alrarmLocalDatasource로 넣어도 될 것 같다는 생각!

Copy link
Member Author

Choose a reason for hiding this comment

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

이거만 짱구 좀 굴려볼게유

Copy link
Member Author

@DongChyeon DongChyeon Jun 24, 2025

Choose a reason for hiding this comment

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

UserLocalDataSource를 관심사별로 분리했습니당
나누다보니 기존에 local과 remote 각각에 별도의 repository 구현체를 두었다보니, 같은 클래스가 중복되는 문제가 생겼고....
Repository는 도메인 단위로 관리되기 때문에 굳이 데이터 출처로 나누는 것이 필요없다고 생각해서 비슷한 역할을 하는 구현체끼리 묶어서 통합했습니당

Comment on lines +5 to +8
interface AlarmScheduler {
fun scheduleAlarm(alarm: Alarm)
fun unScheduleAlarm(alarm: Alarm)
}
Copy link
Member

Choose a reason for hiding this comment

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

P5
옹 저도 스케줄러 부분은 도메인으로 빼고 PendingIntent는 코어에 두는 방향 찬성합니다잉

Copy link
Member

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋㅋ 확실이 이전보다 훨씬 좋네요

…toryimpl 디렉토리로 통합하여 도메인 중심 구조로 정리
@DongChyeon DongChyeon merged commit f17c151 into develop Jun 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ REFACTOR 코드 리팩토링(전면 수정)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 모듈간의 의존성을 깔끔하게 정리해보자

3 participants