android-mvvm-architecture icon indicating copy to clipboard operation
android-mvvm-architecture copied to clipboard

Caution : Repository is Singleton

Open ashish-andev opened this issue 5 years ago • 1 comments

AppDataManager is a singleton. Is it recommended to keep your Repository class as Singleton?

ashish-andev avatar Oct 30 '19 06:10 ashish-andev

@ashish-andev It depends on the use-case like:

  • How frequently we are going to use that object?
  • How much resource is needed to create the object of that class?
  • What is the scope/lifetime of that object?

amitshekhariitbhu avatar Oct 30 '19 10:10 amitshekhariitbhu