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
, TaskListPanel
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 DeleteTaskCommandParser
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., DeleteTaskCommandParser
) and uses it to parse the command.Command
object (more precisely, an object of one of its subclasses e.g., DeleteTaskCommand
) which is executed by the LogicManager
.Model
when it is executed (e.g. to delete a task).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., AddTaskCommandParser
) which uses the other classes shown above to parse the user command and create a XYZCommand
object (e.g., AddTaskCommand
) which the AddressBookParser
returns back as a Command
object.XYZCommandParser
classes (e.g., AddTaskCommandParser
, DeleteTaskCommandParser
, ...) 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.Task
objects (which are contained in a TaskList
object).Task
objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Task>
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. TaskList
implements the ReadOnlyTaskList
interface, and has a UniqueTaskList
that contains all Task
s. This allows TaskList
to be implemented in a way that is consistent to how AddressBook
is implemented, thus any benefits arising from the design decisions of Person
also applies to Task
. We are currently not adopting this model due to time constraints and the benefits are not immediately obvious.
API : Storage.java
The Storage
component,
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.addressbook.commons
package.
This section describes some noteworthy details on how certain features are implemented.
The proposed grouping mechanism is facilitated by GroupedUniquePersonList
. It extends UniquePersonList
with task that are linked between the people of the same group. Additionally, it implements the following operations:
GroupedUniquePersonList#assignTask(Task)
- Add task to everyone in the groupGroupedAddressBook#markTask(Index)
- Mark task of everyone in the groupGroupedAddressBook#unmarkTask(Index)
- Unmark task of everyone in the groupThese operations are exposed in the Model
interface as Model#assignTaskToGroup(String, Task)
, Model#markTaskOfGroup(String, Index)
and Model#unmarkTaskofGroup(String, Index)
respectively.
GroupedUniquePersonList
adds a new string called groupName
to label each of their groups.
A new list of GroupedUniquePersonList
will be added to the Model
interface.
To add to the list of GroupedUniquePersonList
, the Model interface includes Model#addGroup(String, List<Person>)
and Model#addListOfGroups(List<Group>)
.
To remove to the list of GroupedUniquePersonList
, the Model interface includes Model#removeGroup(String)
.
New operation are exposed in the Model
interface are Model#addPersonToGroup(String, Person)
, Model#removePersonFromGroup(String, Person)
and Model#deleteAssignedTaskGroup(String, Task)
which would call UniquePersonList#add(Person)
, UniquePersonList#remove(Person)
and UniquePersonList#deleteAssignedTask(Person)
respectively.
Given below is an example usage scenario and how the grouping mechanism behaves at each step.
Step 1. The user launches the application for the first time. The list of the GroupedUniquePersonList
will be empty if there are no groups stored in the storage.
Step 2. The user executes group gn/2103T gp/Ivan gp/Greg gp/Dave
command to group Ivan, Greg and Dave from the displayed person list to one group. The group
command calls Model#addGroup(String, List<Person>)
, which creates a new group with that contains the list of people that was indicated by the user.
Step 3. The user executes assigngroup gn/2103T gt/Task 1
command to assign a task named "Task 1" to the group named "2103T" from the group list. The assigngroup
command calls Model#assignTaskToGroup(String, Task)
, which finds the group with the same name and assign that task to everyone that is in the group.
Step 4. The user executes addpersontogroup gn/2103T gp/Bob
command to add Bob to the group named "2103T" from the group list. The addpersontogroup
command calls Model#addPersonToGroup(String, Person)
, which finds the group with the same name and add the person to the group.
Step 5. The user executes removepersonfromgroup gn/2103T gp/4
command to remove Bob from the group named "2103T" from the group list. The removepersonfromgroup
command calls Model#removePersonFromGroup(String, Person)
, which finds the group with the same name and remove the person to the group.
Step 6. The user executes deletetaskgroup gn/2103T gt/Task 1
command to remove a task named "Task 1" from the group named "2103T" from the group list. The deletetaskgroup
command calls Model#deleteAssignedTaskGroup(String, Task)
, which finds the group with the same name and remove that task from everyone that is in the group.
Step 7. The user executes deletegroup gn/2103T
command to remove the group from the list. The deletegroup
command calls Model#removeGroup(String)
, which finds the group with the same name and remove that group from the list.
The proposed undo/redo mechanism is facilitated by VersionedAddressBook
and VersionedTaskList
. The VersionedAddressBook
extends AddressBook
with an undo/redo history, stored internally as an addressBookStateList
and addressBookStatePointer
. The VersionedTaskList
extends TaskList
with an undo/redo history, stored internally as a taskListStateList
and taskListStatePointer
.
Additionally, they 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.VersionedTaskList#commit()
— Saves the current task list state in its history.VersionedTaskList#undo()
— Restores the previous task list state from its history.VersionedTaskList#redo()
— Restores a previously undone task list state from its history.These operations are exposed in the Model
interface as Model#commit()
, Model#undo()
and Model#redo()
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
and VersionedTaskList
will be initialized with the initial address book and task list state, with the addressBookStatePointer
and taskListStatePointer
respectively.
Step 2. The user executes addtask n/task1 …
to add a new task. The addtask
command also calls Model#commit()
, causing another modified task list state to be saved into the taskListStateList
.
Note: If a command fails its execution, it will not call Model#commit()
, so the state will not be saved.
Step 3. The user executes add n/Brook …
to add a new person. The add
command also calls Model#commit()
, causing another modified address book state to 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#undo()
, which will shift the addressBookStatePointer
once to the left, pointing it to the previous address book state, and restores the address book to that state.
Note: If the pointers are at index 0, pointing to the initial state, then there are no previous states to restore. The undo
command uses Model#canUndo()
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#redo()
, which shifts the pointers once to the right, pointing to the previously undone state, and restores the address book or task list to that state.
Step 5. The user decides that adding the person was not a mistake, and decides to redo that action by executing the redo
command. The redo
command will call Model#redo()
, which will shift the addressBookStatePointer
once to the right, pointing it to the next address book state, and restores the address book to that state.
Note: If the addressBookStatePointer
is at index addressBookStateList.size() - 1
or taskListStatePointer
is at index taskListStateList.size() - 1
, pointing to the latest state, then there are no undone states to restore for the respective commands. The redo
command uses Model#canRedo()
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 6. The user then decides to execute the command listtask
. Commands that do not modify the address book task list, such as listtask
, will usually not call Model#commit()
, Model#undo()
or Model#redo()
. Thus, the state lists and state pointers remains unchanged.
Aspect: How undo & redo executes:
Alternative 1 (current choice): Saves the entire address book and task list.
Alternative 2: Individual command knows how to undo/redo by itself.
deletetask
, just save the task being deleted).Target user profile:
Value proposition: This app aims to help leaders to keep track of members of formed groups and their contact information. This app helps to keep track of individual and group tasks, deadlines and meetings, thus allowing them to have a better overview of the structure.
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * | student | add personal tasks | keep up to date with the different tasks to complete |
* * * | student | delete tasks | |
* * * | student | mark/unmark the tasks as done/not done | keep track of tasks that are completed |
* * | group leader | assign tasks to individuals within the group | manage individual tasks |
* * | busy group leader | see an overview of all the saved task | save time |
* * | student | set deadline for my tasks | see which task need to be done earlier |
(For all use cases below, the System is the TeamTracker
and the Actor is the user
, unless specified otherwise)
Use case: Assigns a task
MSS
User requests to list of contacts
TeamTracker shows a list of contacts
User requests to assign a task to a contact
TeamTracker assigns the task to the contact
Use case ends.
Extensions
2a. The list is empty.
Use case ends.
4a. The task given does not exist.
4a1. TeamTracker shows an error message.
Use case ends.
Use case: Delete a task
MSS
User requests to list tasks
TeamTracker shows a list of tasks
User requests to delete a specific task in the list
TeamTracker deletes the task
Use case ends.
Extensions
2a. The list is empty.
Use case ends.
3a. The given index is invalid.
3a1. TeamTracker shows an error message.
Use case resumes at step 2.
Use case: Add a task
MSS
User requests to add a task to the list of tasks
TeamTracker adds to the list
Use case ends.
Extensions
2a. The given parameters is invalid.
2a1. TeamTracker shows an error message.
Use case ends.
11
or above installed.Team size: 5
s/o
or the character '
) are not supported under these constraints. We plan to loosen these constraints by accepting any character, as long as the given name is not blank.-
characters and spaces. We plan to loosen these constraints by accepting these characters as well.addtask
and edittask
against invalid dates, where for example dates like 30-02-2024
is implicitly replaced by 29-02-2024
, is counter-intuitive to the users. We plan to explicitly display an error message like Invalid date
to the user whenever a non-existent date is given.Task priority can take either an integer or low, medium, high, and it should not be blank
is inaccurate. We plan to make the error message also mention the range of accepted integers: Task priority can take either an integer between 1 and 3, or low, medium, high, and it should not be blank
.The person index provided is invalid
or The task index provided is invalid
is too general. We plan to make the error message also mention which indices are invalid: The person index 2, 3, 4 are invalid
, since mass ops fails whenever at least one of the provided indices is invalid.clear
command which clears all persons in the address book.edittask
command, where deadline can be removed from tasks by providing a blank by/
parameter.#006400
) or forest green (#228B22
) instead.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 1
Expected: First person is deleted from the list. Name of the deleted person shown in the status message. Timestamp in the status bar is updated.
Test case: delete 0
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 x
, ...
(where x is larger than the list size)
Expected: Similar to previous.
Prerequisites: List all tasks using the listtask
command. Multiple tasks in the list.
Test case: deletetask 1
Expected: First task is deleted from the list. Name of the deleted task shown in the status message. Timestamp in the status bar is updated.
Test case: deletetask 0
Expected: No task is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect deletetask commands to try: deletetask
, deletetask x
(where x is larger than the list size)
Expected: Similar to previous.
Prerequisites: List all tasks using the listtask
command. Multiple tasks in the list.
Test case: edittask 1 p/low
Expected: First task is edited. Name of the edit task shown in the status message. The priority will be updated to LOW
in this case.
Test case: edittask 0 p/low
Expected: No task is edited. Error details shown in the status message. Status bar remains the same.
Other incorrect edittask commands to try: edittask
, edittask 1
, edittask 1 p/very high
, edittask x
(where x is larger than the list size)
Expected: Similar to previous.
Prerequisites: One or more of the data files does not exist in the data folder.
Test case: tasklist.json is missing from the data folder on launch
Expected: TeamTracker should still launch and function as normal.
Other missing files: addressbook.json or both the data files
Expected: Similar to previous.