Team LiB
Previous Section Next Section

Web Services

Web services are used in the facade layer to expose the Facade methods also as Web service methods.

The integration of Web services in the same class as the Facade class has both benefits and drawbacks. The major benefit is that the same code serves as both the Web services exposed method and the traditional method. The major drawback is that you cannot easily apply rules or validations that you may want to have specifically for the Web services, and not for your direct calls.

Therefore, it can sometimes be wise to have the Web services in a separate project, working as a Web service–facade in relation to the real facade. This solution makes it possible to apply Web service–specific rules to each method. The drawback with this solution is that now you have some extra code to maintain.

We have found that in most cases the use of one facade layer, both for direct calls and for Web services, is enough. There is seldom a need for a separate Web service project to host a Web service facade. See Chapter 6 for a more detailed description of Web services.


Team LiB
Previous Section Next Section