I am designing a simple chat application (just for the kick of it). I have been wondering of a simple design for that chat application. To give you overview.. here are the r
I would suggest looking into messaging frameworks instead of using Observer pattern.
Take a look at this simple implementation which will be sufficient for your toy project - eventbus (no longer available). Alternatively you could go with full blown JMS implementation like ActiveMQ.
Basically it allows you to define a common bus to which you can register and unregister participants, and also send messages that all of the participants will see. The big advantage over observer pattern is the very low coupling between the participants - you don't register with each object to get his messages - you just register once with the bus. In addition you get asynchronous processing - let's say you have 1000 chat sessions - if you use observer it means that for each message to complete it will take to update 1000 sessions. With message framework message send is very quick, and notifying all 1000 sessions is done in the background.