View Interactor Presenter Entity Router (VIPER)

Kelvin Tan
Geek Culture
Published in
6 min readJun 29, 2021

--

The View Interactor Presenter Entity Router (VIPER) is an architecture pattern that separates objects into five distinct types mainly made up of View, Interactor, Presenter, Entity and Router.

VIPER divides the logical structure into distinct layer of responsiblities which then isolate the app’s dependencies. With that you, there are multiple components which play different role here:

  • View delegate user interaction to Presenter.
  • Interactor mediates between the Presenter and data where it takes instruction from the Presenter.
  • Entity aka as Model holds the application data.
  • Presenter mediates between View and Interactor and use Router to move to different screens.
  • Router handles navigation between screen.

VIPER focuses heavily on Presenter where its sole purpose is the View and user action whereas, Interactor focuses on manipulating the data.

When should you use it?

VIPER becomes the preference for most big projects. However, it could be really difficult to understand for beginners due to the large number of components being used.

Implementing VIPER Architecture Pattern

--

--

Kelvin Tan
Geek Culture

Father, husband, software engineer. Building software and building a family, one line of code and one moment at a time. 🚀💻💙 http://ko-fi.com/kelvintanzy