android-clean-architecture-boilerplate icon indicating copy to clipboard operation
android-clean-architecture-boilerplate copied to clipboard

Where do WorkManager, JobScheduler Fit?

Open KwabenBerko opened this issue 4 years ago • 2 comments
trafficstars

Usually, in apps, there are some tasks that we run in the background, such as syncing of data, analytics etc. Google suggested to use deferrable components such as WorkManager and JobScheduler in such instances. Where do these components fit in Clean Architecture?

KwabenBerko avatar Dec 06 '20 14:12 KwabenBerko

I have got really confused too. If we make another layer, called worker layer like device layer. Does worker layer suppose to work with data layer directly ? If yes, there would be some business logic in worker layer that is not good.

@KwabenBerko

edasich avatar Jan 30 '21 15:01 edasich

I only ever use just 3 layers, at least 80% of the time(presentation, domain, data). Also, I ended up putting my WorkManager implementation behind an abstraction and placed it in the data layer.

KwabenBerko avatar Feb 07 '21 12:02 KwabenBerko