Home Work Assignment 3

for MSIS 640

Last modified on 11/5/99

Due Thursday November 22 1999 in class

Note:

    You may hand in your assignment either on floppy disk with .java and .class files and all necessary supporting files (such as input, output, text or HTML files) on it, or put the files into a single .zip archive (all of them in the same archive), and e-mail the archive to me as an attachment. The e-mail is to alizadeh@andromeda.rutgers.edu . In the subject file type in:

    "MSIS 640 HW3"verbatim, followed by your name and student ID number.

    Late homework will lose 25% and no late homework will be accepted beyond one week after the due date.

    Remember: 70% of your grade is based on programming projects. Also if you miss more than one homework assignments you will automatically fail the course, regardless of your score in exam and other assignments.


Programming project

200 point



Specification of the project:

A simple address book Part one: The engine

In this project you will create an address/telephone/e-mail/other information book for your most frequently used contacts. You should design an address book with unlimited capacity for contacts that can support adding, removing and searching information; thus it should be an appropriate collection of entries. Each entry is to be made up of several fields some of which are mandatory and some are optional. Each entry should have a mandatory name and mandatory address field. Entries should be categorized into two types: people and organizations. Each of these categories can be further divided into other subclasses at your discretion. For instance-and this is just one possible design-you may have the persons to be categorized into friends, colleagues; and people to whom you have a "customer" relationship (such as your doctor, your broker, your bookie, etc.). Likewise organizations can be divided into categories such as those to whom you have to pay bills (telephone company, electric company), those that provide service for you such as a bank or an insurance company, your favorite places such as stores or restaurants. This aspect of categorization is entirely up to you and should accommodate your needs. There is no right or wrong way here, but your design decisions should be logical and should simplify things not obfuscate them.

Once you have defined your categories you should then go ahead and organize them in interfaces, abstract and concrete classes.

Here are a few examples of possible entries (name of fields are italic, their possible contents in roman type face):

Entry 1: name: George Black, Address: 125 P street, New Brunswick NJ 08872, telephone: 732-555-4321, e-mail: Jblack@yahoo.com, category:Friend and colleague, Birthday:June 3 1978.

Entry 2: name: State Farm Insurance Company, Address:735 Avenue of Americas, New York NY 10021, phone:1-800-732-1111, contact person: John Kalahatis, extension of contact person: 8361

Entry 3: name: Peach and Frog Restaurant, Address:113 George Street, New Brunswick NJ, 08834, telephone; 732-666-6565, hours: Tuesday through Saturday 5-11 pm

What you should do

The main goal of this project is to use concepts and techniques of object oriented programming you have learned thus far and apply it in to design a simple address book. You will use UML class diagrams, interfaces and abstract and concrete classes, and packages. You will also apply information hiding by using the technique of making fields private and providing limited access and modification capabilities through accessor and modifier methods. Specifically here are some of the things you need to do:

  1. In the first stage you need to use UML class diagrams to describe describe your design. Then you need to implement your design faithfully following your UML description. Any deviation should be avoided as much as possible or be justified completely in the documentation. Each class and interface should be marked when described as part of the overall system. Also for each of the classes you need to describe as fully as you can their content including fields, constructors and methods together with their accessibility to outside of the class.

  2. The main concepts that I like you to use are inheritance through subclassing and through interfaces and their implementation. I also want you to organize your classes into a package and the directory structure that holds your files should accommodate your packaging. You must do parts 1 and 2 before you write a single line of Java code. (parts 1 and 2 are worth 100 points, package design worth another 20 points)

  3. I want you to use the Collections framework of the Java API to implement the necessary data structures. The data structure should not allow duplicate entries, and should support addition and removal entries. Also you should be able to search for an entry using the name field as a key. For people, a first name or last name should be enough for search. For organizations part of their name should be used. (You need to study the chapter on String in your text to do some of the String operations required here.) (50 points)

  4. Try to make all the fields private- at least all those that are reasonable to do so. Provide access and modifier methods to access and change the fields rather than allowing outside classes changing them directly. You should use your access and modifier codes to restrict access and change. (For instance if a field like street address should be filled with a String made up of alphanumeric characters, punctuation and blank space, then that is all that it should allow, it should not allow any other type of characters that are not possibly part of any reasonable address. Thus "@#2!09W, ~" should not be allowed as legal address.) (30 points)

  5. You don't need to provide any main method or classes that contain such a method. Of course for testing purposes you may wish to provide such a main method for your own use, but then you do not have to hand it in.

You will be graded of course by whether your program is functional or not, but that is a small portion of the grade. You will be evaluated by your design in the form of UML classes, and by your degree of faithfulness in sticking with that design in your code. You will also be evaluated by how judiciously you use interfaces, abstract classes and concrete classes and basically the quality of your overall design. I will also look for your choice of data structures and how it is integrated into your design. Finally I will evaluate your access and modifier methods and the degree of encapsulation built in your code.

You will be using the code you designed here in the next project by adding graphical user interface and exception handling to it. Thus you have to design the code in a way that requires no or at the most minimal modification for future enhancement. Furthermore, if it becomes necessary to modify parts of the code it should have minimal impact on other parts. For instance, if you make your address modifier more stringent, that should affect other classes using it none or at most in a minimal way. You should tailor your code for these anticipated enhancements.


Return to: MSIS 640 page