Leveraging the Faux Implementation in the Case Study

The applications you build for the P.T. Monday Coffee Company do not directly use faux implementations ; instead, you should expect that clients of the Web Services may use the faux implementation. Clients will use it to lighten the burden of some of the more complex client requirements, such as the event delivery mechanisms. Individual developers may choose to use the Faux Implementation pattern as a means to simulate external Web Services without actually connecting to them or simply as a mechanism to alleviate dependencies on other developers.

In the final deployment of the application, the logic tier is physically separated from the Web tier, as shown in Chapter 13, "Exploring the Physical Tiers Pattern." Your clients simply reuse the logic tier . This reuse facilitates your client's ability to receive Web Service events directly from Java. Your Java clients also have the benefit of a full Apache Axis deployment available to them, so they can easily leverage this deployment and expect full support from the Information Technology (IT) department.

Identifying Important Classes and Files in the Case Study

This is the final example in the book that uses the EventService Web Service built in Chapter 12, "Implementing the Publish/Subscribe Pattern." In this sample, you do not need a Web Service subscription implementation, so there are no additional Web Service deployments beyond the EventService deployed in Chapter 12. Table 14-1 contains the client-side Java implementations available from the downloaded source.

Table 14-1: Sample Location






The main program that contains the event service registration, shown in Listing 14-4, and that spawns a thread containing an instance of the FauxWebServiceSubscriber



The Runnable class, from Listing 14-3, that implements the acceptance of Web Service requests and processing of the service responses

Using Ant Targets to Run the Case Study

There are only two steps to this sample; the first starts the client, and the second publishes events to the EventService Web Service presented in Chapter 12, "Implementing the Publish/Subscribe Pattern." The client prints out each event published to the event service. Table 14-2 contains the Ant targets for running the client and publishing an event to the event service.

Table 14-2: Ant Targets




A small graphical client that subscribes to the event service (deployed in Chapter 12) and receives notifications


Publishes an event to the already deployed event service (deployed in Chapter 12)

Web Service Patterns
Web Services Patterns: Java Edition
ISBN: 1590590848
EAN: 2147483647
Year: 2003
Pages: 190

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net