This is an PAIRS assignment. Due: Monday, April 6.
In the first three assignments you learned how to put together Swing applications , extend and design your own components, and decouple your interface and model (Òback-endÓ) parts of your application. The energyJournal you built, however, is a single-user application. In this assignment you will be extending it to support some simple multiuser activity, so that >1 user can add view and add notes to your journal entries in real-time.
To do this, you will essentially be building the basics of very common software architecture – a client-server (C/S) system.
The learning goals for this assignment are:
Don't be intimidated by the length of the homework description! Although long, most of this writeup is here just to provide detail about what I expect from this assignment, as well as some hints about how best to do the implementation.
In this assignment, you will be adapting your energyJournal to allow 2 users to view and add notes to a journal entry at the same time. This means that you will in effect be supporting two user interface applications (clients) to your application (the server that maintains the model). Because the goal of this assignment is to learn how to manage the simple C/S architecture, I do not expect you to implement the complete functionality of a journal (adding and deleting journal entries and phots), but just to show that you can get manage simple input and output in the form of text and graphic annotations
There are a number of specific requirements for this assignment:
In class we discussed a simple example with one server and one client. You will be dividing your application into two running programs : an energyJournal server and an energyJournal client. When you run the system, you will use one server and TWO instances of the client, representing two users. The server will keep track of all notes (strings) on each journalEntry (and all journal entries if multiple. See below). The client will implement the user interface services to manipulate the journal.
The energyJournal should have at least two journal entries in it. The client will have all the same functionality as the previous energyJournal tool, i.e. you can add strings/notes to a journal entry, add photos, etc. However, the server will keep track of what journal entry the client is looking at and any changes to the text notes that the client makes. The following functionality will be implemented:
There are several things you have to do in order to decouple your application:
The server/client only needs to run in real time: that is, you do not need to save the state of the entries for later. (see below for extra credit)
There are a lot of ways to augment this assignment, should you choose to. Some obvious ways are:
You may do this assignment in a team of TWO. While you can use any development environment you choose, you are not allowed to use "GUI builder" type tools (like JBuilder or Eclipse GUI Builder).
The assignment is due on Friday, April 3 (week 13). YOU MUST DEMONSTRATE THIS TO ALI AND ME either in the workshop on that Friday or before by private arrangement, although you can submit the code on email by midnight that day as usual following the standard instructions below.
To turn in the assignment, please follow the same process as last time: submit the code on email following the standard instructions below.
0. Make sure your program is runnable from the command line using the command "java energyJournalClientÓ and Òjava energyJournalServerÓ.
1. Create a new directory using your last name as the name of the directory.
2. Compile your application and place both the sources and classfiles into this directory (they can be at the top-level or in a subdirectory, whatever you want).
3. Put a README.txt file (described below) into the top level of the directory. This file should contain your name and email address, the version of Java you used (1.5.x or 1.6.x, please) as well as any special info I might need in order to run your code (command line arguments, etc.)
4. ZIP this directory and submit it via email.
5. include, as usual, a Software Design Document that describes the design of your system.
If you do any extra credit work, be sure to let us know about it in the README file so that we don't miss it!!
Please take care to remove any platform dependencies, such as hardcoded Windows path names or dependence on a particular look-and-feel that may not exist on all platforms. Also, if you use any images in your application, please make sure that you include these in your ZIP file and that your code will refer to them and load them properly when from from inside the directory that's created when I unZIP your code.
Grading for this assignment, and future assignments, will roughly follow this breakdown:
Please let the TA or me know if you have any questions.