JavaFX
,Jackson
,JUnit5
.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.
The Sequence Diagram below shows how the components interact with each other for the general command scenario, such as addGrade
.
The proposed undo/redo mechanism is facilitated by VersionedAddressBook
. It extends AddressBook
with an undo/redo history, stored internally as an addressBookStateList
and currentStatePointer
. Additionally, it implements the following operations:
VersionedAddressBook#commit()
— Saves the current address book state in its history.VersionedAddressBook#undo()
— Restores the previous address book state from its history.VersionedAddressBook#redo()
— Restores a previously undone address book state from its history.These operations are exposed in the Model
interface as Model#commitAddressBook()
, Model#undoAddressBook()
and Model#redoAddressBook()
respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The VersionedAddressBook
will be initialized with the initial address book state, and the currentStatePointer
pointing to that single address book state.
Step 2. The user executes delete 5
command to delete the 5th person in the address book. The delete
command calls Model#commitAddressBook()
, causing the modified state of the address book after the delete 5
command executes to be saved in the addressBookStateList
, and the currentStatePointer
is shifted to the newly inserted address book state.
Step 3. The user executes add n/David …
to add a new person. The add
command also calls Model#commitAddressBook()
, causing another modified address book state to be saved into the addressBookStateList
.
Note: If a command fails its execution, it will not call Model#commitAddressBook()
, so the address book state will not be saved into the addressBookStateList
.
Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the undo
command. The undo
command will call Model#undoAddressBook()
, which will shift the currentStatePointer
once to the left, pointing it to the previous address book state, and restores the address book to that state.
Note: If the currentStatePointer
is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The undo
command uses Model#canUndoAddressBook()
to check if this is the case. If so, it will return an error to the user rather
than attempting to perform the undo.
The following sequence diagram shows how an undo operation goes through the Logic
component:
Note: The lifeline for UndoCommand
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
Similarly, how an undo operation goes through the Model
component is shown below:
The redo
command does the opposite — it calls Model#redoAddressBook()
, which shifts the currentStatePointer
once to the right, pointing to the previously undone state, and restores the address book to that state.
Note: If the currentStatePointer
is at index addressBookStateList.size() - 1
, pointing to the latest address book state, then there are no undone AddressBook states to restore. The redo
command uses Model#canRedoAddressBook()
to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
Step 5. The user then decides to execute the command list
. Commands that do not modify the address book, such as list
, will usually not call Model#commitAddressBook()
, Model#undoAddressBook()
or Model#redoAddressBook()
. Thus, the addressBookStateList
remains unchanged.
Step 6. The user executes clear
, which calls Model#commitAddressBook()
. Since the currentStatePointer
is not pointing at the end of the addressBookStateList
, all address book states after the currentStatePointer
will be purged. Reason: It no longer makes sense to redo the add n/David …
command. This is the behavior that most modern desktop applications follow.
The following activity diagram summarizes what happens when a user executes a new command:
Aspect: How undo & redo executes:
Alternative 1 (current choice): Saves the entire address book.
Alternative 2: Individual command knows how to undo/redo by itself.
delete
, just save the person being deleted).Target user profile:
Value proposition: manage contacts faster than a typical mouse/GUI driven app
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that … |
---|---|---|---|
* * * | Teaching Assistant | add a new student's contact | I can keep track of all my students in my course |
* * * | Teaching Assistant | view a student's contact information | I can contact a student directly if required |
* * * | Teaching Assistant | view a student's grades | I can have a comprehensive overview of each students' performance |
* * * | Teaching Assistant | record student grades | I can keep accurate records of their performance |
* * * | Teaching Assistant | query different statistics about student's grades (e.g. mean, median, etc.) | I can analyze their performance |
* * * | Teaching Assistant | list out all students | I can see who's contacts I have saved |
* * * | Teaching Assistant | view students' attendance | I can keep track of when a student has not shown up to class |
* * * | Teaching Assistant | mark students' attendance | I can keep track of who goes to class |
* * | Teaching Assistant | import student contact information from a csv | I can quickly add multiple students at once |
* * | Experienced teaching assistant | Migrate/get used to the app easily | it doesn't take so much time to get used to the new app to increase my productivity |
* * | Teaching Assistant | tag my students with different labels | it is easy for me to find/search them based on their tags |
* * | Teaching Assistant | link with my Canvas account | I can save time exporting grades |
* * | Busy Teaching Assistant | view a help message | I can quickly learn how to use the app |
* * | Teaching Assistant | separate my work (TA) contacts with my personal contact | I can have privacy and a line between work and life |
* * | Teaching Assistant that values privacy | sort students by performance metrics like attendance or participation | I can identify students who may need additional support. |
* * | Helpful Teaching Assistant | set up notifications for missing assignment or attendance | I can address potential issues with students |
* * | Teaching Assistant | track communication history with each student | I can refer to past discussions when addressing their needs |
* * | Teaching Assistant | sort student details by name | I can view student details in alphabetical order |
* * | Teaching Assistant | sort student details by grades | I can view students who are struggling with the course |
* * | Teaching Assistant | set up alerts for low attendance or poor participation | I can help struggling students early in the course |
* * | Responsible Teaching Assistant | attach remarks for each student | I can keep track of additional things to remember for each student |
* * | Teaching Assistant | add a custom column/property on the student database | I can personalize my contacts based on my own needs |
* * | Teaching Assistant | view assignment submission status for each student | I can find which students have not submitted assignments |
* * | Teaching Assistant | create notes for each student | I can track any special considerations |
* * | SoC Teaching Assistant | Link my account with github | I can review my students' code |
* | Teaching Assistant | view feedback from my students | I can improve my teaching |
* | Teaching Assistant | view only feedback scores lower than 2/5 | I can focus on improving on areas that are more important |
* | Teaching Assistant | collect students contact information | I can keep track and make use of it if required |
* | Teaching assistant with bad student management ability | automate student management | I can manage my students better |
* | Teaching Assistant | draft an email to the student with a summary of their grades and participation | notify students about their progress |
* | Teaching Assistant | access and archive past year exam papers | I can distribute the practice papers to students |
System: TAHub
Actor: Teaching Assistant (TA)
Use Case ID: UC01 - Add Contact
Main Success Scenario (MSS):
Use case ends.
Extensions:
System: TAHub
Actor: Teaching Assistant (TA)
Use Case ID: UC02 - View Contact
Main Success Scenario (MSS):
Use case ends.
Extensions:
System: TAHub
Actor: Teaching Assistant (TA)
Use Case ID: UC03 - Record Grade
Main Success Scenario (MSS):
Use case ends.
Extensions:
System: TAHub
Actor: Teaching Assistant (TA)
Use Case ID: UC04 - View Absentees
Main Success Scenario (MSS):
Use case ends.
Extensions:
System: TAHub
Actor: Teaching Assistant (TA)
Use Case ID: UC05 - Mark Attendance
Main Success Scenario (MSS):
Use case ends.
Extensions:
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 new person into an empty address book.
Prerequisites: No person currently in the list. Remove default list using the clear
command.
Test case: add n/John Doe p/98765432 e/johnd@example.com c/CS2103/T t/active
Expected: New person is added to the list. Details of the new person shown in the status message.
Test case: add n/Alex Yeoh p/81234567 e/invalid c/CS2103/T t/struggling
Expected: New person is not added. Error details shown in the status message for invalid email.
Test case: add n/Alex Yeoh p/81234567 p/98765432 e/alex@example.com c/CS2103/T
Expected: New person is not added. Error details shown in the status message for duplicate prefix.
Test case: add n/Jane Doe p/98765432 e/johnd@example.com c/CS2103/T
Expected: New person is not added as the course name and email are already used by John Doe. Error details shown in the status message for person already exists.
Other incorrect add commands to try: add
, add n/John Doe
, add x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Editing a person's details while all persons are being shown
Prerequisites: Two persons in the list obtained from using the following add
commands:
add n/John Doe p/98765432 e/johnd@example.com c/CS2103/T
add n/Betsy Crowe e/betsycrowe@example.com c/CS1231S p/1234567
Then list all persons using the list
command.
Test case: edit 1 n/Jane Doe
Expected: Name of the first person is changed to Jane Doe. Details of the edited person shown in the status message.
Test case: edit 2 p/87654321
Expected: Phone number of the second person is changed to 87654321. Details of the edited person shown in the status message.
Test case: edit 1 e/invalid
Expected: Email of the second person is not changed. Error details shown in the status message for invalid email.
Test case: edit 0 n/John Doe
Expected: No person is edited. Error details shown in the status message for invalid index.
Other incorrect edit commands to try: edit
, edit 1 x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Adding a grade to a person while all persons are being shown
Prerequisites: One person in the list obtained from using the following add
command:
add n/John Doe p/98765432 e/johnd@example.com c/CS2103/T
Then list all persons using the list
command.
Test case: addGrade 1 n/midterm s/90 w/40
Expected: New grade is added to the first person. Details of the new grade shown in the status message.
Test case: addGrade 1 n/midterm s/85 w/30
Expected: Old grade is overwritten with the new grade. Details of the edited grade shown in the status message.
Test case: addGrade 1 n/final s/150 w/50
Expected: No grade is added. Error details shown in the status message for invalid score.
Test case: addGrade 1 n/final s/80 w/90
Expected: No grade is added. Error details shown in the status message for total weightage exceeding 100%.
Other incorrect edit commands to try: addGrade
, addGrade 1 x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Marking a person's attendance while all persons are being shown
Prerequisites: One person in the list obtained from using the following add
command:
add n/John Doe p/98765432 e/johnd@example.com c/CS2103/T
Then list all persons using the list
command.
Test case: mark 1 d/31/01/2024 12:00 m/attended
Expected: Attendance is marked for the first person. Details of the attendance shown in the status message.
Test case: mark 1 d/31/01/2024 12:00 m/absent
Expected: Old attendance is overwritten with the new attendance. Details of the edited attendance shown in the status message.
Test case: mark 1 d/31/01/2024 12:00 m/invalid
Expected: No attendance is marked. Error details shown in the status message for invalid attendance status.
Test case: mark 1 d/31/01/2024 m/attended
Expected: No attendance is marked. Error details shown in the status message for invalid date or time.
Other incorrect edit commands to try: mark
, mark 1 x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Aggregating grades while all persons are being shown
Prerequisites: Two persons in the list obtained from using the following commands:
add n/Alex Yeoh p/87438807 e/alexyeoh@example.com c/CS2103/T
add n/Bernice Yu p/99272758 e/berniceyu@example.com c/CS2103/T
addGrade 1 n/midterm s/85 w/30
addGrade 1 n/final s/87 w/70
addGrade 2 n/midterm s/80 w/30
addGrade 2 n/final s/90 w/70
Then list all persons using the list
command.
Test case: aggGrade mean
Expected: Mean of all overall grades is calculated and shown in the status message.
Test case: aggGrade mean n/midterm
Expected: Mean of all overall midterm scores is calculated and shown in the status message.
Test case: aggGrade total
Expected: Error is thrown and shown in status message for invalid operation.
Other incorrect edit commands to try: aggGrade
, aggGrade x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Listing all persons absent on a certain date and time while all persons are being shown
Prerequisites: Two persons in the list obtained from using the following commands:
add n/Alex Yeoh p/87438807 e/alexyeoh@example.com c/CS2103/T
add n/Bernice Yu p/99272758 e/berniceyu@example.com c/CS2103/T
mark 1 d/31/01/2024 12:00 m/attended
mark 2 d/31/01/2024 12:00 m/absent
Then list all persons using the list
command.
Test case: absentees d/31/01/2024 12:00
Expected: List of all persons absent on the specified date and time is shown. Number of persons listed is shown in the status message.
Test case: absentees d/31/01/2024
Expected: No persons are listed. Error details shown in the status message for invalid date or time.
Other incorrect edit commands to try: absentees
, absentees x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
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 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message.
Test case: delete 0
Expected: No person is deleted. Error details shown in the status message for invalid index.
Other incorrect delete commands to try: delete
, delete x
, ...
(where x is larger than the list size)
Expected: Similar to previous.
Deleting a person's grade while all persons are being shown
Prerequisites: One person with midterm grades in the list obtained from using the following commands:
add n/John Doe p/98765432 e/johnd@example.com c/CS2103/T
addGrade 1 n/midterm s/90 w/40
Then list all persons using the list
command.
Test case: deleteGrade 1 n/midterm
Expected: Midterm grade is deleted from the first person. Details of the deleted grade shown in the status message.
Test case: deleteGrade 1 n/midterm
Expected: No grade is deleted. Error details shown in the status message for grade not found.
Other incorrect delete commands to try: deleteGrade
, deleteGrade 1 x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Deleting a person's attendance while all persons are being shown
Prerequisites: One person with attendance records in the list obtained from using the following commands:
add n/John Doe p/98765432 e/johnd@example.com c/CS2103/T
mark 1 d/31/01/2024 12:00 m/attended
Then list all persons using the list
command.
Test case: unmark 1 d/31/01/2024 12:00
Expected: Attendance is deleted from the first person. Details of the deleted attendance shown in the status message.
Test case: unmark 1 d/31/01/2024 12:00
Expected: No attendance is deleted. Error details shown in the status message for attendance not found.
Other incorrect delete commands to try: unmark
, unmark 1 x/XXX
where x/
is an unknown prefix.
Expected: Similar to previous.
Dealing with missing/corrupted data files
Back up the existing TAHub.json
file under the data directory.
Since the data file is corrupted, the application will show a blank list of contacts.
Adding any new contacts now, will override the old file.
You may attempt to repair the old corrupted file, by cross-checking the old corrupted file against the new, uncorrupted file created when a new contact is added after step 3.
Make sure to follow the constraints laid out in the user guide for each attribute of a Person
.
If the data file is successfully repaired, running TAHub.jar
should result in the old data being displayed back in the application.
Team size: 5
Allow more characters to be put in names: The current validation rule for names is to allow all combinations of alphanumeric characters, spaces, slashes, and the character @. While we have attempted to cover most cases by allowing slashes and @, there are other special characters we have not accounted for, such as commas, hyphens, and apostrophes. We plan to allow these characters so that users can put in their names exactly according to their legal name.
Make input validation for names more strict: On the other hand, simply allowing all combinations of characters in names may lead to users inputting nonsensical names. While this is not strictly a problem, we plan to integrate extra validation rules for names, e.g. ensuring that slashes are used in appropriate contexts like in 's/o' or 'd/o'. This will help users avoid adding invalid names by mistake into the address book.
Add support for filtering based on course names for related commands:
Some commands like aggGrade
may benefit from a feature to filter persons based on their courses, especially for TAs that teach more than one courses.
In aggGrade
, it would be useful for TAs to calculate the mean grade for a specific course, as opposed to all courses that they teach.
Therefore, we plan to add either an extension to aggGrade
or a new command (or both) to allow filtering based on course names.
Allow course names to contain prefixes:
While the Course
class allow any non-empty string value to be used as a course name, this is not entirely true as course names
containing prefixes, i.e. characters matching the regex [a-z]/.*
, can cause issues with the parser. For example, using course name
COURSE e/invalid
will always result in an error because the parser recognizes the e/invalid
substring as an email prefix, as opposed to part of the course name.
However, this is a rare scenario and there is a simple workaround by adding a space before the slash character.
In the next iterations, we plan to fix this issue or come up with an alternative to allow course names with these special characters.
Consistent use of status and error messages:
Currently, the messages for each command can differ in format quite significantly.
For example, the edit
command will always show the entire details of the edited person upon a successful command, while the addGrade
command only repeats the test name added and the person being added.
We plan to align the format of these messages to make it easier for users to understand the output of each command.
Make error messages more informative: Most error messages currently are quite generic and sometimes do not provide much information on what went wrong. It would be useful if the error could point to the exact part of the command that caused the error, and suggest possible solutions to the user. This is what we plan to do in the next iterations.
Make date and time parsing less strict:
Currently, the date and time parsing is quite strict, requiring the user to input the date and time in a specific format.
We plan to make the parsing less strict, allowing the user to input the date and time in a more natural way, e.g. 31-01-2024 1200
or Jan 31, 2024, 12pm
instead of 31/01/2024 12:00
.
Consistent use of terminology: Currently, DATE_TIME and DATETIME are used in different commands despite having the same meaining. We plan to ensure consistent use of terminology to make it easier for users to understand the command usage formats.
Enable truncation of listed records: When a student record contains a large number of attendances or grades, the UI would appear very cluttered. By enable truncation of information, users would be able to minimize the record when they are not focused on a record enabling them to view more records at once.
Allow multi-word tags: Currently, tags are limited to alphanumeric characters, which restricts how users can label each tag. We plan to remove this restriction to allow users to create more meaningful labels for students.