Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in VIPER architecture should each presenter interact with only one Interactor?

I read about VIPER architecture here http://www.objc.io/issue-13/viper.html (and in a few other sources), but I still can't figure out one thing, should each presenter interacts with at most one Interactor?

Here is a longer discussion about it that might better explain my question: Use Case with 2 ways for the same action

like image 611
Rodrigo Ruiz Avatar asked Dec 20 '22 10:12

Rodrigo Ruiz


1 Answers

As I get it, the presenter is unique per VC. However, when a presenter needs several interactors, he may use them.

The interactors as for my opinion is a layer of business logic, they can interact with each other and the presenters can interact with many of them.

However, it's important to put the right logic in the right layer. For instance, be careful not to put the business logic in the presenter layer since its very tempting to while having to navigate between several interactors. Keep in mind to put the business logic only in the interactors.

like image 161
Asaf Shveki Avatar answered Dec 24 '22 01:12

Asaf Shveki