-
Notifications
You must be signed in to change notification settings - Fork 1
[REFACTOR] 모듈간의 의존성을 깔끔하게 정리해보자 #223
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
Conversation
MoonsuKang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| @Inject | ||
| lateinit var userPreferences: UserPreferences | ||
| lateinit var userDataRepository: UserDataRepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿굿~
| 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() | ||
| } |
There was a problem hiding this comment.
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로 넣어도 될 것 같다는 생각!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거만 짱구 좀 굴려볼게유
There was a problem hiding this comment.
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는 도메인 단위로 관리되기 때문에 굳이 데이터 출처로 나누는 것이 필요없다고 생각해서 비슷한 역할을 하는 구현체끼리 묶어서 통합했습니당
| interface AlarmScheduler { | ||
| fun scheduleAlarm(alarm: Alarm) | ||
| fun unScheduleAlarm(alarm: Alarm) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P5
옹 저도 스케줄러 부분은 도메인으로 빼고 PendingIntent는 코어에 두는 방향 찬성합니다잉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋㅋㅋㅋ 확실이 이전보다 훨씬 좋네요
…toryimpl 디렉토리로 통합하여 도메인 중심 구조로 정리

Related issue 🛠
closed #222
어떤 변경사항이 있었나요?
CheckPoint ✅
PR이 다음 요구 사항을 충족하는지 확인하세요.
Work Description ✏️
Uncompleted Tasks 😅
To Reviewers 📢
혼란하다 혼란해
feature:alarm-interaction에서는 BroadcastReceiver 등록을 위해 core:alarm 모듈 종속성을
feature:mission에서는 createDissmissPendingIntent() 함수 사용을 위해 core:alarm 모듈 종속성을 가지고 있는데
알람 스케쥴링과 같이 domain layer에서 인터페이스를 선언해서 하는게 좋을지... 아니면 그냥 직접적으로 core:alarm 모듈을 사용하도록 하는 것이 좋을까요?