Hi everyone! This is my second post here and I want to tell you about my experience using architecture VIPER for Android App development.
First thing, what is VIPER? VIPER is an architectural pattern like MVC or MVVM but it separates the code further by single responsibility.
Each of the letters in VIPER is one component of the architecture: View, Interactor, Presenter, Entity, and Router.
The View is the interface.
The Interactor is a class working between the presenter and the data.
The Presenter is the “traffic cop” of the architecture, directing data between the view and interactor, taking user actions, and calling to a router to move the user between views.
The Entity represents application data.
The Router handles navigation between screens.
For IOS developers, it's more common to work with this architecture because it came from IOS development but, some time ago, this architecture became known to the android world.
My old experience with architecture was MVC which, to a mobile developer, was difficult to use because you don't know where you need to add code and it's hard to test, as well.
Honestly, when I started using VIPER, I saw how easy it was to understand. Once you and your team get the principle for this architecture, developing becomes easier and comprehensive, in each feature you develop, you already know how to structure it.
But on the other side, I saw how it can be verbose because you needed to use View, Presenter, Interactor, Router in almost everything. For example, if you just need to put a button on the screen to show a message, you need to create a function inside view and presenter. It would be easier to just put the method in View but if you do that is not VIPER anymore.
Top comments (0)