Chapter 3 Service Endpoint Design
71
E
Generally, you should consolidate related fine grained operations into more
coarse grained ones to minimize expensive remote method calls.
More coarse grained service operations, such as returning catalog entries in
sets of categories, keep network overhead lower and improve performance. How
ever, they are sometimes less flexible from a client's point of view. While finer
grained service operations, such as browsing a catalog by products or items, offer
a client greater flexibility, these operations result in greater network overhead and
reduced performance.
E
Keep in mind that too much consolidation leads to inefficiencies.
For example, consolidating logically different operations is inefficient and
should be avoided. It is much better to consolidate similar operations or opera
tions that a client is likely to use together, such as querying operations.
E
When exposing existing stateless session beans as Web service endpoints, en
sure that the Web service operations are sufficiently coarse grained.
If you are planning to expose existing stateless session beans as Web service
endpoints, remember that such beans may not have been designed with Web ser
vices in mind. Hence, they may be too fine grained to be good Web service end
points. You should consider consolidating related operations into a single Web
service operation.
Good design for our airline reservation Web service, for example, is to expect
the service's clients to send all information required for a reservation destina
tion, preferred departure and arrival times, preferred airline, and so forth in one
invocation to the service, that is, as one large message. This is far more preferable
than to have a client invoke a separate method for each piece of information com
prising the reservation. To illustrate, it is preferable to have clients use the inter
face shown in Code Example 3.1.
public interface AirlineTicketsIntf extends Remote {
public String submitReservationRequest(
AirReservationDetails details) throws RemoteException;
}
Code Example 3.1
Using Consolidation for Greater Efficiency (Recommended)
footer
Our web partners:
Inexpensive
Web Hosting
Java Web Hosting
personal webspace
webspace php
linux webhost
html web templates
DreamweaverQuality Web Templates
PSD Web Templates
cheap webhost
j2ee web Hosting
buy webspace
ftp webspace
adult webspace
frontpage WebHosting
webspace hosting
cheap webhost
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved
webhosting