Created
November 2, 2022 13:25
-
-
Save Wajahat-Jawaid/91c61808c923b7bac9ed27a37c9e59c8 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Dependency Injection container at the application level. | |
*/ | |
interface AppContainer { | |
val fileRepository: FileRepository | |
} | |
/** | |
* Implementation for the Dependency Injection container at the application level. | |
* | |
* Variables are initialized lazily and the same instance is shared across the whole app. | |
*/ | |
class AppContainerImpl : AppContainer { | |
override val fileRepository: FileRepository by lazy { | |
FileRepositoryImpl() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment