Coder's Guild Mailing List

Re: Data Structures

Posted by Eian on 2000-09-28

My first suggestion off the top of my head, and something that pertains to
all of computer programming in general is to make sure that you modularize
your code. In this example, if you chose to go with a different back-end
if you had your code broken up properly it wouldn't be a hair pulling task
to change it all.

As far as a back-end goes, without knowing more of the specific
specifications of your proposed project my gut instinct would be to
recommend that you look into using JDBC as a back-end to store user
information and perhaps communication between your threads for information
like chatting. (It is going to run over the Internet correct? TCP/IP would
be a good means of communication between client-server.)

Hope this helps,

Eian

> Hello,
>     I am planning on writing a multithreaded server in Java.  I have a
> question about storing information.  When the user connects to my server I
> want to store his/her information (name, nickname, etc).  What type of data
> structure should I use for this?  I want to be able to quickly add users to
> the data structure and quickly find them, order does not matter.  This is
> actually going to be a client-server chat program, so when one person says
> something I want it echoed to the rest of the connected users like so:
> 
> BillyBob says: Hello everyone.
> 
> So i need a way of storing what he said and passing it to the server to echo
> to everyone connected (it's multithreaded).  How would I go about doing
> something like this?  Or is there a better way?  Thanks for any help.
> 
> Kory Spansel
> 
> > 
> 

                      -=-=-=-=-=-=-=-=-=-
         And if the dam breaks open many years too soon
             And if there is no room upon the hill
          And if the cloud bursts, thunder in your ear
       And if your head explodes with dark forbodings too
           I'll see you on the dark side of the moon
                          -Pink Floyd
                      -=-=-=-=-=-=-=-=-=