In SAPUI5, controllers are used to separate the view logic from the model logic. The methods for controlling the data flow should be implemented in a controller⁴. SAPUI5 follows the MVC (Model, View, and Controller) architecture¹. In this architecture, the controller is responsible for responding to user input and performing interactions on the view as well as the backend data¹.
Every view has its own controller, although it is not mandatory for a view to have a controller¹. Usually, a controller has the same name as the view except in the case of the base controller¹. The controller in SAPUI5 is always in JavaScript format, with the “.controller.js” extension¹.