sunflower
sunflower copied to clipboard
Are the repository classes unnecessarily implemented as singletons?
The repository classes (PlantRepository.kt, GardenPlantingRepository.kt) are singletons and so is the injector utility object (InjectorUtils.kt).
Why are the repository classes singletons when the injector utility object is already one?
Repository classes mentioned are not members of InjectorUtils.kt. Those are being provided by get functions which are members of injector utility class. So if repository classes are not singletons then provider functions of Injector utility class always provide new instance of repository classes.