The idea of generating code is pretty old. Following the rule "Three Strikes and You Automate" (see [ThreeStrikes]), this is a common mechanism to avoid doing the same work again and again. However, to be a bit more concrete, let's dig deeper into the general concepts of code generation and model-driven software development for services. (For further details on this topic see, for example, [StahlVölter06].)
If you compare two hard-coded implementations of a service (or of a service call), you can identify three types of code:
Generic code that is the same for each implementation. For services, this might, for example, be code that logs the service name and processes other common technical data. If it is possible to process parameters in a generic way (using Java reflection, for example), such code also falls into this category.
Schematic code that has the same structure but varies somewhat according to the concrete situation. For example, in order to map all service parameters to an API with specific data types, schematic code would process each parameter using its specific name and type, whereas generic code would loop over the set of all parameters in a generic manner.
Code that has no commonalities. For services, this typically applies to the concrete implementation of the specific functionality of a service.
Frequently, the same task can be performed using either generic code or schematic code. The following example highlights the difference between ...