-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactor what in MVP #28
Comments
Interactors are an important part of many clean architectures, and are use cases of the App. It's true they are not very important in this example if the only goal is to learn MVP. |
Are Interactors used to manage data Like Model in MVP? |
They are the part of the model that the presenters interact with, yeah. |
Thank you very much |
For every use case, for example getting user profile and updating user profile I should create a separate interactor? |
I would create at least separate interfaces. In some cases both could be implemented by one class. |
Hi Antonio. Got here after going through your site. I was hoping to get your advice about the flow I have going. It goes like this.
Does how I use the interactor make sense here? Cheers! |
@yelsane usually an interactor is usually called use case. It's a specific action that the user or our App starts. Usually an interactor tends to have just one There are some variations of this, but that usually is the way to use it. If your interactors are having that meaning, then I don't see anything wrong on the flow you describe. Looks good to me. |
@antoniolg Thank you so much for taking the time to provide feedback Antonio. I'll proceed with what I already have then. Cheers! 👍 👍 |
In this example you have made an interactor (which represents the model layer in MVP) instance in the presenter class but i know that model is represented as Singleton in the MVP architecture so is there a difference or affect on app performance |
Well, singletons has their own problems. Main one is that it's difficult to implement, but also you have it in memory even when you don't use it. If you are sure that it needs to be a singleton, I'd just make classes unaware of this implementation detail, by declaring the dependency in the constructor of the classes that use it. |
Why do we use Interactor in Mvp ?Presenter can maka it What Interactor do,can I see it as a model?or,it is a model
The text was updated successfully, but these errors were encountered: