--- Aaron wrote:
> No there (traditionally) is no back-channel from the database to
> the client...
>... one of the clear benefits to a 3 tier model

Just to explain a bit further (seeing as I'm apparently on a 3 tier
evangelical mission at the moment):

In a 3-tier model you would have a server application that, say,
places orders. It would have a couple of methods:

interface OrderPlacer {
   createOrder( customer : int; product : int; quantity : int );
   adviseNewOrder( newOrderClient : OrderClient);
}

Any application that wanted to create a new order would connect to the
OrderPlacer server, and call the 'createOrder' method. It would *not*
insert rows into database tables.

Any application that wanted to know about new orders would need to
implement the 'OrderClient' interface, which includes a 'newOrderMsg'
method, and would need to call the 'adviseNewOrder' method of the
server, passing itself as an argument.

class SomeApplication implements OrderClient {
   procedure newOrderMsg( customer : int; 
                          product : int;
                          quantity : int );
}

The constructor, would call 'OrderServer.adviseNewOrder( self )' and
the .adviseNewOrder method would add the OrderClient object to a TList,
and then whenever 'createOrder' gets called it would execute some code
something like this, to let everybody who's interested in knowing about
new orders:

procedure createOrder( customer : int; product : int; quantity : int )
begin
    [ code to update order tables snipped ]
    for i := 0 to OrderClientList.Count -1 do
       OrderClient( OrderClientList[i] ).newOrderMsg( customer,
                                                      product,
                                                      quantity )
end;

The client application then does whatever it wants with the information
pushed down to it from the server.

This is, if I recall correctly, an example of the GOF's Observer
pattern.

Hope this helps / enthuses somebody.

Cheers,
Kerry S
_______________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com.au address at http://mail.yahoo.com.au
or your free @yahoo.co.nz address at http://mail.yahoo.co.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to