This project is based on the AddressBook Level-3 desktop application.
Removal of whitespace inside a String: Taken from https://stackoverflow.com/questions/33381237/string-doesnt-equal-string-with-spaces
Refer to the guide Setting up and getting started.
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main (consisting of classes Main and MainApp) is in charge of the app launch and shut down.
The bulk of the app's work is done by the following four components:
UI: The UI of the App.Logic: The command executor.Model: Holds the data of the App in memory.Storage: Reads data from, and writes data to, the hard disk.Commons represents a collection of classes used by multiple other components.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete n/John Doe p/98765432.
Each of the four main components (also shown in the diagram above),
interface with the same name as the Component.{Component Name}Manager class (which follows the corresponding API interface mentioned in the previous point.For example, the Logic component defines its API in the Logic.java interface and implements its functionality using the LogicManager.java class which follows the Logic interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
The API of this component is specified in Ui.java
The UI consists of a MainWindow that is made up of parts e.g.CommandBox, ResultDisplay, PersonListPanel, StatusBarFooter etc. All these, including the MainWindow, inherit from the abstract UiPart class which captures the commonalities between classes that represent parts of the visible GUI.
The UI component uses the JavaFx UI framework. The layout of these UI parts are defined in matching .fxml files that are in the src/main/resources/view folder. For example, the layout of the MainWindow is specified in MainWindow.fxml
The UI component,
Logic component.Model data so that the UI can be updated with the modified data.Logic component, because the UI relies on the Logic to execute commands.Model component, as it displays Person object residing in the Model.API : Logic.java
This is a (partial) class diagram of the Logic component:
The sequence diagram below illustrates the interactions within the Logic component, taking execute("delete 1") API call as an example.
Note: The lifeline for DeleteCommandParser should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the Logic component works:
Logic is called upon to execute a command, it is passed to an AddressBookParser object which in turn creates a parser that matches the command (e.g., DeleteCommandParser) and uses it to parse the command.Command object (more precisely, an object of one of its subclasses e.g., DeleteCommand) which is executed by the LogicManager.Model when it is executed (e.g. to delete a person).Model) to achieve.CommandResult object which is returned back from Logic.Here are the other classes in Logic (omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
AddressBookParser class creates an XYZCommandParser (XYZ is a placeholder for the specific command name e.g., AddCommandParser) which uses the other classes shown above to parse the user command and create a XYZCommand object (e.g., AddCommand) which the AddressBookParser returns back as a Command object.XYZCommandParser classes (e.g., AddCommandParser, DeleteCommandParser, ...) inherit from the Parser interface so that they can be treated similarly where possible e.g, during testing.API : Model.java
The Model component,
Person objects (which are contained in a UniquePersonList object).Person objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Person> that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.UserPref object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref objects.Model represents data entities of the domain, they should make sense on their own without depending on other components)Note: An alternative (arguably, a more OOP) model is given below. It has a Tag list in the AddressBook, which Person references. This allows AddressBook to only require one Tag object per unique tag, instead of each Person needing their own Tag objects.
API : Storage.java
The Storage component,
AddressBookStorage and UserPrefStorage, which means it can be treated as either one (if only the functionality of only one is needed).Model component (because the Storage component's job is to save/retrieve objects that belong to the Model)Classes used by multiple components are in the seedu.address.commons package.
This section describes some noteworthy details on how certain features are implemented.
The find feature parses the search keys given by the user, and finds all contacts that match the search key in the currently displayed list. These contacts are then returned and displayed in the UI. The sequence diagram below illustrates the interactions between the different components:
The sort feature parses the user-given parameters required for sorting, and displays the list of contacts in the UI in the user's preferred manner. The sequence diagram below illustrates the interactions between the different components:
The favourite feature parses the index given by the user, and finds the contact with the matching index. This contact is marked as a favourite (or unmarked as a favourite) and the changes are displayed in the UI. The sequence diagram below illustrates the interactions between the different components:
Target user profile:
Value proposition: manage contacts and provide convenient access to all the people teachers may work with
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | first time user | keep track of all my school contacts | quickly find their details |
* * * | first time user | add a new person | store all of the contacts |
* * * | first time user | delete a person | remove contacts that I no longer need |
* * * | first time user | find a person by name | find them without scrolling through the entire list |
* * * | beginner user | sort contacts in alphabetical order or some sort | easily find the contacts |
* * * | expert user | categorize different contacts | better organize my contact lists for easier management |
* * * | expert | get a child's grade and tasks by searching for their name | quickly see performance and pending tasks related to a student |
* * | beginner | access a tutorial for the app | navigate and find the functions I struggle with easier |
* * | first time user | go back and edit the contact's information | make corrections |
* * | beginner | favourite/mark certain contacts | I can easily access them |
* | first time user | add notes to each contact | keep relevant information |
* | beginner | view a list of students | access the details of class efficiently |
(For all use cases below, the System is the AddressBook and the Actor is the user, unless specified otherwise)
MSS (Main Success Scenario)
User requests to group contacts by a specific role.
System validates the input.
System displays the grouped contacts and their count.
Use case ends.
Extensions
2a. The user does not provide a role.
2b. The user provides an invalid role.
2c. The user provides multiple roles.
2d. The user provides a role with incorrect format.
3a. No contacts are found for the specified role.
MSS (Main Success Scenario)
User selects option to add new contact.
System displays contact input form.
User enters contact details.
System validates the information.
System checks for duplicates.
System saves the contact and confirms successful addition.
Use case ends.
Extensions
3a. User enters incomplete information.
3b. User enters duplicate parameters.
4a. System detects invalid values.
5a. System detects a duplicate contact.
MSS (Main Success Scenario)
User requests to list contacts.
System shows the contact list.
User selects a contact to delete.
System deletes the contact and shows confirmation.
Use case ends.
Extensions
2a. The contact list is empty.
3a. User provides incomplete selection information.
4a. The specified contact cannot be found.
MSS (Main Success Scenario)
User requests to find contacts.
User enters search criteria.
System processes the search.
System displays matching contacts.
Use case ends.
Extensions
2a. User enters empty search criteria.
4a. No contacts match the search criteria.
MSS (Main Success Scenario)
User requests to view all contacts.
System displays the contact list.
User requests to sort contacts by a field and order.
System validates sorting parameters.
System displays sorted contacts.
Use case ends.
Extensions
2a. The contact list is empty.
2b. The current view is not displaying the full contact list.
3a. User provides incomplete sorting parameters.
4a. User specifies invalid sorting criteria.
17 or above installed.Given below are instructions to test the app manually.
Note: These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.
Initial launch
Download the jar file and copy into an empty folder
Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
Saving window preferences
Resize the window to an optimum size. Move the window to a different location. Close the window.
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
Adding a contact in ClassHive
Prerequisites: The contact to be added should not exist in the app.
Test case: add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01 t/top student r/Student g/Sec 1 c/1A rn/Bob Doe rp/92932011
.jar file is run).New person added: John Doe; Phone: 98765432; Email: johnd@example.com; Address: John street, block 123, #01-01; Role: Student; Grade: Sec 1; Class: 1A; Parent's Name: Bob Doe; Parent's Phone: 92932011; Tags: [top student]Adding a duplicate contact
Prerequisites: The contact already exists in the app.
Test case: Re-run the same command as above (in test case 1).
Expected: No person is deleted. Error message shown in the output box. No logs regarding the command execution will be printed in the Terminal (where the .jar file is run).
Expected error message: This person already exists in ClassHive
Missing required fields
add n/Alex Yeoh a/Some Street r/Student
Expected: Command fails with error message, Missing required field(s)! Please ensure all required details are provided..Deleting a contact in ClassHive
Prerequisites: The contact to be deleted should exist in the app.
Test case: edit 1 n/Betty Crowne
Expected UI and Terminal log changes: The name of the first person in the list is changed to Betty Crowne. Details of the edited contact shown in the output message. A log regarding the command execution will be printed in the Terminal (where the .jar file is run).
Editing a contact not in ClassHive
Prerequisites: The index of the contact to be edited is bigger than the list of contacts in ClassHive.
Test case: edit 9999 n/Joe p/91112345
Expected: No contact will be edited. Error details shown in the output box. No logs regarding the command execution will be printed in the Terminal (where the .jar file is run).
Expected error message: The person index provided is invalid
Incorrect Edit Command format
edit, delete Joe
Expected: No contact will be edited. Error details shown in the output box. No logs regarding the command execution will be printed in the Terminal (where the .jar file is run).No optional fields provided
edit 2 .jar file is run).At least one field to edit must be provided. Deleting a contact in ClassHive
Prerequisites: The contact to be deleted should exist in the app.
Test case:
add n/Betsy Crowe t/principal e/betsycrowe@example.com a/Serangoon Avenue 2 p/12345678 r/Staffdelete n/Betsy Crowe p/12345678 .jar file is run).Deleted Person: Betsy Crowe; Phone: 12345678; Email: betsycrowe@example.com; Address: Serangoon Avenue 2; Role: Staff; Tags: [principal]Deleting a contact not in ClassHive
Prerequisites: The contact to be deleted should not exist in the app.
Test case: delete n/Joe p/91112345
Expected: No person is deleted. Error message shown in the output box. A log regarding the command execution will be printed in the Terminal (where the .jar file is run).
Expected error message: The person's name and phone number provided cannot be found!
Incorrect Delete Command format
delete, delete Joe, delete 123
Expected: No person is deleted. Error message regarding an invalid command format is shown in the output box. Status bar remains the same. No logs regarding the command execution will be printed in the Terminal (where the .jar file is run).Searching by name
Prerequisites: Tthe contact must exist.
Test case: find Alice
Expected: Contacts whose name contains “Alice” (e.g., "Alice Lim", "Alicia Tan") are displayed.
Searching by phone number
Prerequisites: The input must be an integer, and the contact must exist.
Test case: find 9876
Expected: Contacts whose phone number contains “9876” (e.g., "98765432") are displayed.
Group by Role
Prerequisites: Contact list have 2 contacts of the role Student.
Test case: group by ROLE Student
Expected output message: Results are grouped by: ROLE Student. 2 contacts found.
Group by Favourite
Prerequisites: Contact list consists of favourite contacts.
Test case: group by FAVOURITE
Expected output message: Results are grouped by: Favourite. X contacts found.
Group by Class
Prerequisites: Contact list have 2 contacts in class 1A.
Test case: group by CLASS 1A
Expected output message: Results are grouped by: CLASS 1A. 2 contacts found.
Group by Grade
Prerequisites: Contact list have 2 contacts in the grade Sec 1.
Test case: group by GRADE Sec 1
Expected output message: Results are grouped by: GRADE Sec 1. 2 contacts found.
Removing grouping
Prerequisites: Contact list is already grouped.
Test case: ungroup
Expected UI changes: Grouping is removed, and all contacts are displayed.
Prerequisites: A valid index within the displayed contact list must be provided.
Test case: favourite 1
Expected UI changes: First contact is marked as favorite (★ appears).
Test case: favourite 1 (again)
Expected UI changes: First contact is unmarked as favorite (★ is removed).
Sorting by name
Prerequisites: Contact list must not be empty and the current view must display the full contact list.
Test case: sort by name asc
Expected UI changes: Contacts displayed are sorted by name in ascending order.
Test case: sort by name desc
Expected UI changes: Contacts displayed are sorted by name in descending order.
Sorting by date
Prerequisites: Contact list must not be empty and the current view must display the full contact list.
Test case: sort by date asc
Expected UI changes: Contacts displayed are sorted by date added in ascending order.
Test case: sort by date desc
Expected UI changes: Contacts displayed are sorted by date added in descending order.
Default sorting
Prerequisites: Contact list must not be empty and the current view must display the full contact list.
Test case: sort
Expected UI changes: Contacts displayed sorted by name in ascending order (same behavior as sort by name asc).
Adding a note to a contact
Prerequisites: A valid index within the displayed contact list must be provided.
Test case: note 1 nt/Needs help with Math
Expected UI changes: A note, "Needs help with Math", is added to the first contact.
Test case: note 3 nt/Call parent tomorrow
Expected UI changes: A note, "Call parent tomorrow", is added to the third contact.
Replacing an existing note
Prerequisites: Contact already has a note.
Test case: note 1 nt/Student is doing well
Expected UI changes: The existing note on the first contact is replaced with "Student is doing well".
Team size: 4
Unlike AB3, which manages a single type of entity (persons), ClassHive categorizes contacts into students, parents, and senior management. It also introduces sorting and a favorite feature, adding complexity to data handling, commands, and UI design while ensuring ease of use for teachers.
We reused portions of AB3's architecture and core functionality while adapting to our use case. For instance, we modified existing commands (Add,Delete,Edit) to handle the new command types and maintained the command-line interface. We added new features such as note function for contacts, mark contacts as favourite for quick access and more. Inclusive of adding and modifying test cases, the total time taken for each feature to be implemented or for an existing feature to be modified to fit our target audience was 5-6 hours.