The Service Builder uses patterns to separate between the generated logic and your own code.
It generates two types of classes:
Base Class
The base classes contain the Service Builder generated logic. The logic in the base class is overwritten every time the project is regenerated.
Do not modify the code in this class, as the Service Builder overwrites its contents.
Extension Class
The extension class names have the suffix, EXT. An extension class is a subclass of the base class that is created once, only when the project is generated for the first time.
An extension class contains no logic. Service Builder provides the extension class for you to write own code.
Regenerating the project does not overwrite your code in the extension class. You provide own logic (typically for the DPC) by redefining the method you wish to modify.
When the classes are created, they are listed in the Runtime Artifacts folder of the project, as follows:
Model Provider Class (MPC): Two classes are generated for the MPC.
These are:
MPC Implementation Class : An automatically generated class for an inherited MPC class of the specific model. You can modify the code to suit your needs.
MPC Base Class : An automatically generated class for the MPC superclass of the specific model.
You cannot modify the code. The inherited MPC class is derived from this superclass.
For more information, see Overview: Generated Classes for Model Provider Class.
Data Provider Class (DPC): Two classes are generated for the DPC.
These are:
DPC extension class:
An automatically generated for an inherited DPC class of the specific model. You can modify the code to suit your needs.
DPC base class:
An automatically generated class for the DPC superclass of the specific model.
The inherited DPC extension class is derived from this superclass..
You can edit and modify the names of the classes before they are generated.
After the classes have been generated, their names cannot be modified.
For more information, see Overview: Generated Classes for the Data Provider Class.
Annotation Provider Class (APC): Two classes are generated for APC.
APC Implementation Class : An automatically generated class for an inherited APC class of the specific model. You can modify the code to suit your needs.
APC Base Class : An automatically generated class for the APC superclass of the specific model.
You cannot modify the code. The inherited APC class is derived from this superclass.
For more information, see Generating Classes for Annotation Provider Class.
APC Classes are generated only for the projects of type Annotation Model for Referenced Service, whereas MPC and DPC classes are generated only for the projects of type Service with SAP Annotations and Service with Vocabulary-Based Annotations. The extension classes of the MPC, DPC and APC are called at runtime, respectively.
Registering the Service
You must specify the following details to enable the Service Builder to automatically register both the model and the service, and to assign the model to the specific service:
Technical Model Name:
Specifies the name of the data model. The name must be unique. The data model is described in the Model Provider Class, which provides the metadata for the service.
Technical Service Name
Specifies the name of the service. The name must be unique.
The Technical Service Name that you specify will determine the name of the service that will be exposed by SAP Gateway.
You can modify the registration information using the activities of the OData Channel implementation guide (IMG) in the back-end system.
To modify the registration information:
Use transaction SPRO, and open the SAP Reference IMG.
Choose
.Display service window appears and you can modify the information.
After creating and registering the model and the service, the Service Builder assigns them to the same transport request used for generating the classes.
If the Service Builder fails to create the model and the service, an error message displays.