Project 1 - Address Book Console Application
Due Feb. 27 start of class
Points 245
This is a INDIVIDUAL project.
Evaluation Guidelines (partial)
Project Description & Requirements
GOAL and Outcomes:
This project will serve you in developing your OOP skills through developing an Address Book Console Application that requires assembling a solution out of modular classes, giving each class a good API for its client(s) and testing. This requires:
- you to do "Divide and Conquer" a strength of OOP design that lets you use modularity and encapsulation to divide a problem into more than one smaller problem.
- you to develop Unit Testing Code - taking in part advantage of some Test Driven (maybe we should call it Test Assisted) Design/Implementation.
- use of Collections in Java to implement Data Structures need.
- you to efficiently solve some of the problem using algorithms you learned about in Data Structures and Algorithms class. You want to write classes (methods) that run quickly.
- you to create a single, static AddressBook instance that all other classes and the client code will access. In OOP, this is sometimes called a "singleton" pattern, since there is only one instance of the object and the other classes are always given a point to that one instance.
- learn how to use Git, eGit with IntelliJ and GitHub
Classes
I am going to help you out by paritally specifying some of the OOP design you MUST adhere to. Here is a list of classes that you must implement and their meanings:
the packages you will use and their classes are:
- address = contains AddressBookApplciation class and Menu class
- address.data = contains AddressEntry, AddressBook
- AddressBook - this class represents and contains a possibly every growing and/or shrinking "list" of AddressEntries. It allows for various operations such as search/find, addition and removal of AddressEntries.
- you need to think about the efficiency of operations needed --see below example session --list alphabetic order (sorted), add, remove, find (search), read in from file
- you need to think about the efficiency of operations needed --see below example session --list alphabetic order (sorted), add, remove, find (search), read in from file
- AddressEntry - this class represents a single Address/Contact information entry in the AddressBook
- It should contain contructors, at least one constructor one that accepts a first, last name, street, city, state, zip, email, phone.
- contain separate class varaibles representing all the information in an AddressEntry contact.
- It should cotain a toString() method that returns a nicely formats a string containing all contact information for printing to console
- It should contain setX() and getX() methods where X are the class variables. (for example, setName(***) and getName() where *** are appropriate parameter(s) )
- AddressBookApplication - this contains the main application class.
- Uses Menu classes and AddressBook as described in this document
- modify your previous exercise versions of AddressBook main method to create any objects necessary and then call Menu's displayMenu() method, capture the user's input choice, and appropriately call appropriate methods
- Menu- this class is used to display menu options to the user.
- displayMenu() method display the program options a-f shown below (also see example session):
- a) Loading of entries from a file.
- b) Addition - prompting user for information to be used to create a new AddressEntry
- c) Removal - removing of an AddressEntry from the AddressBook. First a find is done (see below example session) and then the user selects from the find results what entry to remove.
- d) Find - prompts users for the begining of the users last name (they can enter a complete last name or just the start....all entries with that as the first part of their last name will be displayed). Note in the case when more then one entry is found a set will be returned.
- e) Listing - listing (a "dump") of the addresses in alphabetic order by the person's last name.
- f) Quit -note we are NOT saving any newly created AddressEntry objects (or removing objects either are not updated to the file) to the file, this data is lost, we will handle this issue in Project 2 when we store data more apporpriately in a database.
- NOTE: alter the prompt_* methods so that now they not only print out the prompt but, wait for the User to type into standard input and reads in the value and as necessary (for zip which is of type int) converts to appropriate type and returns that value. So prompt_Email() will ask user for Email read in what they typed and and returns a String. For prompt_Zip() it asks user for a zip and reads in value and converts to an int and returns this.
Start of a UML Class Diagram showing the Classes you will create and SOME (e.g. displayMenu method of Menu class is missing) of the methods you will need --you will need to update this design to include all of the methods you design and create to fulfill the requirements of this project
- displayMenu() method display the program options a-f shown below (also see example session):
Unit Testing
Work on your unit-tests before getting in too deep writing your Address Book Application code. You must create a test class for every class you create. For example, for the AddressBook class create a JUnit unti testing class called AddressBookTest. Writing the tests at the start (or almost) helps you get started thinking about methods and and use cases are before you write the code. Then, having the tests in place makes it easy to see if your code is working as you build out the code for the various cases.
I will look at the unit testing code as follows:
- A baseline of having a decent looking unit-test: For a particular test class you should test its corresponding class's methods at least 2 times for each method (this is a minimum). For example, the AddressBookTest unit test should look at 2 or more different istantiations of an AddressBook using its constructor, it should call and check the output of each of its methods --addAddress,getAddress, equals, find, lessThan, greaterThan at least 2 times for each method. Note in this case the AddressBookTest will have methods of testAddressBook, testAddAddress, testGetAddress, testEquals, testFind, testLessThank, testgreaterThan, etc.
- When run against a correct class, each unit test class's methods should not report any problems.
- If someone (meaning me or you) were to intruduce some error in a class then the corresponding testing Class should show the failure. Your unit test must show that there is a problem but, does not need to tell exactly what the problem is....that is what you do with debugging using the unit testing failure information/indication.
- SPECIAL NOTE: I always get at least one question and welcome all questions from a student(s) saying they don't feel comfortable or understand how to write testing code. You have to start somewhere and frankly there is OFTEN not ONE set of lines that make up the best testing code. But, I am looking for something decent not perfect. Comein and see me about this during office hours if you want help.
Example Session
format of this session is up to you....the content is what is importan
**** Click here to see session sample*****
Specifications and Code
- Before coding, create UML document (see item #5 below) showing your design.
- DOCUMENT YOUR CODE!!!
- Think about efficiency in choosing your data structures and algorithms. You can assume that users will equally want to search (find), store to file, read from file, list alphabetically all entries. You must discuss in your code description (see CodeWorks.doc below) why you choose the data structures you did and what is the efficiency for sorting (as you did it), search/find, listing alphabetically
- You MUST develop Unit Test cases for all of your Classes and their important methods. This is part of the deliverables.
- See above for information on required Classes.
- You are encouraged to use Java Collections as appropriate to facilitate data structures you wish to use.
- User Input Correctness.
- When user is entering in an AddressEntry you should NOT assume correct data is entered by the user, test to make sure a number is a number, etc. If not, you should PRINT out a message telling the user it is INVALID input and ask again for the input in question. You only have to check for type --- you don't need to see for example if the phone number has a valid area code or if the email address is valid.
- Create a class named Address that contains String instance variables
for street, city, state, and zip code.
- This class should contain a constructor that accepts values to initialize these variables and methods that return each one
- toString() method that returns a string for the Address object.
- setX and getX methods to set/get class variables. (i.e. setStreet, setCity, etc.)
- As you code, create comments and produce JavaDocs that fully document ALL your classes and upload your JavaDoc files to your account so they are accesible via the web. (see item #2 below)
- Test your code and store results in file Working.doc (see #1 below).
Git
You are required to create a Git repository locally and on a OPENSOURCEGItHub reposiotry called YourLastName_AddressBook hence for me it would be called Grewe_AddressBook. You are to use the repository in developing your code. YOU MUST comment well any commits you make --I will be looking at these.
Deliverables:
Deliverables -MUST KEEP THESE NAMES SPECIFIED BELOW.
-
Git and OPENSOURCE GitHub Reposiotry
-
Wiki on OPENSOURCE GitHub Repository
contains the following components: (KEEP THE TITLES In GREEN as section headings in your WIki document: (note: normally we would have multiple pages in our wiki but, for EASE I want this all on the main wiki page) - Section A: Description- give a detailed description of how your system works including:
- A.1)State of System: a description of what parts are or are not working ---give details. If your system is NOT working and you do not show screenshots of how it is failing and show you have through screen shots tried to insert breakpoints and done debugging you will have points taken off.
- A.2)List of Classes: with brief desciption of purpose, discuss any data structures/algorithms used their efficiency in relation to the main operations of our menu - loading, addition, removal, find, listing, saving. Use O(n) terminonlogy where n is the number of entries.
- Section B: JavaDoc URL: Posting of JavaDoc code to your server account. Turn in URL to website. Every class, its variables and methods MUST be documented/described --not just listed.
- Section C: UML/Design: contains the following
- C.1) UML Class Hierarchy Diagram: showing Hierarchy and Cardinality
and Object Associations for this project.
- C.1) UML Class Hierarchy Diagram: showing Hierarchy and Cardinality
and Object Associations for this project.
- Section D: Working Screenshots: screenshots showing your Java Application working (capture screen dumps
into a word document) for the following cases:
- D.1) Work Instance 1: Read in entries from data file followed by listing. The data file must contain a minimum of 5 addresses. Show output screenshot and also show corresponding contents of data file
- D.2) Work Instance 2: immediately following D.1 do an addition of new AddressEntry object followed by a listing
Show result of a new listing to standard output
- D.3) Work Intsance 3: immediately folllowing D.2 do a removal of a entry followed by a listing
- D.4) Work Instance 4: immediately following D.3 do a find using input that should retrieve at least one entry. Now do a find using input that should retrieve no entries.
Place screenshots of each find here.
- D.1) Work Instance 1: Read in entries from data file followed by listing. The data file must contain a minimum of 5 addresses. Show output screenshot and also show corresponding contents of data file
- Section E: Commit Hisotry Screen shots showing the GitHub repository commits, Show Code tree
- Section F: Demonstrate ProjectCreate YouTUBE video and give link in this section - The video must have clearly visible screen and text AND must include audio. You need to actively run your code and step through the steps discussed in D.1- D.4 which will show the full use of the program.
- Upload the URL to your GItHub OpenSource repository's wiki page to Canvas->Assignments->Project 1