MVC Stands for Model View Controller.
SAPUI5 utilizes the MVC design pattern to isolate the display of data from user actions, ensuring that it remains unaffected by diverse user interactions.
Following the standard design pattern of MVC architecture, SAPUI5 enables the development of desktop, tablet, and mobile applications with strict adherence.
|
Model : - Model is like database, as it is responsible for storing the data utilized by the application.
- It displays the stored information to the user upon request, based on the user's needs and requirements.
- Responsible for managing the application data.
- Has methods or functions by which we can play or perform operations on that data.
- There are 4 types of models in SAPUI5.
- JSON Model
- XML Model
- Resource Model
- OData Model
View : - View is a User Interface.
- Responsible for defining and rendering UI.
- When a user sends a request from device, the view is responsible for data view as per the request submitted.
- SAP Provides 4 predefined view types.
- JavaScript View
- XML View
- HTML View
- JSON View
Controller :- Controller contains the logic (ex: Button Press logic).
- Controllers are based on model.
- Controller reacts to view events and user interaction by modifying the view and model.
- It controls the data flow into model object and updates the view whenever data changes.
- SAPUI5 provides the following predefined methods in controller.
- OnInit
- OnBeforeRendering
- OnAfterRendering
- OnExit
MVC Advantages:- Development of the application becomes fast.
Overall, the use of the SAPUI5 MVC architecture provides several benefits that make it easier to develop, maintain, and scale applications. Thank you for reading this blog. If you have any questions, Please contact us. We are happy to help you 😊.
|
No comments: