VIPER (design sample)

from Wikipedia, the free encyclopedia

VIPER is a software design pattern . The name is an acronym which stands for View, Interactor, Presenter, Entity and Router. It thus describes the individual components of a software architecture and, similar to the Model View Controller or Model View ViewModel, serves to separate responsibilities between individual program components within an application which at least partially consists of the implementation of a user interface .

history

The pattern was originally developed by Mutual Mobile, a developer of mobile software, to improve the testability of the individual architecture components.

description

Like other design patterns, VIPER relies on the separation of more or less strictly defined responsibilities in the program sequence. The binding of the individual components can take place, for example, via delegation or another pattern. The individual components have the following responsibilities:

  • View: Display of the UI and forwarding of user input to the presenter.
  • Presenter: Forwarding of user input to the router or to the interactor. Preparation of model data for display in the view.
  • Router: Describes the navigation logic between individual UI components.
  • Interactor: Provision of the model data relevant for the presenter and the methods to manipulate this model data from the inputs of the user. If necessary, the business logic of the application would be implemented here.
  • Entity: The model objects that are used by the interactor.

See also

Individual evidence

  1. Jeff Gilbert and Conrad Stoll: Architecting iOS Apps with VIPER ( English ) June 2014. Accessed November 12, 2018.