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

[REFACTOR/#151] Auth 모듈 통신 관련 UseCase 패턴으로 교체 #152

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

Marchbreeze
Copy link
Member

⛳️ Work Description

  • 액세스 토큰과 FCM토큰을 받아서 서버에서 자체 토큰을 발급받는 로직 UseCase로 마이그레이션

Copy link

@kkk5474096 kkk5474096 left a comment

Choose a reason for hiding this comment

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

리뷰 남겼슴다~~! @Marchbreeze

@Module
@InstallIn(SingletonComponent::class)
class UseCaseModule {
@Singleton

Choose a reason for hiding this comment

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

UseCase를 특별하게 Singleton으로 만든 이유가 있을까?.?
UseCase는 보통 상태를 가지지 않는 단일 책임 비즈니스 로직이고
이미 repository 단에서 single톤이기에 특별한 이유가 없다면 사용 안해도 될거같슴다

Copy link
Member Author

Choose a reason for hiding this comment

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

오호 ... 하나의 기능 구현이라면 싱글톤이 아닌게 오히려 덜꼬일 것 같기는 하네요 !

@InstallIn(SingletonComponent::class)
class UseCaseModule {
@Singleton
@Provides

Choose a reason for hiding this comment

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

yello 때는 별 뜻없이 provide를 사용하긴 했는데 외부 라이브러리 주입이 아니라면 bind로 주입하는걸 추천합니댜,
repository나 dataSource도

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

@kkk5474096 kkk5474096 left a comment

Choose a reason for hiding this comment

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

추가로 싱글톤 제거하고 UseCase에서 Inject로 주입한다면 UseCaseModule은 제거해도 됩니다~ @Marchbreeze

@Marchbreeze Marchbreeze changed the title [REFACTOR/#151] 토큰교체 통신 UseCase 구현 [REFACTOR/#151] Auth 모듈 통신 관련 UseCase 패턴으로 교체 Nov 13, 2024
@Marchbreeze Marchbreeze merged commit dfb4363 into develop Nov 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] Repository 패턴 UseCase 추가
2 participants