Re: Pattern/s sought for chat client implementation
On Aug 14, 5:44 am, Karsten Wutzke <kwut...@web.de> wrote:
I'm developing a chat client and I'm looking for the right pattern for
the object/s that handle the messages between the client and server.
The users can participate in several chats at once. You can think of
it as an IRC client basically, much like ICQ, MSN, AIM or such, just
with many people in a chat (chatroom).
I'm currently looking at the Proxy pattern. Don't know if I might need
a Facade pattern, Chain of Responsibility pattern doesn't seem to
apply, but I'm not sure if I'm on the right track here.
That object being responsible will likely need to dispatch the
incoming messages to the respective chat windows.
Can anyone give some assistance please?
Since the client is implemented in Java what other classes/packages
might be important to mention?
Generally, you don't start out looking for patterns to implement, you
think about how you want to implement it, and the see which patterns
that implementation is like.
If all your chat client/servers are always going to be java, you might
If you want to define your own wire protocol, then you should instead
define that protocol first, and implement an API that lets you send
and receive messages.
Something as simple as a chat client/server shouldn't be over
Basically, you might have something like:
A shared library: Contains necessary code to send and recieve messages
A client: Presents the messages and actions to a user
A server: Recieves a messages, processes them, and sends them back out
to the clients.