Request-response pattern.

I'm going ahead with a request-response pattern for my client server communication.

I guess that statement is somewhat generic though so I'll describe my implementation a bit more.

For each action to which I need to contact the server I'm creating a request and a response object. Those objects inherit from the message container class which is a container for the message union.

The message container has basic utility functions to aid the child classes in manipulating & reading message data. This allows safe access to data inside the message union. Direct access to the message union could get pretty tricky and although probably more efficient in the long run would produce difficult to diagnose bugs.

Anyway each child class of the message container will have named properties for each of the messages attributes so the rest of the application doesn't need to know how the data is stored in the message. This also allows from some measure of data sanitizing to be enforced across the application.

Right now the way things are structured I have to duplicate the message classes in both the client and server projects. That seems like it will be quite a burden later. I'm thinking about making another project that will be a static library so both client & server can share those classes. I'm still only thinking about it though. I'm going to need to make a decision soon as I will soon need to finish the Movement managers on both sides and adding stubs for the authentication manager.

My goal for 0.1.0 is to be able to run around and chat with the other players. I think I'm in the home stretch of that goal. The trick is just putting the time in.

For those of you that don't know the full source of this project is available on source forge.
http://phoenixkit.svn.sourceforge.net/viewvc/phoenixkit/Enigma/

By the way just in case any of you didn't realize you can post comments on these posts. :-)

Comments

Popular posts from this blog

VK9 - Milestone8 Completed

VK9 - Milestone13 Completed

VK9 - Milestone16 Completed