.getStyleClass()
& .add()
methods in PersonCard.java to display the information clearly.PersonComparator
can be implemented.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
.
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 n/John")
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.
Overview
The add
command allows user to add students' contact into KonTActs.
The Sequence Diagram below shows how the logic component handles the user input.
Note: While the diagram shows the lifeline of objects even after their deletion, this is a limitattion of plantUML.
Details
LogicManager
object will be called to execute
the input.AddressBookParser
will identify the type of command is AddCommand
, before creating a AddCommandParser
to parse the details.AddCommandParser
will parse
the USER_DETAILS
before creating a AddCommand
.AddCommand
will be returned to LogicManager
.LogicManager
will then calls exectute
on AddCommand
while providing the model.AddCommand
to call the addPerson
method of model, adding the person to the model.CommandResult
object is subsequently created which indicates the success of AddCommand
.Example Usage
Logic:
AddGradeCommand.java
AddGradeCommandParser.java
The addGrade
command is used by KonTActs to add an assignment and grade to a contact.
The added assignments and grades uses HashMap
to store the assignments and grades in each person object.
This is illustrated in the activity diagram below:
HashMap
in the person object which stores all the added assignments of that person.MarkCommand
is used by KonTActs to allow TAs to mark the attendance for a student.Example Usage
API Export.java
The ExportCommand
is used by KonTActs to allow users to export contact data as a CSV file that can be
easily shared or imported. The ExportCommand operates on the existing list of contacts and
exports them to the specified file location.
A visual representation is shown below of how a typical user might use the ExportCommand
,
API : CommandHistory.java
The CommandHistory
is used by KonTActs to allow users to navigate and retrieve previous inputted commands. It follows a singleton pattern where only a single instance can be created.
CommandHistory
makes use of an ArrayList
to store the commands of the current user session.ArrayList
is destroyed at the end of the program and a new one will be created at the start of every session of KonTActs.index
points to the current command displayed in the command box of the Graphical user interface (GUI).When a user enters a command,
CommandHistory
instance already exists, then the command will be added to itCommandHistory
instance will be instantiated and the command will be added to itThis is illustrated in the activity diagram below:
When a user retrieves a command that was previously executed using ↑ or ↓,
CommandHistory
instance first checks if there are fields in the ArrayList
of the CommandHistory
instance.CommandHistory
instance then checks for the correct index
. (i.e. The index
is valid when it is between 0 and the size of the ArrayList
).If both conditions are satisfied, the ArrayList
is accessed with the index
and the command string (that was previously entered) will be returned and displayed on the command box of the GUI.
A visual representation is shown below of how a typical user might use the CommandHistory
,
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/an … | I want to … | So that … |
---|---|---|---|
* * * | CS2030S TA | store student's github username | I can easily reference them when grading assignments. |
* * * | user | add the student's contact number | I can easily reference them when I need to contact my students. |
* * * | CS2030S TA | add the contact details of other TAs | I can quickly reach out for help or collaboration. |
* * * | CS2030S TA | add contact details of professors | I can easily reach them for guidance or to pass on important information. |
* * * | CS2030S TA | delete contacts easily | I dont clutter the list with unwanted contacts. |
* * * | CS2030S TA | store the grades and progress of my students | I can keep track of which of my students need more guidance and follow up. |
* * * | CS2030S TA | store student's telegram username | I can easily reference them and contact them when needed to. |
* * * | CS2030S TA | see the student's MC or reasoning when they do not turn up for lessons | I can create make up lessons / check up on them. |
* * | CS2030S TA | have a function to hide the details of students that I do not need | I can only the the information that I want to see. |
* * | CS2030S TA | view the last modification date of student contact details | I can confirm the accuracy and recency of the information stored. |
* * | CS2030S TA | create contacts with optional fields | I can resepct the privacy of my students. |
* | CS2030S TA | search for a student’s GitHub username | I can quickly access their repository for grading and feedback. |
* | potential user | see the application populated with sample data | I can see how the app looks like when it is in use. |
* | CS2030S TA | put the contacts into different tabs | I can easily navigate between different types of contacts. |
* | CS2030S TA | use the command line interface to search for contacts | I can integrate the tool smoothly into my existing workflow. |
* | CS2030S TA | search for the contact details of professors/ other TAs | I can quickly contact them for help if needed. |
* | CS2030S TA | find my students house in time | I can offer them help in times of crisis. |
* | CS2030S TA | organise the contact of my students | I can view the details of each student with greater ease. |
* | CS2030S TA | import student contact information from a file | I can easily transfer data between devices. |
* | CS2030S TA | export student contact information to a file | I can backup or share contact details with other TAs or professors if needed. |
* | CS2030S TA | flag specific students for follow-up | I can easily identify students who may need additional support or guidance. |
* | CS2030S TA | choose to sort my students | I can group students based on their proficiency. |
* | CS2030S TA | filter the contact details that is shown | I can easily find the information of a particular group. |
* | CS2030S TA | filter contacts based on a certain criteria | I can access a specific subset of students that I want. |
* | CS2030S TA | tag students with custom labels | I can categorize students based on their progress or needs. |
* | CS2030S TA | use the command line to access my students work | have their work and contact and tags all tied together in one smooth workflow. |
* | experienced user | create shortcuts for commands that I use frequently | I can access the frequently used information quickly. |
* | new user | use a help function to check what this app offers | I can easily have the details of the commands to use in my fingertips. |
* | CS2030S TA | create automatic flags to indicate if a student's work is marked | I can monitor grading deadlines so that I can stay on top of my responsibilities without missing any critical dates. |
(For all use cases below, the System is the KonTActs
and the Actor is the user
, unless specified otherwise)
Use case: UC01 - Add contacts
MSS
User chooses to add a contact, providing the information that is required.
KonTActs adds the new contact and indicates success.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs request for the correct input.
1a2. User enters a new input.
Steps 1a1 - 1a2 are repeated until input entered is correct.
Use cases resume from step 2.
Use case: UC02 - Delete contacts
Precondition
MSS
User chooses to delete a contact.
KonTActs deletes the contact and indicates success.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs request for the correct input.
1a2. User enters a new input.
Steps 1a1 - 1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
Use case: UC03 - Add grades of students
Precondition
MSS
User chooses to add grades for a student, providing the assignment details and grade.
KonTActs updates the grade of the student and indicates success.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs request for the correct input.
1a2. User enters a new input.
Steps 1a1-1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
Use case: UC04 - List contacts
MSS
User chooses to view the entire contact list.
KonTActs displays the full list of contacts.
Use case ends.
Use case: UC05 - Edit contacts
MSS
User chooses to edit a contact’s detail, providing the updated details.
KonTActs updates the details of the contact and indicates success.
Use case ends.
Extensions
1a. KonTActs detects that the contact provided does not exist.
1a1. KonTActs request for the correct input.
1a2. User enters a new input.
Steps 1a1-1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
1b. KonTActs detects that the new details provided is invalid.
1b1. KonTActs request for the correct input.
1b2. User enters a new input.
Steps 1b1-1b2 are repeated until the input entered is correct.
Use case resumes from step 2.
Use case: UC06 - Filter Contact List
MSS
User chooses to filter the contact list, providing the filter criteria.
KonTActs filters the contact list and displays the filtered list.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs request for the correct input.
1a2. Users enter a new input.
Steps 1a1-1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
Use case: UC07 - Export contacts
Precondition
User must have permission to write to the provided path.
User must have enough storage to store the output file.
MSS
User chooses to export the contact list, providing the file path.
KonTActs exports the contact list in CSV format and indicates success.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs request for the correct input.
1a2. User enters a new input.
Steps 1a1-1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
Use case: UC08 - Request for help
MSS
User inputs help command.
KonTActs shows a help page.
Use case ends.
Use case: UC09 - Tag students with custom labels
Precondition
MSS
User chooses to tag a student.
KonTActs requests for details of the student alongside the tag to label the student.
User enters the requested details.
KonTActs tags the student with the suggested label.
Use case ends.
Extensions
3a. KonTActs detects an error in the entered data.
3a1. KonTActs request for the correct data.
3a2. User enters new data.
Steps 3a1-3a2 are repeated until the data entered are correct.
Use case resumes from step 4.
Use case: UC10 - Import contacts from CSV file
Precondition
.csv
.MSS
User chooses to import the contact list, providing the desired file path.
KonTActs imports the contact list from the specified file path and indicates successful import.
Use case ends.
Extensions
1a. KonTActs detects the file provided is invalid.
1a1. KonTActs request for the correct file path.
1a2. User provides a new file path.
Steps 1a1 - 1a2 are repeated until KonTActs is able to import contacts from the file.
Use case resumes from step 2.
1b. KonTActs detects invalid content in CSV file.
1b1. KonTActs request for the correct file path.
1b2. User provides a new file path or update their CSV file
Steps 1b1 - 1b2 are repeated until KonTActs is able to import contacts from the file.
Use case resumes from step 1.
*a. At any time, User chooses to cancel the import.
*a1. KonTActs stops the import.
Use case ends.
Use case: UC11 - Sort Contact List
MSS
User chooses to sort the contact list, providing the sort criteria.
KonTActs sorts the contact list and displays the sorted list.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs requests for the correct input.
1a2. User enters a new input.
Steps 1a1-1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
Use case: UC12 - Open student's GitHub page
Precondition
MSS
User chooses to open the Github page of a student.
KonTActs opens the Github page on the user's default browser.
Use case ends.
Extensions
1a. KonTActs detects an error in the input.
1a1. KonTActs requests for the correct input.
1a2. User enters a new input.
Steps 1a1-1a2 are repeated until the input entered is correct.
Use case resumes from step 2.
Contact: An individual (e.g. student) stored in the system, typically having details regarding them such as their name, github username and etc.
Easy to use for new users: Intuitive commands that are easy to understand and UI that is easy to navigate.
Mainstream OS: Windows, Linux, Unix, MacOS.
Average typing speed: About 40 words per minute.
Uptime: The system should be operational during that period of time.
Between sessions: Every opening and closing of the application.
Proper documentation: A detailed user and developer guide which helps future users and developers to understand and use the code.
Typical usage: Normal or expected usage patterns of the application, such as the frequency of adding, deleting, or viewing contacts during everyday use.
Team member count: 5
kontacts.json
file manually to add or remove assignment details. This could be an issue as the information keyed in may be incorrect. We are planning to create commands which can add/edit assignment details (such as assignment name Ex04
and its respective maxGrade
fields) to the assignment.json
file. This is to make the adding/editing of new assignments easier and prevent wrong information being entered.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.
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 name/John Doe
Expected: Deletes the contact named John Doe. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
Other incorrect delete commands to try: delete
, delete n/ABC
, ...
(where name ABC
does not exist in the list)
Expected: An error message redirecting to the correct format.
Add a person to KonTActs
Test case: add name/John Doe email/johndoe@test.com telegram/@johndoe github/johndoe
Expected: Contact with name John Doe
is added to the list. Details of the added contact shown in the status message.
Test case: add name/John Do3 email/johndo3@test.com telegram/johndoe github/john#$doe
Expected: No person is added. Error details shown in the status message.
Other incorrect add commands to try: add
, add ...
(where ...
is any pair of prefix and value)
Expected: Similar to previous.
Test case: edit 1 name/John Tan
Expected: Contact shown at index 1 has name edited to John Tan
. Details shown in status message.
Test case: edit 0 name/John Tan
Expected: No contact is edited. Details of error shown in status message.
Other incorrect edit commands to try: edit -1 name/John Tan
, edit x name/John Tan
(where x
is a number that is not in the shown list)
Expected: Similar to previous
Prerequisites:
assignment.json
in data
with the following content:{
"assignments" : [
{
"name": "Ex01",
"maxScore": 5
},{
"name": "Ex02",
"maxScore": 5
},{
"name": "Ex03",
"maxScore": 5
},{
"name": "Ex04",
"maxScore": 5
}
]
}
Test case: addGrade n/John Doe a/Ex04 s/5
Expected: Assignment Ex04
with score 5
is added to John Doe
. Details of the added grade shown in the status message.
Test case: addGrade/John Doe a/Ex05 s/5
Expected: No grade is added to John Doe. Details of the error message is shown in the status message.
Other incorrect add grade commands to try: addGrade
, addGrade s/x
(where x
is not a number or x
is bigger than the max value of the assignment)
Expected: Similar to previous.
Prerequisites: Contact John Doe
with grades(assignment name,score) Ex01,5
and Ex02,3
added.
Test case: removeGrade n/John Doe a/Ex01
Expected: Assignment Ex01
is removed from John Doe
. Details shown in the status message.
Test case: removeGrade/John Doe a/Ex05 s/5
Expected: No grade is removed from John Doe. Details of the error message is shown in the status message.
Other incorrect remove grade commands to try: removeGrade
, removeGrade a/x
(where x
is any value)
Expected: Similar to previous.
Test case: mark n/John Doe w/5
Expected: John Doe
is marked as present for week 5. Details of the marked week is shown in status message and the list.
Test case: mark n/John Doe w/999
Expected: Attendance not marked for John Doe
. Details of the error is shown in the status message.
Other incorrect mark commands to try: mark
, mark n/JohnDoe
Expected: Similar to previous.
Test case: umark n/John Doe w/5
Expected: John Doe
is marked as absent for week 5. Details of the unmarked week is shown in status message and the list.
Test case: unmark n/John Doe w/999
Expected: No attendance unmarked for John Doe
.
Other incorrect unmark commands to try: unmark
, unmark n/JohnDoe
Expected: Similar to previous.
Prerequisites: example.csv
in data
"Name","Email","Telegram","Tags","Github","Assignments","WeeksPresent"
"Alex Yeoh","alexyeoh@example.com","@alex","[friends]","Alex","",""
"Bernice Yu","berniceyu@example.com","@bernice","[colleagues],[friends]","Bernice","",""
"Charlotte Oliveiro","charlotte@example.com","@charlotte","[neighbours]","Charlotte","",""
"David Li","lidavid@example.com","@david","[family]","david","",""
"Irfan Ibrahim","irfan@example.com","@irfan","[classmates]","Irfan","",""
"Roy Balakrishnan","royb@example.com","@roy","[colleagues]","Roy","",""
Test case: import path/data/example.csv
Expected: example.csv
is imported.
Test case: import path/data/x.csv
Expected: No data is imported. Details of the error is shown in status message.
Other incorrect import commands to try: import
, import path/
Expected: Similar to previous.
Test case: export path/data/example.csv
Expected: example.csv
is exported. Details shown in status message.
Test case: export
Expected: No data is exported. Details of the error is shown in status message.
Other incorrect export commands to try: export path/
Expected: Similar to previous.
Test case: filter t/friends t/colleague
.
Expected: List shows contacts with tags friends
or colleague
.
Test case: filter
Expected: No change in list. Details of error shown in status message.
Other incorrect filter commands to try: filter s/
, filter t/
Expected: Similar to previous.
github, name, telegram or reset
) of given person
Test case: sort name order/asc
Expected: List sorted based on name in ascending order. Details shown in status message.
Test case: sort email order/asc
Expected: List is not sorted. Details of error shown in status message.
Other incorrect sort commands to try: sort order/asc
, sort order/desc
Expected: Similar to previous.
Prerequisite: John Doe
, Alice
, and Cindy
exists in KonTActs.
Test case: find john doe alice
Expected: John Doe
and Alice
is found and revealed in the list. Details shown in status message.
Test case: find
Expected: No change. Details of error shown in status message.
Test case: view n/John Doe
Expected: View window for John Doe
appears. Details shown in status message.
Test case: view n/
Expected: No view window appears. Details of error shown in status message.
Other incorrect view commands to try: view n
Expected: Similar to previous.
Prerequisite: John Doe
with Github username johndoe
exists.
Test case: github n/John Doe
Expected: Github page of John Doe
is opened in browser. Details is shown in status message.
list
Expected: List of contacts shown. Details shown in status message.clear
Expected: All contacts are removed from KonTActs. Details is shown in status message.help
Expected: A help window is shown with link to documentation.exit
Expected: Application exits after command.Dealing with missing files
Test case: Remove .json
from data
.
Expected: A sample list of KonTActs will be loaded.
Test case: Add an invalid value to kontacts.json
. e.g. "email":1
Expected: No contacts will be loaded.