| < Day Day Up > |
|
In this section, we focus on best practices for Web services development and deployment within a J2EE environment, that is, Web services that are built using servlets, JSP pages, EJB architecture, and all the other standards that are part of the J2EE technology.
These best practices include:
Apply distributed computing principles
Think of Web services as another technology for developing distributed systems.
Design systems that are layered.
It is especially important in Web services applications where we do not have control over some components (services) that we access in our application.
Design coarse-grained Web services.
Requesting a service from a machine over the network is more expensive than a local operation. Keep the request as coarse grained as possible when requesting a Web service from a remote machine, thereby avoiding unnecessary network traffic and overhead on the communication stack.
Design for "loosely coupled" components.
Because a Web service is by definition an interface to a loosely coupled component on a remote system, define clear contracts between layers and services, but utilize the "Parameter List" paradigm where possible.
Limit dependency on other components.
Common dependencies to be avoided are Call flow dependency and Object association dependency. Implement all cross "domain" business processes in a "control" or "workflow" layer.
Utilize standard XML structures to pass data, where possible using a standardized structure and meaning.
Use existing Web services tools, such as WebSphere Studio Application Developer.
This allows you to expose assets and services using WSDL and proxy-generation tools, which shield you from the underlying XML messages in Web services.
| < Day Day Up > |
|