O'Reilly logo

SOA in Practice by Nicolai M. Josuttis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modeling Services

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].)

Terminology

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required