Kerry Sainsbury wrote:
> --- 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.
>
Thanks Kerry, do you know what the major risk factors are in implementing
something like this? To cut a long story short, this is to be more of a
messaging server but I was looking at using tables to hold the message
information and I will probably get a dll to handle the message server stuff,
or maybe even a service... :-) I am still playing at this stage as I am
writing the spec
Tony Sinclair
Holliday Group Limited
Christchurch
New Zealand
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz