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, 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.The sequence diagram below illustrates the interactions within the UI component when the window is resized, to dynamically change the number of displayed columns of contacts.
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 undo mechanism is implemented within ModelManager. It allows the user to restore the address book to its immediate previous state after a data-modifying command, but only once.
The undo mechanism is facilitated by ModelManager storing a ReadOnlyAddressBook named previousAddressBook. It implements the following operations:
ModelManager#commitAddressBook() — Saves a copy of the current address book state before a data-modifying command executes.ModelManager#undoAddressBook() — Restores the address book state from the stored backup and clears the backup to ensure only one undo is possible.ModelManager#canUndo() — Checks if a backup state exists.These operations are exposed in the Model interface as Model#commitAddressBook(), Model#undoAddressBook() and Model#canUndo() respectively.
Given below is an example usage scenario and how the undo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The ModelManager is initialized with the initial address book state. previousAddressBook is null.
Step 2. The user executes the delete 5 command. The command calls Model#commitAddressBook(), which saves the state before the deletion into previousAddressBook. The command then deletes the person.
Step 3. The user executes add n/David … to add a new person. The add command also calls Model#commitAddressBook(), overwriting previousAddressBook with the state that included everyone except the 5th person. The command then adds David.
Note: If a command fails its execution, it will not call Model#commitAddressBook(), preserving the existing undo state.
Note: Non-data-modifying commands like sort, list and find will not call Model#commitAddressBook(), preserving the existing undo state.
Step 4. The user decides adding David was a mistake and executes undo. The UndoCommand calls Model#undoAddressBook(), which restores the Model to the state saved in previousAddressBook (the state after the deletion but before the add). previousAddressBook is then set back to null.
Note: If previousAddressBook is null, the user cannot perform an undo. UndoCommand uses Model#canUndo() to verify state before attempting the restoration.
The following sequence diagram shows how an undo operation goes through the Logic and Model components:
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.
The current single-state backup in ModelManager can only support undoing a maximum of one command. To support a multiple undo feature, the current single-state backup in ModelManager would need to be upgraded to a state history list (similar to the original AB3 proposal). This would involve:
previousAddressBook with an addressBookStateList and a currentStatePointer.Model#undoAddressBook(), to move the pointer backward in the history list to restore a previous state.undo, all "redoable" states at the end of the list must be deleted.Aspect: How undo executes:
Alternative 1 (current choice): Saves the entire address book.
Alternative 2: Individual commands know how to reverse themselves (eg an AddCommand does undo by performing a delete).
Due to time constraints, Alternative 1 was implemented.
Target user profile:
Value proposition: manage critical employee information faster than a typical mouse/GUI driven app
The app does not support managing larger workgroups beyond the average startup size (~50 people) and will only manage critical employee-related information such as contact details, departments, team structures and salaries.
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | new user with internet access | see usage instructions in User Guide | refer to instructions when I learn or forget how to use the app |
* * * | user without internet access | view an offline help menu | learn basic usages of the app even when I am offline |
* * * | user | add a new employee | I can record details about an employee |
* * * | user | delete an employee | ensure data privacy by removing past employees |
* * * | user | find employee(s) by specific details | locate details of employees without having to go through the entire list |
* * | forgetful user | find employee(s) by substrings | locate details of employees without having to go through the entire list or remembering full specific details |
* * * | returning user | save and load contacts via a file | quickly restore data from a past session |
* * | user who likes categorising details | add tags to employee contacts | organise employee records by tags |
* * | user who likes categorising details | remove tags to employee contacts | organise employee records by tags |
* | busy user who likes categorising details | mass add and remove tags from specific persons displayed contact list | efficiently organise employee records by tags |
* * | user who may not have all details at the moment | add a new employee with partial details | at least create a simple record in the contact list, to be updated later |
* * | user who is prone to typing wrongly | be able to view my employee contact list when I type a command wrongly | refer to the employee details when I want to redo my command |
* * | busy user | edit specific employee details | can be more efficient by not having to delete existing contacts and adding updated ones |
* * | user who handles many specific employee details | sort employees by a specified order | quickly view or gather information about employees with a certain criteria |
* * | user has a small screen | maximise my contact list on screen | view employee details on a larger screen and not see output box when I do not need it |
* * | user prone to typos | undo my previous command | efficiently restore past details without having to check what they orginally were |
* | new user replacing past HR manager | upload file to add a group of employees at once | be able to not add employees one by one |
* | user who wants to check employees with missing details | view highlighted missing details of employees | efficiently see missing information that I have to fill in |
* | user afraid of losing current employee data | manual backup current employee data to a secondary file | guard against corruption of main data file |
(For all use cases below, the System is the Big Brother and the Actor is the user, unless specified otherwise)
Use case: UC1 Add a person
MSS
User requests to add a person
Big Brother indicates that a person is added
Use case ends.
Extensions
1a1. Big Brother shows an error message
Use case resumes at step 1.
Use case: UC2 Add a tag to a person
MSS
User requests to list persons
Big Brother shows a list of persons
User requests to add a tag to a specific person in the list
Big Brother adds the tag to the person
Use case ends.
Extensions
1a. The list is empty
Use case ends.
3a. The given person's index is invalid
3a1. Big Brother shows an error message
Use case resumes at step 2.
Use case: UC3 Delete a person
MSS
User requests to list persons
Big Brother shows a list of persons
User requests to delete a specific person in the list
Big Brother deletes the person
Use case ends.
Extensions
1a. The list is empty
Use case ends.
3a. The given person's index is invalid
3a1. Big Brother shows an error message
Use case resumes at step 2.
Use case: UC4 Delete a tag
MSS
User requests to list persons
Big Brother shows a list of persons
User requests to delete a tag from a specific person in the list
Big Brother deletes the tag from the person
Use case ends.
Extensions
1a. The list is empty
Use case ends.
3a. The given person's index is invalid
3a1. Big Brother shows an error message
Use case resumes at step 2.
3b. The tag specified cannot be found
3b1. Big Brother shows an error message
Use case resumes at step 2.
Use case: UC5 Find a person
MSS
User requests to find a specific person
Big Brother displays the details of the specific person
Use case ends.
Extensions
1a1. Big Brother shows an error message
Use case ends.
{More to be added}
17 installed.jar or zip file.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
{ more test cases … }
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. 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
{ more test cases … }
Dealing with missing/corrupted data files
{ more test cases … }