bufferapp / android-clean-architecture-boilerplate

An android boilerplate project using clean architecture
MIT License
3.66k stars 519 forks source link

Where do WorkManager, JobScheduler Fit? #61

Open KwabenBerko opened 3 years ago

KwabenBerko commented 3 years ago

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?

edasich commented 3 years ago

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

KwabenBerko commented 3 years ago

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.