Home

What's New

Course Overview

Adding & Dropping the Course

Academic Honesty

Reading Materials

Course Schedule

Assessment & Assignments

Computing

Assignment 4

Implementation of a C2-style Chat System

Due Friday, May 24, at the beginning of discussion. If you cannot attend discussion, then make arrangements with Joe to drop off your assignment with one of them before discussion. This assignment contributes 16% toward your final course grade.

Summary

Keeping with the chat system theme of the assignments in this course, in this assignment you will implement a working, single-process chat system in the C2 style, using an off-the-shelf C2 framework.

Chat System Description

Your chat system will follow the basic properties of the chat system described in Assignment 2, with a few exceptions. The architecture of the chat system you will be implementing is shown here. The following changes are thus made to the chat system:

1. There is no registration database in this system. The chat room components will manage all registrations. A chat client must still register with the chat room before he/she can chat. All registered users must register with the chat room (rather than the registration database) before they can chat.

2. Users are allowed to unregister themselves at any time, but may be unregistered by a third party (i.e. the Chat Controller)

3. As you can see from the architecture, this chat system has a 2002 summer blockbuster movie theme. To keep flame wars from starting, the Chat Controller will monitor all messages from all users. If the chat controller detects any user saying the word "suck," it will send a message to the chat room to unregister that user. The user may re-register after the incident, having been suitably notified of his/her misbehavior.

4. The chat client will notify the user when the chat client has registered or has been unregistered with a modal dialog box with an OK button and a suitable message. Other indicators (whether the user is currently registered or not) can be shown in the main chat room UI.

5. The chat log will write a chat transcript to a file in the current directory with the filename (chat log ID)_log.txt.

6. The "Buddy Alarm" component will not be used in this assignment and should be ignored.

7. Any other constraints communicated to you by email from the TA or instructors.

Materials

You will build your C2-style chat system using the c2.fw framework. A special build of this framework has been created for this class that contains all necessary base classes, interfaces, etc. You can download this version of the framework here:

Download ICS 123 c2.fw framework

After downloading the ICS 123 c2.fw framework, you should unzip the ZIP file. Javadoc documentation for the framework is found in the doc/ directory. Source for the framework is in the src/ directory (although you should not modify the source to accomplish this assignment). In the lib/ directory, you will find a file called ics123.jar. This is the JAR file that contains the framework. Add this JAR file to your Java CLASSPATH. If you are unsure of how to add a file to your CLASSPATH, read the instructions here (scroll down to the section entitled "of CLASSPATHs". Note that setting up your CLASSPATH for ArchStudio 3 is basically the same as setting it up for this assignment, you just add the JAR file to the classpath. This assignment's files, however, will work in JDK1.3, whereas ArchStudio 3 requires JDK 1.4. Your work will be evaluated using JDK1.3.

Additionally, to help you along, we have created skeleton implementations of each of the components, and a Bootstrap program that will automatically instantiate and configure (i.e. link up) the components in your architecture with appropriate C2 bus connectors. As such, your job will be to simply implement the internal workings of each component. You must use, at minimum, the classes provided to you for the application to work, but you are free to create more classes as the need arises. You should not, however, create new components or connectors, or otherwise change the architecture.

The skeleton code is all in the Java package "chatsys". All your classes should go in this package as well. You can download the code skeletons heree:

Download ICS 123 Code Skeletons

When you unzip the code skeletons, you will find a directory tree similar to this:

<directory you unzipped in>
|
+--chatsys

   |
  +--(xxxC2Component.java files)

You will be writing the component behavior for these C2 components.

Additionally, a file called chatsys/Bootstrap.java is included. This implements the Java class chatsys.Bootstrap. Running this class with a command-line such as:

java chatsys.Bootstrap

(with the CLASSPATH appropriately set up) will instantiate and link up all the components and connectors and start them. At first, this software system will not be very interesting, because no components send out or handle any messages. However, as you implement components, the system will take shape.

Approach

You may use any Java development environment that you like to develop these component internals. You may NOT add new components or connectors to the system, or otherwise change the architectural configuration. You may add additional classes that are part of individual components (i.e. graphical widgets) or message classes, as necessary. The course staff will tell you more about creating message classes in discussion section.

All implementations must adhere to the C2 style. Even though it is sometimes possible to violate C2 style rules (i.e. passing references or passing pointers) using the c2.fw framework, this is prohibited in this assignment.

For the Chat Client component, you are allowed to reuse code that you have written for assignment #1 in this class. You may NOT use someone else's assignment #1 code, however; doing so is a violation of academic honesty policies for this course.

Instructions on how to write C2 components in more detail will be provided by the course staff in discussion section.

Deliverables

You will turn in a report containing

  1. a cover page listing your name, student ID, the course number and the assignment number;
  2. printed copies of all source files for your program (do not include source printouts of the C2 framework!).

You will also, by the deadline, email the TA the following two binaries:

  1. a ZIP or TAR file containing your source files;
  2. an executable JAR file containing your compiled, running applications. The procedure for creating an executable JAR file was detailed for assignment #1. The main class for this assignment's JAR file will always be "chatsys.Bootstrap". Do NOT include any of the C2 framework classes in your JAR file. The TA will be running your program with the following command line:

java -jar yourfile.jar

You may assume that the TA also has the ics123.jar file on his CLASSPATH.

In evaluating your work, 25% of the credit will be earned for quality of design, 25% for source code organization and documentation, and 50% for correct operation of the program.

If the TA is unable to run your program, you will get a zero on that portion of the assignment.

As always, work on this assignment completely by yourself.


Copyright (C)2002 The Regents of the University of California. All Rights Reserved Worldwide.
Department of Information and Computer Science, University of California, Irvine.