Remote Presentation Model

from Wikipedia, the free encyclopedia
Remote Presentation Model Diagram
Remote Presentation Model Diagram

The Remote Presentation Model (RPM) is an architecture pattern for structuring software development. It is mainly used in a client-server infrastructure and, like the MVC pattern , serves to create a separation between the view (UI) and the controller or business logic. Similar to the MVC pattern, there is also a separation between model, view and controller logic. In contrast to the MVC model, however, the remote presentation model also defines a separation of the components between client and server. The controller part is located in the server and offers the advantage of using server-side technologies (APIs, frameworks, etc.). In addition, the use of the remote presentation model pattern makes the view layer particularly lightweight and can be exchanged much more easily than with other architecture patterns.

Structure of the remote presentation model pattern

As known from MVC, the remote presentation model pattern is also divided into the three components model, view and controller. The remote presentation model defines the dependencies and interfaces between the three components much more strictly than the MVC model.

Model

The model is known both in the server-side controller and in the client-side view. Therefore there is a server-side and a client-side instance of the model, which must be kept synchronous. As a best practice, the model should support the observer pattern in order to significantly simplify programming in the view and in the controller. Since the structure of the model is usually defined by the values ​​to be displayed in the view, the term "Presentation Model" is often used (see the ViewModel in MVVM for comparison ).

View

The view is defined as the flat layer possible without business and controller logic. In principle, the values ​​of the model are linked to values ​​of the user interface in the view. A text value in the model can be B. be bound to the input text of a text field. As a rule, changes in the model should update the view and changes in the view (e.g. through user input) update the model. This can be significantly simplified by supporting the observer pattern and data binding in the model.

Controller

The controller defines the entire logic. This is where the initial values ​​of the model are defined and changes in the model are reacted to. Since the controller is defined in the server, server-side technologies can also be used here. For example, changes in the model can be saved directly in a central database.

Web links