Reputation: 416
I've decided to try migrating my existing project architecture to VIPER. VIPER seems popular due to the way it separates modules. However, I have 2 similar view controllers that inherit from CustomVC. These 2 view controllers call for super methods to setup UI and run some business logic. If I leave the UI functionality in CustomVC, should I move the business logic to an analogous CustomPresenter superclass? Should I move common navigation behavior to an analogous CustomInteractor class? Okay, I do that, then what: do the 2 view controller modules inherit from the CustomPresenter and/or CustomInteractor classes? In the answers, please guide me toward what is acceptable in this situation, considering VIPER architecture goals. Thank you.
Upvotes: 0
Views: 224
Reputation: 902
So no, once all the UI, business logic, and sensor/datastore/networking data-acquisition/exchange has been entirely separated from each other, the view controllers would no longer have anything directly to do with CustomPresenter or with CustomInteractor or CustomRouter, most especially no inheritance from them. All interactions among CustomUI & its subclasses versus CustomPresenter & its subclasses (if any) versus CustomInteractor & its subclasses (if any) versus CustomRouter & its subclasses (if any) would be via pure app-domain messaging (or effect-event subscription) interzone via app-domain lightweight entities—i.e., indirect interaction through V view zone's façade and/or I interactor zone's façade with P presenter zone.
Upvotes: 1