Services Design Principles
The following guidelines elaborate on services design
principles for designing flexible,
extensible and maintainable systems
Services Design
Principles
The following guidelines elaborate on services design
principles for designing flexible,
extensible and maintainable systems
1.
Services are named to maximize consumability -
Services should be named using
nouns,
operations should be named using verbs.
2.
Services
have well-chosen granularity - To determine service granularity while
designing
services, consider factors like maintainability, interoperability, consumability,
and
performance.
3.
Services are cohesive and complete - The
noun-verb naming convention for services
and
operations tends to help us focus on the functional cohesiveness of the service
interface.
We can ask the question, "Is the verb something that the noun does?”
Completeness
is particularly relevant when creating a service for a known consumer
and
the focus is on meeting the requirements of the consumer.
4.
Services encapsulate implementation details -
The OO design principle encapsulation
also
applies to designing service interfaces. By encapsulating details of service
implementation
-- the algorithms and resources used -- the decoupling between
service
consumer and provider is improved and hence future flexibility is improved.
5.
Services accommodate multiple invocation
patterns - service technologies enable a
further
level of encapsulation. A service consumer can use identical coding techniques
to
invoke
services using a variety of different invocation patterns such as
A) Synchronous
invocation using SOAP over HTTP(S),
B) Asynchronous,
messagebased invocation using SOAP over JMS
C) Local
invocation using Java method calls.
6.
Services can have stateless interfaces - Careful
service design can avoid the need for
stateful
conversations and simplify the implementation of a scalable, reliable SOA
infrastructure.
7.
Stateful
services can be modeled using state transitions - A technique for increasing
consumability
is to create service interfaces reflecting the states of the business life
cycle.
8.
Service operations represent business actions -
We should define operations with
specific
business meanings rather than generic operations.
9.
Service operations have coarse-grained
parameters - We recommend using coarsegrained
parameters
for creating flexible operations, enabling new versions of the
operation
to be provided without worrying about existing consumers.
10.
Service operations are designed for concurrency
- We recommend the use of an
optimistic
locking strategy, delegating responsibility for concurrency control to
appropriate
application logic.