Information Technology Reference
In-Depth Information
ator uses one machine during the shift and must look up or create cus-
tomer records whenever he or she answers the phone. Your design task is
to determine the most efficient set of objects to transfer between client
machines and the server.
Yo u c a n b e g i n b y e l i m i n a t i n g s o m e o b v i o u s c h o i c e s . R e t r i e v i n g e v e r y c u s -
tomer and every order is clearly prohibitive: 1 million customers and 15
million order records are just too much data to bring to each client. You've
simply traded one bottleneck for another. Instead of constantly bom-
barding your server with every possible data update, you send the server a
request for more than 15 million objects. Sure, it's only one transaction,
but it's a very inefficient transaction.
Instead, consider how you can best retrieve a set of objects that can con-
stitute a good approximation of the set of data that an operator must use for
the next several minutes. An operator will answer the phone and be inter-
acting with one customer. During the course of the phone call, that oper-
ator might add or remove orders, change orders, or modify a customer's
account information. The obvious choice is to retrieve one customer, with
all orders that have been placed by that customer. The server method
would be something like this:
public OrderDataCollection FindOrders( string customerName)
{
// Search for the customer by name.
// Find all orders by that customer.
}
Or is that right? Orders that have been shipped and received by the cus-
tomer are almost certainly not needed at the client machine. A better
answer is to retrieve only the open orders for the requested customer. The
server method would change to something like this:
public OrderData FindOpenOrders( string customerName)
{
// Search for the customer by name.
// Find all orders by that customer.
// Filter out those that have already
// been received.
}
Yo u a r e s t i l l m a k i n g t h e c l i e n t m a c h i n e r e q u e s t d a t a a t t h e s t a r t o f e a c h
customer phone call. Are there ways to optimize this communication
Search WWH ::




Custom Search