MustVas was adapted from AB-3.
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:
When 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.
This results in a Command
object (more precisely, an object of one of its subclasses e.g., DeleteCommand
) which is executed by the LogicManager
.
The command can communicate with the Model
when it is executed (e.g. to delete a person).
Note that although this is shown as a single step in the diagram above (for simplicity), in the code it can take several interactions (between the command object and the Model
) to achieve.
The result of the command execution is encapsulated as a CommandResult
object which is returned back from Logic
.
For commands that have no arguments, instead of creates a parser that matches the command (e.g., ListCommandParser
), the Command
object(e.g. ListCommand) is simply returned by the AddressBookParser
.
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:
When called upon to parse a user command, the 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.
All 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,
Classes
objects. (Each Classes
object has its own AddressBook).Classes
instance, and its corresponding AddressBook
.Person
objects in the AddressBook
of the currently selected Classes
instance (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,
ClassBookStorage
, AddressBookStorage
and UserPrefStorage
, which means it can be treated one of the above. (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.addressbook.commons
package.
This section describes some noteworthy details on how certain features are implemented.
The create
command is used to create a class. Below is the sequence diagram when the create
command is used.
The below activity diagram illustrates the process of creating a new class.
The select
command is used to select a class. Below is the sequence diagram when the select
command is used.
The below activity diagram illustrates the process of selecting a class.
The add
command is used to add a new student. Below is the sequence diagram when the add
command is used.
The below activity diagram illustrates the process of adding a new student.
The edit
command is used to edit a student's information (name, phone, email, student id, description). Below is the sequence diagram when the edit
command is used.
The below activity diagram illustrates the process of editing a student.
The adda
command is used to add an attendance record to all students. Below is the sequence when the adda
command is used.
The below activity diagram illustrates the process of adding a new attendance record.
The edita
command is used to edit an attendance record of some students. Below is the sequence when the edita
command is used.
The below activity diagram illustrates the process of editing an attendance records for the selected students.
The dela
command is used to delete an attendance record of all students. Below is the sequence when the dela
command is used.
The below activity diagram illustrates the process of deleting an attendance record.
The Classes feature is built using the basic structure of AddressBook
. Classes
represents a tutorial class.
A ClassBook
instance holds all current Classes
instances. This is stored in the data folder as classbook.json
file.
Each Classes
instance contains an instance of Addressbook
, which holds a list of Person
instances
representing the students in the Class. Each Classes
instance stored in data as [className].json
where
className is the name of the Classes
instance e.g. CS2103.json
Problem 1:
The original structure of AB3 only allows for a single file path for storage, which was set to addressbook.json
by default. This was a big problem, as our intended implementation of the Classes feature necessitated
multiple .json files to make sharing data between tutors easier.
Solution 1 v1.0:
Rather than use the filepath specified in the preferences.json
, ModelManager
was changed to use
its own instance of Storage
, to call the saveAddressBook
with selectedClass.getFilePath()
as the second parameter. This works, but SLAP is not ideal with the current implementation.
Problem 1:
Since the original AB3 had only one command (find) that required the UI to be updated, the UI was implemented to update
based on the contents of the filteredPersonsList
. This was inadequate for our classes feature, which
requires the UI's PersonListPanel
to be updated upon selecting a different class.
Solution 1:
A list of UiUpdateListener
- List<UiUpdateListener> uiUpdateListeners
is created in ModelManager by calling
modelManager.addUiUpdateListener(uiManager);
in MainApp. The listeners monitors for calls to the select
command,
and call mainWindow.fillInnerParts()
to update the UI PersonListPanel.
Target user profile:
Value proposition: Makes tutors life easier by increasing convenience of checking progress and compacting all the relevant information for easy access (Student contact information, attendance records, summary of attendance statuses, etc.)
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * | User who teaches multiple classes | View my classes | See all the classes I'm currently managing at a glance |
* * * | User who teaches multiple classes | Select the class that I want to manage | Easily manage multiple classes |
* * * | User who teaches multiple classes | Create new class | Separate students into their respective classes |
* * * | User who teaches multiple classes | Delete class | Remove classes that is not needed anymore |
* * * | User who manages students | Add a new student to the class | Keep track of my students' profiles |
* * * | User who manages students | Delete a student from the class | Keep an updated record of students in the class |
* * * | User who manages student attendance | Create an attendance record for my students | Acknowledge a student's attendance (PRESENT, ABSENT, VALID REASON) |
* * * | User who manages student attendance | Delete an attendance record | Remove any unnecessary attendance records |
* * | User who manages students | Write descriptions for each student | Take note of certain students based on the description |
* * | User who manages students | Create assignments and grades for each student | Track my student's grades |
* * | User who manages student attendance | Edit the attendance record of students | Conveniently make changes to attendance when necessary |
* * | User who manages student attendance | View the attendance rate of a student | Easily view the student's overall attendance rate at one glance |
* * | Organised user | Browse students in the default alphabetical setting | easily scroll to find a particular contact |
* * | New user exploring the app | Access the user guide easily via a help button | Learn how to use the app |
* | Forgetful user | Schedule reminders for specific contact | Don't miss important dates or admin tasks |
* | User who uses Canvas LMS | Import the attendance data into Canvas | Easily upload attendance statistics for the school admin |
* | User who looking to be more efficient | Send emails/texts to an entire class | Easily communicate information to the students |
* | User who looking to be more efficient | Generate attendance reports | Easily submit them to school admin |
* | User who looking to be more efficient | Export Student date in multiple formats (etc. PDF) | Share the data with other tutors or professors easily |
(For all use cases below, the System is the MustVas
and the Actor is the user
, unless specified otherwise)
MSS
Use case ends.
Extensions
2a. The list is empty.
Use case ends.
3a. The user enters an invalid class index.
Use case ends.
MSS
Use case ends.
Extensions
1a. Enter an invalid class name (Contains non-alphanumeric characters, Contains spaces, or blank).
1b. Enter a duplicate class.
Use case ends.
MSS
Use case ends.
Extensions
1a. Enter an invalid command.
Use case ends.
MSS
Use case ends.
Extensions
1a. Enter an invalid class index.
Use case ends.
MSS
Use case ends.
Extensions
3a. User enters invalid details.
3b. Required fields are left empty.
3c. User tries to add duplicate student.
Use case ends.
MSS
Use case ends.
Extensions
3a. User enters invalid command.
Use case ends.
MSS
Use case ends.
Extensions
2a. User enters invalid command.
Use case ends.
3a. User inputs an invalid command.
Use case ends.
MSS
Use case ends.
Extensions
3a. User enters invalid command.
Use case ends.
4a. User inputs an invalid command.
Use case ends.
MSS
Use case ends.
Extensions
3a. User enters invalid command.
Use case ends.
4a. User inputs an invalid command.
Use case ends.
MSS
Use case ends.
Extensions
2a. User enters invalid command.
Use case ends.
3a. User inputs an invalid command.
Use case ends.
MSS
Use case ends.
Extensions
2a. User enters invalid command.
Use case ends.
3a. User inputs an invalid command.
Use case ends.
4a. User inputs invalid class.
Use case ends.
11
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.
Prerequisites: Nil
Test case: view
(at least one class)
Expected: Classes are displayed in the UI, each labelled with an index number(e.g. "1:CS2103 2:CS2101")
Test case: view
(no classes)
Expected: Interface displays a message stating you are not managing any classes, and prompts to create
a class
Test case: view randominput1234567
Expected: Identical behaviour to view
, Classes are displayed in the UI, each labelled with an index number(e.g. "1:CS2103 2:CS2101")
Prerequisites: At least one class must have been created. You may use view
to see all current classes (Note: It is not compulsory to use view
, as long as you know the index, you can select
your desired class)
Test case: select 0
Expected: No class is selected. Error details shown in the status message.
Test case: select 1
(At least one class exists)
Expected: The first class by index is selected. The filepath of the class' .json file will be shown on the bottom left corner/
Test case: select 10
(There are less than 10 classes)
Expected: No class is selected. Error details shown in the status message.
Prerequisites: At least one class must have been created. You may use view
to see all current classes (Note: It is not compulsory to use view
, as long as you know the index, you can rm
your desired class)
Test case: rm 0
Expected: No class is removed. Error details shown in the status message. The current filepath (in the bottom left corner) is not changed
Test case: rm 1
(At least one class exists)
Expected: The first class by index is selected. The current filepath (in the bottom left corner) will be changed to .\No class selected!
. (Note: Even if another class is selected, when any class is deleted, the .json file will be closed and the filepath will be displayed as .\No class selected!
.)
Deleting a person while persons are being shown
Prerequisites: At least one person shown in the interface. You may select
a class, find
a person, add
a person or use list
to see all persons in a class (note: list
is automatically called when you select
a class, so if the selected class has at least one person in it, they will show up in the interface).
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. Status bar remains the same.
Test case: delete 1
(no class selected)
Expected: Interface prompts you to select
a class first
Other incorrect delete commands to try: delete
, delete x
, ...
(where x is larger than the list size)
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
Adding a description while all persons are being shown
Prerequisites: At least one person shown in the interface. You may select
a class, find
a person, add
a person or use list
to see all persons in a class (note: list
is automatically called when you select
a class, so if the selected class has at least one person in it, they will show up in the interface).
Test case: description 1 desc/Hello
Expected: First student/contact has a description added to them. Details of where the description has been added is shown.
Test case: description 0 desc/Hello
Expected: Error message thrown. No description is added to any contact.
Other incorrect description commands: description 1 Hello
, description
, description desc/Hello
, description x desc/Hello
(Where x is larger than the list size)
Expected: Error message thrown. No description is added to any contact.
Adding a description works in concurrence with add/edit commands as well. As long as their prerequisites are met, and description is following a prefix desc/
, it should work effectively.
Dealing with missing/corrupted data files
.json
file of the class. .json
files manually and inputs invalid data.classbook.json
or new [class].json
will be created when program runs again.