Presentation Logic

View Logic

Definition
Collect and prepare data to be shown in the user interface.
Presentation Logic

Presentation logic is part of the View in MVC, and Boundary in ECB

How does it work?

The user interface mostly shows data that is stored in the database. Presentation logic retrieves the data from the database and transforms it in a way that is informative to the user.

Separating this logic from the user interface helps to un-clutter the view. It also makes it easier for the front-end developer to design the user interface as they are not distracted by the imperative code and can focus on declarative user interface code. Separate presentation logic can also be faster because it encourages the focus on speed of data retrieval.

Examples

  • Model-View-Presenter

Links