Download Chapter 4 - Amazon Web Services

Transcript
104
CHAPTER 4
Service design and documentation policies
get all the services registered, you can quickly track any duplication in your service
portfolio and perhaps remove the duplication.
4.3.2
Decoupling the transport layer from the logical layer
One of the best ways to make sure your services can be reused is to decouple the technical transport layer from the implementation
of the business logic. Figure 4.11 shows a
logic layer that can be accessed by multiple
remoting technologies.
If you keep the business logic of your service separated from the technical communication details, you can create additional
Figure 4.11 Decouple the remoting
remoting interfaces if needed and reuse your
implementations from the logic of a service.
existing business logic.
In figure 4.12 you can see the responsibilities of these two layers. The remoting
layer takes care of any protocol negotiations and message transformation and then
connects to the business logic using the internally provided interface.
4.3.3
Service discovery
When you want other consumers to use your service, it’s important that they can easily
find your service. This can be done in many different ways. You can give your consumers access to your repository and let them browse through the services registered
there. That way they can quickly find what they’re looking for and manually configure
their clients. There are also other options. The WSO2 service registry provides a
simple-to-use client that your consumers can use to access the repository programmatically. In section 4.1.2 you created documentation for the PermitService and added
this along with the service to the repository. In the next few pages I’ll show you how
you can search for this resource using two different methods:
■
Searching for specific tags—When you have a lot of services and resources and
you’re interested in a specific kind of resource, it’s useful to search based on
Figure 4.12
The responsibilities of the remoting layer and the logic layer