You explored the Service Factory pattern in this chapter. The service factory is a derivative of common object-oriented Class Factory patterns, likely originating with the Abstract Class Factory pattern. The Service Factory pattern will
In this chapter, you applied the Service Factory pattern to a business process. In most cases, the pattern applies best to business processes,
The Service Factory pattern can apply to any of the four base types and can be enhanced in a variety of ways:
Business Object, Business Object Collection, Business Process, and Business Process Factory: Each of the primary structure types in aWeb Service environment can benefit from a service factory implementation. The Service Factory pattern applies when you connect to a Web Service without knowing the address of the Web Service before build time.
Service Cache: The Service Cache pattern decouples the responsibility of maintaining service access points for use in the service factory from the service factory. Instead, you deploy a separate component that
interactswith UDDI and the UDDI notification mechanisms to maintain a list of valid access points. This pattern is not documented within this chapter, but it will be available from SourceForge after the book's publication.
Carey, James; Carlson, Brent. Framework Process Patterns: Lessons Learned Developing Application Frameworks . Addison-Wesley, 2002.
Carey, James; Carlson, Brent; Graser, Tim. San Francisco Design Patterns: Blueprints for Business Software . Addison-Wesley, 2000.
Fowler, Martin et. al. Patterns of Enterprise Application Architecture . Addison-Wesley, 2002.
Gamma, Erich et. al. Design Patterns: Elements of Reusable Object-Oriented Software . Addison-Wesley, 1995.
The previous two chapters discussed mechanisms for optimizing a client's use of a Web Service. You will find that, in practice, Web Service operations are relatively expensive when compared to a local method call between objects in the same process. Consider Figure 16-1 (previously shown as Figure 4-2). A communication
Figure 16-1: Web Service architecture
The first leg of a trip in a call from the ArchitectureAComponent component to the ClientAdapterA component typically traverses the A architecture's communication mechanism. The ClientAdapterA component transforms the call to the Simple Object Access Protocol (SOAP) format and traverses a Hypertext Transfer Protocol (HTTP) path to the ClientAdapterB component. There, ClientAdapterB transforms the call from SOAP to the ArchitectureBComponent 's format and communication mechanism. After receiving a response from the target component, the return trip duplicates the path through SOAP and HTTP. You can probably see how this path is a little more expensive than a local method call.
Now, consider a target object with five different values you would like to retrieve, each with a get operation. This is five separate Web Service calls: 10 trips through SOAP, 20 communication mechanism conversions, and 10 traversals through the HTTP protocol ”all for five values. If the Web Service developer
This value proposition is the motivation for the Data Transfer Object and Data Transfer Collection patterns. The Data Transfer Object pattern became a heavily used pattern over the past five
Often, information in this chapter applies to both the Data Transfer Object and the Data Transfer Collection patterns; in these cases, this text refers to the pair of patterns as simply the Data Transfer patterns.