feat : Dependency Injection Using Koin Library#4
Open
MoonsuKang wants to merge 11 commits into
Open
Conversation
…use case initialization
There was a problem hiding this comment.
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Files not reviewed (2)
- androidApp/build.gradle.kts: Language not supported
- shared/build.gradle.kts: Language not supported
Comments suppressed due to low confidence (1)
androidApp/src/main/java/com/river/kmp/android/MainActivity.kt:20
- Ensure that 'androidAppModule' is imported (e.g., import com.river.kmp.android.androidAppModule) to avoid unresolved reference errors during build.
modules(sharedAppModule + androidAppModule)
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.
✨ 요약
closes Dependency Injection Using Koin Library #3
Android 환경에 Koin DI(Dependency Injection) 를 적용하였습니다.
기존의
SharedUseCaseProvider객체를 제거하고, Koin 모듈 기반으로 공통 및 플랫폼 종속 의존성을 구성했습니다.🔧 구현 상세
🧱 공유 모듈 (
shared)sharedAppModule정의:기존의 수동 의존성 생성 로직인
SharedUseCaseProvider제거공통 비즈니스 로직은 그대로 유지하며, ViewModel이나 UseCase는 DI를 통해 제공
📱 Android 모듈 (
androidApp)androidAppModule정의:MainActivity에서startKoin으로 초기화:viewModel()키워드를 통해 ViewModel을 주입받을 수 있음✅ Koin 적용의 장점
Factory나 수동 객체 생성 제거 → 코드 간결화
테스트 용이성 증가 (Mock 주입 구조 구성 가능)
명시적인 모듈 정의로 DI 구조 가시성 확보
🍎 iOS 상태 (적용 실패)
❌ 시도한 접근
공통 모듈에서 다음과 같은 함수 정의:
Swift에서 다음처럼 호출을 시도:
😥 발생한 문제
🔍 다음 작업
iOS에서의 DI 적용 시도
기능 개발