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 studentId.
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
Here's a (partial) class diagram of the Logic component:
The sequence diagram below illustrates the interactions within the Logic component, taking execute("delete studentId") 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 WhoDatParser 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:
WhoDatParser 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 WhoDatParser 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 WhoDat, which Person references. This allows WhoDat to only require one Tag object per unique tag, instead of each Person needing their own Tag objects.
API : Storage.java
The Storage component,
WhoDatStorage 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.classId.commons package.
This section describes some noteworthy details on how certain features are implemented.
WhoDatParser creates AddCommandParser to parse user input string.
WhoDatParser receives the student's name, student id, email id, class id and tags from user input.
Then, WhoDatParser ensures that all fields match their respective validation regex. If the input is invalid, WhoDatParser throws a ParseException.
Otherwise, it creates a new instance of AddCommand.
Upon execution, AddCommand checks if a duplicate student contact exists. If there is no duplicate, AddCommand will add the student to the contact list.
... is used to represent a valid user input, as the full input is too long to be included in the diagram. A full example of a valid input is: add n/John i/A1234567X e/E1234567 c/CS210501
NOTE: The sequence diagram shows a simplified execution of the AddCommand.
WhoDatParser creates DeleteCommandParser to parse user input string.
WhoDatParser receives the student id from the user's input.
Then, WhoDatParser ensures that the student id matches the validation regex. If the input is invalid, WhoDatParser throws a ParseException.
Otherwise, it creates a new instance of DeleteCommand.
Upon execution, DeleteCommand deletes the student contact from the list.
NOTE: The sequence diagram shows a simplified execution of the DeleteCommand.
Target user profile:
Value proposition: WhoDat is a free desktop application that helps NUS teaching assistants manage student contacts faster than a typical mouse driven app.
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a/an … | I want to … | So that I can… |
|---|---|---|---|
* * * | SoC TA | add a student's contact | store their contact details |
* * * | SoC TA | delete a student's contact | remove outdated or incorrect contacts |
* * * | SoC TA | list all student contacts | view all my current students |
* * * | SoC TA | add tags to student contacts | include extra remarks about students |
* * * | SoC TA | save my student contacts locally | avoid losing my data when I close the app |
* * * | SoC TA | load my student contact details from a save file | access my saved data when I open the app |
* * * | SoC TA | clear my list of student contacts | create a new list for the next semester |
* * | SoC TA | edit my students' contact details | update their information if there are changes |
* * | SoC TA | filter my student contacts by tutorial group | quickly find students from any tutorial group |
* * | SoC TA | filter my student contacts by tag status | quickly find specific students with special conditions |
* * | SoC TA | mark/unmark a student for requesting a consultation | track the consultation needs of the student |
* * | SoC TA | search for a student by name | quickly locate specific student contacts |
* * | SoC TA | search for a student by NUS ID | quickly locate specific student contacts |
* * | SoC TA | delete multiple students at one go | de-clutter the contact list of outdated or incorrect contacts in as few commands as possible |
* | SoC TA | archive old student contacts | contact ex-students from previous semesters |
(For all use cases below, the System is WhoDat and the Actor is the user, unless specified otherwise)
Use case UC01: Add a new student contact
MSS
User requests to add student contact
System adds the contact to the list
System shows that user has been added
Use case ends.
Extensions
1a. The student with the same StudentId or Email already exists in the list.
Use case ends.
1b. The user's input has missing or invalid fields.
1b1. System shows an error message.
Use case ends.
Use case UC02: Delete a student contact
MSS
User requests to delete student contact
System deletes the contact from the list
System shows the contact has been deleted
Use case ends.
Extensions
1a. The list is empty.
Use case ends.
1b. The student does not exist in the list.
1b1. AddressBook shows an error message.
Use case ends.
Use case UC03: List all student contacts
MSS
User requests to view the list of all student contacts.
System displays the list of student contacts.
Use case ends.
Extensions
1a. The list is empty.
Use case ends.
1b. User enters an invalid command.
Use case ends.
Use case UC04: Find a student contact
MSS
User requests to find a student contact by name or student id.
System searches for matching contacts.
System displays the contact(s) that match the search criteria.
Use case ends.
Extensions
1a. User enters an empty query.
Use case ends.
1b. User enters an invalid student id or name format.
Use case ends.
2a. No matching contacts are found.
Use case ends.
Use case UC05: Edit a student contact
MSS
User requests to edit a student contact.
System updates the contact's details.
System shows a success message.
Use case ends.
Extensions
1a. The student id does not exist in the list.
Use case ends.
1b. The field to be edited is invalid or the value is incorrect.
Use case ends.
Use case UC06: Filter contacts by class or tag
MSS
User requests to filter student contacts based on class id or tag.
System filters the contacts based on the input filter criteria.
System displays the contacts that match the filter.
Use case ends.
Extensions
1a. User enters an invalid filter or tag.
Use case ends.
2a. No matching contacts are found.
Use case ends.
Use case UC07: Mass delete student contacts
MSS
User requests to delete multiple student contacts by specifying multiple student ids.
System deletes the contacts from the list.
System displays completion message where the student ids of the students who were deleted successfully, not found or completely invalid.
Use case ends.
Extensions
1a. No student ids are supplied.
3a. Invalid student ids were supplied in step 1.
Use case UC08: Clear the contact list
MSS
User requests to clear the contact list.
System deletes all contacts from the list.
System shows a success message.
Use case ends.
Extensions
1a. The list is already empty.
Use case ends.
Use case UC09: Exit the application
MSS
User requests to exit the application.
System closes the application.
Use case ends.
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
Run java -jar whodat.jar in a terminal.
Expected: Shows the GUI with a set of sample student 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 typing java -jar whodat.jar in a terminal.
Expected: The most recent window size and location is retained.
Adding a valid contact
Prerequisite: A duplicate contact cannot exist.
Test case: add n/James i/A0277024H e/E1136951 c/110103
Expected: Contact is added with success status message.
Adding a duplicate contact
Prerequisite: A duplicate contact exists.
Test case: add n/James i/A0277024H e/E1136951 c/110103
Expected: Contact is not added to the list, an error message is shown.
Adding contact with invalid fields
Omit a field like class id: add add n/James i/A0277024H e/E1136951
Expected: An error message showing the correct add format.
Other fields to omit include name, student id and email id.
Deleting a person while all persons are being shown
Prerequisites: List all persons using the list command. Multiple persons in the list.
Test case: delete AxxxxxxxX, where x are numerical digits and X is a capitalised letter
Expected: If student id is valid, then contact is deleted from the list. Details of the deleted contact shown in the status message.
Test case: delete A29
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: delete, delete 1, /delete
Expected: Similar to test case 2.
Deleting more than one person
Prerequisites: List all persons using the list command. Multiple persons in the list.
Test case: m_delete
Expected: An error message detailing that at least one student id should be supplied.
Test case: m_delete AxxxxxxxX, AxxxxxxxX, where x are numerical digits and X is a capitalised letter
Expected: If student ids are valid and existent, then the student ids are deleted from the list. If the student ids are
valid but non-existent or are invalid, they are not removed from the list. Student ids of the successfully deleted
students, missing students and invalid students are displayed.
Test case: m_delete AxxxxxxxX, AxxxxxxxX, where x are numerical digits and X is a capitalised letter, and both student ids are the same.
Expected: If both the student ids are valid, the duplicate is removed and deletion happens only once. The message
displayed is similar to test case 3 but the duplicate, valid student id is displayed only once.
Test case: m_delete AxxxxxxxX AxxxxxxxX, where x are numerical digits and X is a capitalised letter, and no comma-separation.
Expected: No deletion happens and the input student ids are displayed as invalid student ids.
Test case: m_delete A2910
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: /m_delete, m delete
Expected: An error message warning about invalid command being used.
List all student contacts
Prerequisite: Ensure that the list is not empty.
Test case: list
Expected: The list should display all contacts.
Test case: /list
Expected: An error message.
Edit a student contact
Prerequisite: The contact must already be in the list.
Test case: edit StudentId field/new_value
Example: edit A0272222H n/Xinyi
Expected: Contact is edited with success status message.
Edit a student contact using an invalid input
Prerequisite: Input format is wrong.
Test case: edit StudentId field/wrong_value
Example: edit A0272222H e/Xinyi
Expected: Contact is not edited, an error message is shown.
Find using name
Prerequisites: The contact must already exist in the list. Let's use 'Jane' as an example.
Test case: find Jane
Expected: All contacts with the name 'Jane' (case-insensitive) are displayed.
Test case: find jane
Expected: All contacts with the name 'Jane' (case-insensitive) are displayed.
Find using student id
Prerequisites: The contact must already exist in the list. Let's use 'A1234567B' as an example.
Test case: find A123456B
Expected: The contact is displayed.
Test case: find a123456b
Expected: The contact is displayed (find is case-insensitive).
Find with an empty input
findFilter by class id
Prerequisite: There must be at least one contact with the chosen class id.
Test case: filter_c class id
Example: filter_c cs210501
Expected: All contacts with the same class id (case-insensitive) are displayed.
Test case: filter_c CS210501
Expected: All contacts with the same class id (case-insensitive) are displayed.
Find using tag
Prerequisites: There must be at least one contact with the chosen tag.
Test case: filter_t tag
Example: filter_t NoSubmission
Expected: All contacts with the same class id (case-insensitive) are displayed.
Test case: filter_t nosubmission
Expected: All contacts with the same class id (case-insensitive) are displayed.
Filter with an empty input
filter_cClear the contact list
Prerequisite: Ensure that the list is not empty.
Test case: clear
Expected: A success message stating that WhoDat has been cleared.
Data is automatically saved when you exit the program
Type list and ensure that the list is not empty.
Test case: exit and open the WhoDat application again
Expected: The list of student contacts previously saved are displayed.
Exit by clicking the close button at the top right
Exit via exit command
exit to close the window.Team size: 5
edit from modifying a contact such that it has a duplicate studentId or emailId. Currently, this feature
flaw of edit might introduce duplicates into the database, which violate the assumption that no duplicate is allowed in
the database. This is known to lead other bugs in other features when duplicates are present, such as
m_delete and delete, which would only delete the first duplicate studentID found.find command such that it works for partial names such as "ja" in "Jane". Currently, find can tolerate
incomplete names as far as the name input is a complete word. Partial name input can lead to undetected results.undo command to help user recover from the previous step. This way, users can easily go back from accidentally
changing the database.clear command, which currently results in an irreversible
loss of data.edit_t and delete_t commands. Currently, editing and deleting tags are
achievable through the current edit command, by inputting the new tags which will completely override the old ones.
However, Tags should be made to be able to be modified or deleted individually by aforementioned commands to provide
greater convenience to the user.add and delete.CS1101-01.