[Irc4j-developers] Some basic thoughts...
Status: Planning
Brought to you by:
maartenc
From: Carsten R. <car...@we...> - 2001-12-20 11:19:58
|
Hi! I don't know if anybody else is reading this ML and if someone is developing irc4j at the moment. If so, please write me, because I don't want to reinvent the wheel a second time... Now I'll give you a overview on my thoughts on implementing the IRC protocol in java. Some weeks ago, I decided to skip the boring lessons at the university and get deeper into Java with a project on my own. I'm IRC-addicted so the best choice for me was to program an IRC client. I've started with the connection to an IRC server with a Socket Connection. That was pretty easy. The class "IrcConnection" just opens the socket to the server and creates a PrintStream to write to that server. Additionally, the class has a private method to register the connection using the USER and the NICK command. After registering the IRC connection is valid and all IRC command can be send to the PrintStream. I try to draw a UML diagram for the class IrcConnection (it's my first UML): +-----------------------------+ | IrcConnection | +-----------------------------+ | -myHost | | -myPort | | -myNick | | -mySocket | | -myServerStream | +-----------------------------+ | -connect() | | -register() | | +close() | +-----------------------------+ Please, give comments, if anything I do is not usefull or just stupid. ;-) So this class only opens the connection and registers it. Next step for me is programming two other classes: IrcChannel and IrcUser IrcChannel will be responsible for communication with a special channel and IrcUser for communication with a special user. This seems to be useful to me at the moment, but perhaps it is not very useful for a client. Now comes the big problem: The response from the server. My first try was to create a thread, which listens to the output from the server and prints it to STDOUT. That's good for the first few steps, looking at the responses to get a feeling about the IRC protocol. But later on I wanted the thread to print the responses into an JTextArea, and that was really complicated. An instance of the Frame (in which the JTextArea is) had to be reached down to the IrcConnection, to make it possible that the thread writes into it. It looked like really bad programming style and surely it was. For now I'll concentrate on the IrcConnection, IrcChannel and IrcUser. I will set up some web pages with my code as HTML and pure Java-Code, with some UML diagrams and some docs. As in your notes from the kickoff-meeting I'll write javadoc from the start. Anyway, I'll try to keep a tex file up to date. I hope some developers wake up soon. ;-) Carsten Ringe -- car...@we... http://australien.home.pages.de/ ________________________________________________________________ Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13 |