Console based messenger! In Java.
Well, I got it working on Friday! Determining a best-practice way to connect up the command objects, command factories, and chain of responsibility took up the majority of the time I spent last week. It turned out that I needed a higher level I/O class on top of all of these. It would hold a socket, open streams, and then depending on the state of the socket, route user input to a stream, or the chain of responsibility. The chain of responsibility contained factory classes that would generate commands, which the I/O class would run, in order to open connections and streams.
Java's console is a little inflexible, though. When a user sends a message, the input is moved up a line. For clarity's sake, the message also gets printed through System.out, preceded by "You: ". The problem is that it looks messy:
hello world
You: hello world
I've looked and looked, but I can't find a way to hide or clear System.in after a user hits enter. My only idea at this point is to find a curses-like api to handle what the console should look like. It could be a fun way to learn a bit about GUI programming!
On the other hand, I could continue on my Snake clone that I've been working on with JavaFX. The problem is that I started it during my first week of Java training. The code is messy, to say the ABSOLUTE least, and I dread opening it up. It was itself an experiment in learning to code with a GUI involved, so if I continued with the messenger, I would probably be learning the same things, only with a cleaner codebase to work on. Time to do some thinking.