A client is never allowed to update the application's data by itself. When a bank's client wants to transfer money between his accounts, the bank does not lend him its account records, hoping the client will not make any mistake substracting the same amount from an account then adding it to another. Instead, the client is asked to fill a transfer request, and the account records are updated by the bank's clerk.
This is the philosophy behind the design of our service requests:
public class TransferServiceRequest
{
/// <summary>
/// The client requesting the transfer.
/// </summary>
public ClientRequestElement Client;
public class ClientRequestElement
{
public int ClientID;
}
/// <summary>
/// The requested transfer.
/// </summary>
public TransferRequestElement Transfer;
public class TransferRequestElement
{
public string FromAccountNumber;
public string ToAccountNumber;
public decimal Amount;
}
}
This approach allows the bank to apply business logic when performing service requests, such as charging fees for transfers less than a thousand dollars.
Tuesday, July 29, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment