Android-CleanArchitecture icon indicating copy to clipboard operation
Android-CleanArchitecture copied to clipboard

Implementation of use case

Open Thearith opened this issue 7 years ago • 1 comments

Hi all,

this is more of a question than an issue. I cannot seem to wrap my head around the concept of use case (or interactor). Isn't use case just a wrapper class around one Repository function with some add-on functionalities such as thread handling + data transformations. Does this mean that if my project requires 100 API requests, there will be 100 classes of use cases?

Finally, thanks a lot in advance and a big thumbs up for your blog.

Thearith avatar Jun 26 '17 10:06 Thearith

If the only task of your use case is to retrieve some data, yes it would like seen as you say. But there will be other times where your use case will require some validations, transformations, it might as well initialize a service in other layer, trigger some events.

An interactor should contain your business logic. You should be able to know what does your app does by seeing only your interactors.

You might want to read this thread

kevin-barrientos avatar Jun 26 '17 16:06 kevin-barrientos