CM10135 / Programming II:   Assignment 2 (2005)

Build Your Own Chat Application

Assignment Date:  Tuesday,  15 March.  Due date:  Thursday, 21 April at 4:00pm


This assignment is the second of four you will have in this course.  Your mark in Programming II is composed of 40% coursework, 60% exam.  This coursework is worth 17%.

NB:  This coursework must run in Java 1.4.x/ latest (whatever's on BUCS), NOT 1.5!

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,  networking and handling exceptions, and maybe threading if you are ambitious.

As I mentioned in class, a lot of building GUIs, getting networking working, and generally writing code in industrial situations comes down to finding appropriate examples of the functionality you want in documentation, and then adapting them to your own needs.  This coursework is designed encourage you to learn how to put a big application together using design patterns, java doc and the Sun java pages.

There's actually quite a lot of possible material in this coursework, but I have not scheduled it across 5 weeks expecting you to spend huge amounts of time on it.  In fact, I don't really expect you to spend break programming on this. If you are behind in the course material, I do expect you to spend break teaching yourself more about Java --- with a good textbook!  I expect that, for this coursework, you should spend about 20-30 hours.  As we mentioned in class, you should be spending about 10 hours a week outside of class and lab on this course anyway.

Reminder on plagiarism:  Plagiarism occurs any time that you use someone else's ideas without acknowledging them.  Plagiarism is bad, though asking for help is fine.  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, java documentation or elsewhere on the Internet.  Particularly for this coursework, you may be starting with code you copy form the lecture web pages.  Wherever you get help from, you should acknowledge it immediately in the comments as well as in the documentation.  Say exactly where your help came from, and exactly how much of the code is your own.

What to do:


There are many possible things to do on a chat application, and I do actually want you to have fun with this. 
Everyone should pick 100 points worth of ideas from the below list.  If you do more than 100 points worth, you won't get any extra credit for this!  I don't want you to spend too much time on just this coursework.

All point values below are maximum.  To get full points, you must write clear code with good comments, good exception handling, good testing and write good documentation as specified below.
  1. 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.
  2. First, you want to build a GUI application with some labels, two large text panes and at least one button.
    1. One text pane is for typing into / sending messages, the other is for receiving messages.
    2. The labels should make it clear which is which.
    3. One button should let you quit the application.  You might want to add other buttons too (see below.)
    4. This part is mandatory, and is worth 40 points.  You should try to get it done in one week.
  3. Now choose 60 more points from the list below.
Remember: functionality alone doesn't get you high marks!  There should be good code layout, good comments, good documentation, good testing and good exception handling. 

Note that you can also get some points for things that don't work, certainly in the specification and analysis, so be optimistic in your initial specification.  Have fun!

What to hand in:

  1. Your informal description of your classes & algorithms.
  2. A printout of your fully-commented code. 
  3. A short write-up documenting your program.
    1. Include a screenshot of your GUI.
    2. Be sure anyone (try your family!) could run your program from this documentation.
    3. Some critical analysis of your program: 
      1. What did you do right?  What did you do wrong? 
      2. What would you do differently if you did it over?
      3. Be sure to draw attention to any work that you think was particularly clever or difficult -- we are checking a lot of projects!
  4. 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, tested &  documented as specified above.

How you will be marked:

NB:  This coursework must run in Java 1.4.x/ latest (whatever's on BUCS), NOT 1.5!

The marks allocation for this assignment is as follows:
  1. Description / Specification 15% 
  2. Fully commented, working program implementing your design 65% 
  3. Documentation and Analysis 20% 
Total 100%

Threshold for Pass (40%+)
  1. Brief discussion of requirements and design. 
  2. Simple program. Basic level of commenting. Code layout is mostly correct. Minimal exception handling necessary for a compile.
  3. Minimal functionality: 
  4. Minimal documentation so that the system can be run without hacking. 
Good Pass (~55%)
  1. Specification covers all aspects of problem. Good program design at an appropriate level of detail. Clear description of how design will be implemented.
  2. Program is a good implementation of design, or possibly better than the design. Code is concise and comprehensible.  Layout of code is correct and clear.  Some reasonable exception handling, e.g. reasonable messages or steps taken on likely exceptions.
  3. GUI appearance uncluttered and clear.
  4. Basic functionality: 
  5. Documentation clear, concise and helpful. Sensible criticism of your work, and good ideas for improvement. 
Distinction Pass for each component
  1. Specification covers all aspects of problem.  Detailed program design starting with a high level design and showing refinement into appropriate levels. Algorithms and implementation plan are given at an appropriate level of detail and are well explained.
  2. 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.
  3. GUI attractive, functionality / usability apparent without much documentation.
  4. All or nearly all of intended functionality works well.
  5. Documentation clear, concise, attractive and informative. Detailed and thoughtful criticism of your work, and well-thought-out ideas for improvement, possibly including descriptions of alternative implementations.

page author: Joanna Bryson
set 15 March 2005
Security option added 16 March