28 Patterns: Implementing Self-Service in an SOA Environment
More realistically, there are many useful levels of service granularity in most
SOAs. For example, all of the following are services that each have a different
Technical Function Services (for example auditEvent, checkUserPassword,
Business Function Services (for example calculateDollarValueFromYen and
Business Transaction Services (for example checkOrderAvailability and
Business Process Services (for example openAccount, createStockOrder,
reconcileAccount, and renewPolicy)
Some degree of choreography or aggregation is required between each
granularity level for them to be integrated in an SOA.
A service can be any business function. In an SOA, however, it is preferable that
the function is genuinely reusable. In an SOA, the service can be used and
reused by one or more systems that participate in the architecture. For example,
while the reuse of a Java logging API could be described as
design time (when a
decision is made to reuse an available package and bind it into application code),
the intention of SOA is to achieve the reuse of services at:
Each service is deployed in one place and one place only and is invoked
remotely by anything that must use it. The advantage of this approach is that
changes to the service (for example, to the calculation algorithm or the
reference data it depends on) need only be applied in a single place.
Each service is built once but redeployed locally to each system or set of
systems that must use it. The advantage of this approach is increased
flexibility to achieve performance targets or to customize the service (perhaps
according to geography).
The service definition should encapsulate the function well enough to make the
reuse possible. The encapsulation of functions as services and their definition
using interfaces enables the substitution of one service implementation for
another. For example, the same service might be provided by multiple providers
(such as a car insurance quote service, which might be provided by multiple
insurance companies) and individual service consumers might be routed to
individual service providers through some intermediary agent.