Client/Server Design Pattern

Client/Server Design Pattern

Post by Randy Hawkin » Wed, 25 Feb 1998 04:00:00



I am looking for a design pattern for the following problem.  If anyone
can point me in the right direction, I would appreciate it.

2 client applications talking to 1 server via CORBA.
Both clients make a call to the server for a list of names and phone
numbers.
Both clients display the list in their GUI list box.
Client A sends a message to the server to delete/edit a certain record.
Server updates the database
Client A is aware of the changes so it is able to display the changes
How is client B supposed to be notified of the change?

I don't want Client B to have to poll the server due to performance
reasons.

Thanks,
Randy Hawkins

 
 
 

Client/Server Design Pattern

Post by Pete McBree » Thu, 26 Feb 1998 04:00:00




Quote:> I am looking for a design pattern for the following problem.  If anyone
> can point me in the right direction, I would appreciate it.

> 2 client applications talking to 1 server via CORBA.
> Both clients make a call to the server for a list of names and phone
> numbers.
> Both clients display the list in their GUI list box.
> Client A sends a message to the server to delete/edit a certain record.
> Server updates the database
> Client A is aware of the changes so it is able to display the changes
> How is client B supposed to be notified of the change?

> I don't want Client B to have to poll the server due to performance
> reasons.

The design pattern you need is the Observer Pattern as documented in
"Design Patterns" by Gamma, Helm Johnson & Vlissides.

Since you have CORBA, the "CORBA Design Patterns" book by Mobray and
Malveau has some discussion about how to do Observer style Notification.

Basic Solution is to have all clients request change events for any
information that they are cacheing locally. The server then notices the
requested changes and sends the notification event to the interested
parties.

--
Pete McBreen, McBreen.Consulting , Calgary, AB
http://www.cadvision.com/roshi
Using Creativity and Objects for Process Improvement

 
 
 

Client/Server Design Pattern

Post by Paul Ilechk » Thu, 26 Feb 1998 04:00:00



> Client A sends a message to the server to delete/edit a certain record.
> Server updates the database
> Client A is aware of the changes so it is able to display the changes
> How is client B supposed to be notified of the change?

Assuming that client B actually gives a damn (not necessarily true),
then this is a publish and subscribe kind of problem. It's how people
like market data vendors get the lastest info to the relevant desktops.
Corba has a couple of sevices (Event, Notification) that have some
relevance here.

        Paul.

***************

Paul Ilechko          
http://www.transarc.com/afs/transarc.com/public/pilechko/homepage.htm

 
 
 

Client/Server Design Pattern

Post by Randy Hawkin » Fri, 27 Feb 1998 04:00:00


I found since posting the message that the Event Service possibly
answers my problem.  If the ORB supports it, the clients connect to the
event service and the server will post messages on the event service
when there is a chnage the clients should know about.  I believe this is
the solution...need to do more research (the CORBA design patterns talks
about it).
Thanks for the replies!

Randy


> I am looking for a design pattern for the following problem.  If
> anyone
> can point me in the right direction, I would appreciate it.

> 2 client applications talking to 1 server via CORBA.
> Both clients make a call to the server for a list of names and phone
> numbers.
> Both clients display the list in their GUI list box.
> Client A sends a message to the server to delete/edit a certain
> record.
> Server updates the database
> Client A is aware of the changes so it is able to display the changes
> How is client B supposed to be notified of the change?

> I don't want Client B to have to poll the server due to performance
> reasons.

> Thanks,
> Randy Hawkins