Service Oriented Architecture Corner

Friday, April 22, 2005

7 - Service Interface Design

The best approach to service interface design is Top-Down approach. Start service interface design from business perspective even if the business logic components have already been implemented. Exposing existing non-service oriented components by simply wrapping with Web Service interface is not service-oriented design. For new implementations, if business requirements are well understood, service interface design and business logic components implementation can be done in parallel. The service interfaces can then be mapped to the components interfaces at the service provider (or service interaction) layer. Let me make this point a bit clearer and get back to the main point below. As I pointed out earlier, service design has two parts:

  • service interface design
  • Service implementation
Service implementation in turn consists of two parts:
  • Service provider (interaction) layer
  • Business logic implementation (processing) layer

There is a direct relationship between service interface and service provider (interaction layer). Utilities, such as WSDL-to-Java tool, that generate the provider layer artifacts from WSDL file can be used in that transformation. Similar tool can be used for .NET services. The provider layer is important in that you can do any pre-processing tasks before passing the request down to the business components for further processing. In terms of Web Services, this layer is also a service endpoint. From Java perspective, this approach is discussed in some detail in a book titled Designing Web Services with the J2EE(TM) 1.4 Platform : JAX-RPC, SOAP, and XML Technologies (Java Series).

Now you have got some high level details on the service design, let us get back to service interface design. I will discuss the details of service provider (interaction) and processing layers in my future postings. Proper service interface design requires considerations in the following areas:
  1. Granularity and Modularity
    This is to achieve compete business agility by incorporating agility into service interface design. Services should be at the right level of granularity from business function perspective while maintaining compose-ability and meaning within a business process context.
  2. Loose coupling and reusability
    Service should not impose a coupling between its consumer and its provider.
  3. Coarse-grained
    This is to make sure that performance overhead and complexity in service composition in business process are avoided by simply making the service interface coarse-grained.
  4. Self-contained
    This is to make sure that every interaction from consumers should not affect the service integrity (i.e. a service should not make any assumption of its consumers from both semantic and syntactic point of view).

I will try to give some details on these points in the future. Any comment?