CM10135 / Programming II: Assignment 2 (2004)
Build Your Own Chat Application
Assignment Date: Tuesday, 9 March. Due date: Thursday, 25 March at 4:00pm
This assignment is the second of four you will have in this course. Your
mark in Programming II is composed of 60% coursework, 40% exam.
The Basic Idea:
In this assignment you will be creating a GUI application that allows
people to chat with each other. This project should let you
develop and display your skills in GUIs, threads, networking and
handling exceptions. Of course, you won't know anything about
networking in the first week of the project, but you will have plenty
to do that week building the basic interface.
Note: Networking lectures start the week of 15 March, so you should just be working on the GUI and threading the first week!
Reminder on plagiarism:
Plagiarism occurs any time that you use someone else's ideas without
acknowledging them. Plagiarism is much, much worse than asking for help.
If you get help on any part of your assignment you should acknowledge
this in the comments.
This includes asking coursemates, tutors, or other staff, as well as
reading things in books or on the Internet. Say exactly where your
help came from, and exactly how much of the code is your own.
What to do:
- Remember to write an informal specification / requirements statement of your application before you start. You will probably want to draw the window(s) you want to build, and specify some classes.
- First, you want to build a GUI application with some labels, two large text panes and at least one button.
- One text pane is for typing into / sending messages, the other is for receiving messages.
- The labels should make it clear which is which.
- One button should let you quit the application. You might want to add other buttons too (see below.)
- Next, you want to implement the producer / consumer pattern (see the Sun tutorial) for the two text panes. When you enter text in one pane, you want it to be printed in the other.
- You can do this in real-time, or after you hit return, or after you push a button, your choice.
- Make certain that your labels make it obvious how to use your GUI!
- That's all you have to do for a minimal pass (see criteria below.)
- This next section won't make much sense until you've had your networking lectures.
- Add radio buttons to chose whether you are running a `client' or
a `server', and two little text boxes for your IP address & a port
number.
- Make your application work across a network, e.g. use it to have a chat between two BUCS computers.
- Be sure to do good exception handling, e.g. so you can tell if the client couldn't find the server.
- Getting a chat working across the network is all the functionality you need for a good pass.
- Add optional / creative features (see suggestions below) to get marks towards distinction.
Remember:
functionality alone doesn't get you high marks! There should be
good code layout, good comments, good documentation, and good exception
handling.
What to hand in:
- Your specification / requirements statement.
- A design for your solution, including especially the algorithms. Note that we expect this to have been written before you have done the coding, so it may have bugs in it!
- A printout of your fully-commented code. Poor program layout will lose marks.
- A short write-up of your experience getting your application to work.
- Include a screenshot of your GUI.
- Be sure to include instructions for how we can run your application, since will also be running your program to check on it.
- A conclusion that contains a critique of your program: What did
you do right? What did you do wrong? What would you do differently
if you did it over?
- A disk containing an uncompiled version of your code. Be certain the disk is not write protected! The person marking your program will be compiling & running your program.
Remember: marks are not given just because a program compiles or runs! It
should run robustly, and it should be well commented & well documented as
specified above.
How you will be marked:
The marks allocation for this assignment is as follows:
- Requirements statement 10%
- Design of program solution 15%
- Fully commented, working programs implementing your design 45%
- Results and analysis 10 %
- Conclusion/Critique 20 %
Total 100%
Threshold Pass for each component
- Brief discussion of requirements.
- Brief program design. Brief details of how the design will be implemented in Java.
- Simple program. Basic level of commenting. Code layout is mostly correct. Minimal exception handling necessary for a compile.
- Minimal functionality:
- A basic control window with buttons that let you start a conversation, end a conversation and kill the application.
- Two threaded panes that allow you to enter text in one and have it echoed in another other.
- Conclusion gives a brief, not very thoughtful discussion of the resulting
solution. Little useful criticism and few ideas for improvement.
Good Pass for each component
- Good requirements statement.
- Good program design starting with a high level design and showing refinement
into appropriate levels. Algorithms are given at an appropriate level of
detail and are well explained. Clear description of how design will be implemented.
- Program
is a good implementation of design. Layout of code is correct and
clear. Some reasonable exception handling, e.g. reasonable
messages or steps taken on likely exceptions.
- Basic functionality:
- Everything in the threshold pass , and
- Works across two different computers.
- Notice this requires some mechanism for sharing your code! E.g. putting it on your web page as an applet.
- Conclusion shows a thoughtful discussion of the program and the development
process you undertook and good analysis of the results. Sensible criticism
of your work, and good ideas for improvement.
Distinction Pass for each component
- Requirements statement covers all aspects of problem.
- Detailed program design starting with a high level design and showing
refinement into appropriate levels. Algorithms are given at an appropriate
level of detail and are well explained. Excellent description of how design
will be implemented.
- A sophisticated program showing good use of Java, but not overly complex.
Commenting is appropriate and gives sufficient information. Layout of code
is correct and clear. Fully appropriate use of exception handling.
- Exceptional functionality:
- Everything in the good pass , and
- Creative extra features. Possible suggestions:
- Use the java.awt.Graphics package to allow personalization of users windows.
- Use radio buttons & icons to support displays of emotion as well as words.
- Support more people in the conversation in an elegant way.
- Disable buttons / panels when they don't make sense (e.g. don't allow the user to enter an IP address when they run the server.)
- Conclusion shows a thoughtful discussion of the program and the development
process you undertook and excellent analysis of the results. Detailed and
thoughtful criticism of your work, and well-thought-out ideas for improvement.
page author: Joanna Bryson
set 25 February 2004, most recent update 8 March 2004