Can someone provide a concrete (actual Java code) example of MVP in action?
This would include the following 3 types of classes and how they call each other’s methods to achieve the pattern and process/respond to a client-side response:
- Model – some kind of value object (VO)
- View – represents or generates the UI
- Presenters – business logic
MVP is my favorite design pattern to create a UI.
The big difference between MVP and MVC is how to handle the view.
There are many styles to program the MVP.
In a formal way, consists in create interfaces for each element of the design pattern.