Jump to content

Service granularity principle

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 84.133.135.23 (talk) at 15:36, 29 September 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Service granularity is a key design concern when applying the paradigm of service-orientation and in service-oriented modeling. Service granularity specifies the scope of business functionality and the structure of the message payload in a service operation that is provided within a Service-oriented architecture

Definition and criteria

By definition a coarse-grained service operation has broader scope than a fine-grained service, although the terms are relative. The former typically requires increased design complexity but can reduce the number of calls required to complete a task.[1]

Many forces influence the service granularity; four particularly relevant factors to consider when designing for an adequate granularity are performance, message size, transactionality and business function.

Performance

Web services are accessed remotely and calls to web service operation create more network overhead. Reducing the number of service requests reduces that overhead.

Message size

Coarse-grained services may pass more data than fine-grained services, including data that is not specifically required for the task. Reducing message size may require adding a more fine-grained operation.

Transactionality

For conceptual clarity each service operation should perform a single transaction. This also simplifies error recovery, and typically eases design.

Business function

Ideally, each service operation maps to a single business function, although if a single operation can provide multiple functions without adding design complexity or increasing message sizes, this generality can reduce implementation and usage costs.

References

  1. ^ Josuttis, Nicolai (2007). SOA in Practice. Sebastopoal, CA, USA: O'Reilly. ISBN 978-0-596-52955-0.