Mes
Mes

Reputation: 1691

MVP's Model vs Interactor from Clean architecture

I'm using MVP pattern in my apps and lately I've been reading about Clean Architecture. One thing I don't really understand is this : what's the difference between Model in MVP and Interactor ? My understanding is that an Interactor is just a special case of a Model. Instead of having a Model that handles a lot of use cases, we split each case in a separate class. Other than that you can obviously move all Interactors in a separate module but in terms of code both classes are doing the same thing.

Am I right or am I missing some important point? Thanks

tl;dr : In other words Model in MVP is just a bunch of Interactors ?

Upvotes: 0

Views: 1038

Answers (1)

Mohsen Mirhoseini
Mohsen Mirhoseini

Reputation: 8882

I have to say that Model, Interactor, Business layer are names of the layer which provide data, I use the MVP architecture and prefer to call my Business Layer Interactor if it is going to call an API an Helper if it is going to use an Android API.

My suggestion is not to stick to the name and pick one and try to take care of MVP layer separations.

You can take a look at this sample project http://github.com/mmirhoseini/marvel and this article https://hackernoon.com/yet-another-mvp-article-part-1-lets-get-to-know-the-project-d3fd553b3e21 to get more familiar with MVP.

Upvotes: 1

Related Questions