Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating an online chat

Status
Not open for further replies.

Goha

IS-IT--Management
May 9, 2002
91
US
I am new to XML (like a baby is to the world) and I would like to learn it on my next project.

How would I do the following :

create an online chat forum where users can log-in and chat in a forum simmilar to NetMeeting, MSN Messenger, or AIM.

I do not know where to begin and have not done anything like this before. I have worked on java applications not applets.

Thanks a bunch [wavey]
 
ok, so what technology are you wanting to use? I suggest you stick to what you know, java, and choose a variety of java that you feel comfortable with.

XML in its self will not be enough to create an online chat program, so I suggest you model the chat program like you would any other java program. For example, you will have a number of USERs who have ACCOUNTs and exist in different chat ROOMs within which each user can chat with everyone in this room.

The part where XML will come into its own is when you are storing information about the chats. Think about how XML will help you solve the communications problems, dont just use it because its a buzz word. Try out a number of xml parsers for your chosen technology. XML may be useful, for example, in storing what people are saying in each chat room instead of databasing the whole lot. I suggest you do use a database, however, because although xml is good its not that fast at databasey type things.


Anyway, hope this helps a little.

Matt
 
Second question :)
When you say online do you mean as in part of a web page or merely as an internet enabled application?

If you are going for the web based then I would stick with a server-side scripting language(JSP, PHP, ASP, etc) and a database(mySQL, MS SQL2000, etc).

If, however, you are writing your own chat application that will not run (initially) through the web browser, then I would highly recomend using XML. Here is the idea. If you write a server/client pair of applications, you can then pass all communications in XML format. All communications has to be flagged somehow, whether it is a request to log on, a text message, a private message, whatever. XML can help you clarify your messages that are going back in forth between your client and server, as well as create later versions of your chat program that are interoperable with the original.
What you will want to do is create an xml format that all of your message will follow. SA very simple format for communications is that all communications will be enclosed in <mychat> tags. The perhaps you will want <messagetype> tags and <message> tags inside of that. Perhaps you want a <recipient> tag inside your message tag as well as a <messagebody> tag. See how this is going?
My advice would be to write a small chat program with a simple xml vocabulary. This should get you used to working with an XML parser of some sort in Java. After using a parser in Java I found that I had a pretty good grasp on the basics and was able to move on to XSL, MSXML DOM, and several other parsers.
Another good project is to try and create your own visual representation of an XML page. perhaps you want to recreate a tree view similar to something you have seen somewhere before? Write or steal an xml file from somewhere and then try to write a program to parse through the file creating a tree view. Then take it a step further, make it editable and saveable. By the time you have completed that you will be bald (hair pulling) but you will have a very good grasp on the concepts behind XML and XML parsers.
Just remember xml is a data description language, not necessarally a data storage or content description language.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top