While application services are responsible for representing technology and application logic, the business service layer introduces a service concerned solely with representing business logic, called the business service (Figure 9.4).
Figure 9.4. The business service layer.
Business services are the lifeblood of contemporary SOA. They are responsible for expressing business logic through service-orientation and bring the representation of corporate business models into the Web services arena.
Application services can fall into different types of service model categories because they simply represent a group of services that express technology-specific functionality. Therefore, an application service can be a utility service, a wrapper service, or something else.
Business services, on the other hand, are always an implementation of the business service model. The sole purpose of business services intended for a separate business service layer is to represent business logic in the purest form possible. This does not, however, prevent them from implementing other service models. For example, a business service also can be classified as a controller service and a utility service.
In fact, when application logic is abstracted into a separate application service layer, it is more than likely that business services will act as controllers to compose available application services to execute their business logic.
Business service layer abstraction leads to the creation of two further business service models:
When a separate application service layer exists, these two types of business services can be positioned to compose application services to carry out their business logic. Task and entity-centric business services are explained in more detail in the Deriving business services section in Chapter 11.
Note that the hybrid service we introduced previously is actually a service that contains both business and application logic. It is therefore often referred to as a type of business service. For the purpose of establishing specialized service layers, we consider the business service layer reserved for services that abstract business logic only. We therefore classify the hybrid service as a variation of an application service, making it a resident of the application service layer.
Of the TLS services we've discussed so far in our case study examples, the following are true business services:
Each represents a well-defined boundary of business logic, and whenever one of these service's operations needs to perform a task outside of this boundary, it reuses functionality provided in another business or application service.
As we mentioned earlier, RailCo's Invoice Submission and Order Fulfillment Services are hybrid in that they contain both business rules and application-related processing. This type of service is very common in organizations that only incorporate services peripherally. Either way, for modeling purposes, these two services are classified as hybrid application services. Because business logic is not explicitly abstracted, only an application services layer exists within RailCo.
SUMMARY OF KEY POINTS