sunflower icon indicating copy to clipboard operation
sunflower copied to clipboard

Are the repository classes unnecessarily implemented as singletons?

Open oznecro opened this issue 7 years ago • 1 comments

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?

oznecro avatar Aug 16 '18 10:08 oznecro

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.

silwar avatar Aug 28 '18 04:08 silwar