Use observer pattern for the server.
Use the observer pattern in the client class too.