Model-View-Controller (MVC) design pattern
Use the Model-View-Controller (MVC) design pattern to separate application data, presentation logic, and control information into distinct objects for HCL Commerce applications.
The MVC design pattern provides a structural framework that separates an application into three main components: the model, the view, and the controller. This separation simplifies application structure and encourages code reuse.
- Model: Contains the application data. It does not contain logic regarding how data is presented to the user.
- View: Presents the model data to the user. The view accesses the data but does not interpret the meaning of the data or the actions required to manipulate it.
- Controller: Manages the interaction between the view and the model. It listens for events triggered by the view and executes the appropriate reaction, typically by calling a method on the model.
Because the view and model are connected through a notification mechanism, changes to the model are automatically reflected in the view. HCL Commerce applies this pattern to both web applications and rich clients by using the Struts or Web services frameworks.