Conversation
m6z1
approved these changes
Apr 30, 2025
|
|
||
| @Qualifier | ||
| @Retention(AnnotationRetention.BINARY) | ||
| annotation class KakaoAuth |
Member
There was a problem hiding this comment.
오 이건 무엇이죠 annotation 을 만들 수 있는 건가요?
Member
Author
There was a problem hiding this comment.
어노테이션 클래스는 말 그대로 명시적인 어노테이션만을 위한 클래스입니다.
레벨4에 배우게 될테지만, 보통 힐트에서 동일한 타입의 인스턴스를 구분할 때 사용합니다.
예시) AuthProvider 라는 인터페이스로 소셜로그인을 추상화할 때,
KakaoAuth: AuthProvider
GoogleAuth: AuthProvider
힐트는 AuthProvider를 @Inject 요청하는 곳에 어떤 AuthProvider 구현체를 주입해줘야하는지 모릅니다.
이럴 때 어노테이션 클래스를 만들고 이를 활용해 어떤 구현체를 주입받아야하는지 힐트에게 알려줄 수 있습니다.
이를 Qualifier(한정자)라고 합니다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
추후 도입될 수 있는 기타 소셜로그인을 고려해, 소셜로그인 추상화 모듈 및 인터페이스를 구현합니다.
외부 라이브러리인 특정 플랫폼 소셜로그인들은 별도의 모듈로 분리 및 관리하며, 공용 모듈인 auth 모듈에서 qualifier를 통해 구분합니다.
분리된 카카오 로그인 로직은 현재 웹소소 LoginActivity 코드로 테스트 진행했으며 문제없습니다!