TutorProxMax is adapted from AddressBook Level 3: https://github.com/nus-cs2103-AY2425S2/tp
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 1.
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 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 sequence diagram below illustrates how the list command is processed when the user enters a command such as list, list t/Math, list tt/Monday, list tt/mon .
This command allows users to either
listt/.
list t/math, list t/Science.tt/.
list tt/Monday, list tt/mon, list tt/Monday, 1000-1200The process involves the following key objects:
LogicManager parses the user input into a ListCommand.
ListCommand is executed via the Model.
The model updates its filtered list using the predicate provided by ListCommand.
The UI is automatically refreshed based on the updated filtered list.
The sort feature allows tutors to organize the student list based on specific fields such as name, address, email, phone, subject, or tuition timing. This improves usability by enabling tutors to view student data in a desired order, which is especially useful when managing many students.
The sort command is implemented using the SortCommand class, which accepts a field keyword (e.g., name, phone) and applies the corresponding comparator to the address book list. The command then updates the filtered person list with the sorted result.
The sorting logic is encapsulated in the PersonComparators utility class, which contains static comparators for each sortable field. This separation of concerns makes it easier to maintain and extend.
When the sort command is executed:
SortCommand with a specific comparator.sortPersonList method is called with this comparator.If an invalid or unsupported field is provided, the command will return an error message explaining valid options.
Target user profile:
Value proposition:
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | new user | see usage instructions | refer to instructions when I forget how to use the App |
* * * | user | add a student | keep track of all students and can refer to their contact details when I need |
* * * | user | delete a student | remove outdated or irrelevant student contact details |
* * * | user | view all students' contact details | easily access students’ information and retrieve their contact details efficiently |
* * * | user | find a student by his/her name | locate details of students without having to go through the entire list |
* * | user | edit a contact details | update new information without having to go through the process of delete and add |
* * | user | list lessons by date | view all lessons scheduled on a particular day |
* * | user | list students by subject | view all students with a filtered subject |
* * | user | sort students according to a field I specified | view all student a in particular order for to find them more easily |
* * | user | Press ↑ and ↓ keys after entering commands | navigate the previous commands more easily especially if i want to add, delete, edit multiple students |
(For all use cases below, the System is the AddressBook (TutorProMax) and the Actor is the user (tutor), unless specified otherwise)
Use case: Add a student
MSS
User requests to add a specific person in the list
TutorProMax adds the student
Use case ends.
Extensions
1a. The student already exists in the list
1a1. TutorProMax shows an error message
Use case: Delete a person
MSS
User requests to list persons
TutorProMax shows a list of persons
User requests to delete a specific person in the list
TutorProMax deletes the person
Use case ends.
Extensions
2a. The list is empty.
Use case ends.
3a. The given index is invalid.
3a1. TutorProMax shows an error message.
Use case resumes at step 2.
Use case: Find a student by his/her name
MSS
User requests to search for a student by name
TutorProMax searches for the student in the list
TutorProMax displays the matching student(s)
Use case ends.
Extensions
2a. No matching student found
2a1. TutorProMax displays a message indicating that no student matches the given name
Use case ends
Use case: List persons
MSS
User requests to list persons
TutorProMax lists all students in the address book.
Use case ends.
Extensions
list t/math).
list tt/monday).
list tt/monday t/math).
list tt/mondae)
Use Case: Sort students
MSS
User requests to sort students by a specified field and order.
TutorProMax sorts and displays the student list accordingly.
Use case ends.
Extensions
1a. User specifies a valid field and order (e.g. sort name asc)
1b. User specifies an invalid field (e.g. sort grade asc)
Invalid sort field. Valid fields: name, phone, email, address, tuition, tag1c. User omits sort order (e.g. sort name)
1d. User inputs an invalid sort order (e.g. sort name upwards)
asc or desc.Use Case: Edit a student
MSS
User requests to edit a specific student by specifying their index in the list.
TutorProMax updates the student’s details with the provided fields.
Use case ends.
Extensions
1a. The specified index is invalid (e.g. index does not exist in the current list)
1b. No fields are specified for editing (e.g. edit 2)
1c. User clears all tags by specifying t/ without any tags
1d. User specifies invalid values (e.g. email without '@', invalid phone number, etc.)
17 or above installed.Below are the manual test cases for verifying each feature of TutorProMax.
Note: These are starting points. Testers are encouraged to perform exploratory testing for more thorough coverage.
.jar file and copy it into an empty folder.cd into the folder.java -jar tutorpromax.jarCommand: add n/John Doe p/98765432 e/john@example.com a/123 Clementi Rd tt/Monday, 1000-1200 t/Math t/Science
add p/98765432Invalid command format! add: Adds a person to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS tt/TUITION_TIME [t/TAG]... Example: add n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 tt/Monday, 1400-1600 t/Math t/Science.add n/Jane p/abc123 → Same error message as above.Commands to Test:
list
list t/Math
list tt/Monday
Expected:
list: Shows all contacts.list t/Math: Filters only those with Math tag (case-sensitive).list tt/Monday: Filters only those with tuition on Monday.list tt/mondayyy Invalid day entered. Please use a valid day like 'monday' or 'mon' (case-insensitive). list with no prefix behind list all contacts. list with prefix list all contacts with the keyword specified in rhe prefix. Parameters: [field, keyword] There are 2 fields available: t/[subject] or tt/[tuition time (day)]. Example: list t/Math Example: list tt/Mondaylist t/ Please enter field and keyword! list with no prefix behind list all contacts. list with prefix list all contacts with the keyword specified in rhe prefix. Parameters: [field, keyword] There are 2 fields available: t/[subject] or tt/[tuition time (day)]. Example: list t/Math Example: list tt/MondayCommand: find John
find John Alexfind jOhNfind (no input) → Should show error.
Invalid command format! find: Finds all persons whose names contain any of the specified keywords (case-insensitive) and displays them as a list with index numbers. Parameters: KEYWORD [MORE_KEYWORDS]... Example: find alice bob charlieCommand: edit 1 p/91234567 e/new@example.com
edit 2 n/Alice t/ → Clears tags.edit 5 (no fields) → Error message.edit 0 or index out of bounds → Error message.Command: delete 2
delete → Error.delete abc → Error.delete 100 → Error if out of bounds.Commands to Test:
sort name asc
sort tuition desc
sort by email asc
Expected: List is sorted as specified.
sort by banana desc → Error: Invalid sort field.Command: clear
clear 123 → Should still work and clear everything.Command: exit
Command: help
↑ and ↓ keys after entering commands.[home]/data/addressbook.json