Components
Use
Complex BSP applications that are based on the MVC Design Pattern have many extensive components. Each individual part, consisting of a complex BSP application, contains precise application logic and well thought out presentation logic. It makes sense to create the individual BSP components as reusable modules. These reusable modules are:
-
Controllers
-
One or more views
-
A Model
Together they form a component.
Integration
The use of components is integrated in the MVC design pattern.
Prerequisites
You are in SAP Web AS 6.20.
Features
A component consists of a controller, whose class is derived from CL_BSP_CONTROLLER2, as well as one or more views, which can result in regular nesting. This is outlined in the following graphic:
Central features of components are:
-
With components, there are complex call sequences during an HTTP request.
-
The individual parts, of which a page in the browser consists, are dynamically assembled during runtime.
-
One component can call a different component. It should therefore be placed in a view. This is done using the <bsp:call> element.
-
Initialization can be called by the controller using method create_controller. This method is available for all controller classes. It creates a controller or finds an existing one.
-
The parent controller contains a list of the individual subcontrollers and forwards all input to the relevant controller. This is done by prefixing all IDs with the path of the controller IDs.
-
The controller has a hierarchical tree. Every controller controls its view or views, its model as well as the list of subcontrollers.
-
Basis class CL_BSP_CONTROLLER2 controls the subcontrollers. The controller developer is responsible for controlling the view and the model.
-