Java Reference
In-Depth Information
Making a Service Composable
Problem
You want to make sure that your service is designed in such a way that it can be reused within
a composition.
Solution
Do not tie your service interface or implementation to any specific business process. Instead,
move business process-specific code into an orchestration or new process service.
Discussion
A composed service is an aggregate of other existing services. While you can realize reuse for
a service by invoking the same service from different applications, a service is composable if
it is defined in such a way that it can be reused by inclusion within another service's imple-
mentation.
There are two matters here: the service interface must not negatively impact its composability,
and its implementation must not inadvertently do so either. In order to provide business value,
a service must perform work specific to some business use case. But you must consider the
distinction between the execution of a specific unit of work (a service call), and the workflow
around that operation that makes it available and valuable to the business in the form of some
given business application.
The general idea of composability in software is not very different from its colloquial use.
Because of their design, Lego bricks can be used to form a variety of exciting shapes. A Java
Address class can be used to compose both an Employee object and a Company object. Like-
wise, the composability of services must be included as an initial consideration in the design
process.
Consider a software company. There programmers type code on different, specific aspects of
the system—one for user interface, one for database, and so on. These are roughly analogous
to the member services. Then there are the programming managers. They don't type anything
into an IDE, but they coordinate the activities of their employees to ensure that eventually all
of the programmers' efforts are incorporated as features in the single software product that
customers are interested in. Each programmer does important work on his own, but the addi-
tion of the manager presents an interface to the business that coordinates the activities, as a
Search WWH ::




Custom Search