Refer to the guide [Setting up and getting started](SettingUp.md).
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). Certain types of commands (FileAccessCommand) can also communicate with the Storage when it is executed.Model and Storage) 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.
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.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.
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 add command extends Command and implements Undoable. The add command adds a contact based on the supplied parameters, of which
NAME, PHONE, and EMAIL are compulsory while ADDRESS, ROOM_NUMBER, and TAG are optional.
The add command is undoable.
Given below is an example usage scenario and how the add command behaves at each step.
Step 1. The user executes add n/John Doe p/+65 98765432 e/johnd@example.com r/01-1008 a/John street t/Floor 1.
Note: An error message will be displayed if attempting to add a contact with duplicate NAME, PHONE or EMAIL.
Step 2. The add command adds a contact with the name John Doe, phone number +65 98765432, email johnd@example.com, room number #01-1008, address John street, tag "Floor 1" to the address book.
The following sequence diagram shows how an add command goes through the Logic component:
Note: There are no destroy markers (X) for AddCommand as it is preserved in the undo command stack.
The following activity diagram summarizes what happens when a user executes a add command:
The edit command extends Command and implements Undoable. The edit command updates an existing contact based on the supplied index and parameters, of which
only the INDEX supplied, as well as any one field to update is compulsory.
The edit command is undoable.
Given below is an example usage scenario and how the edit command behaves at each step.
Step 1. The user executes edit 1 n/John Doe p/+65 98765432.
Note: An error message will be displayed if attempting to edit a contact to have with duplicate NAME, PHONE or EMAIL.
Step 2. The edit command updates the details of the contact with index 1 to have the name John Doe and phone number +65 98765432.
The following sequence diagram shows how an edit command goes through the Logic component:
Note: There are no destroy markers (X) for EditCommand as it is preserved in the undo command stack.
The following activity diagram summarizes what happens when a user executes a edit command:
The delete command extends Command and implements Undoable. The delete command deletes a contact based on its index. The delete command is undoable.
Given below is an example usage scenario and how the delete command behaves at each step.
Step 1. The user input a delete command followed by an index. For example: delete 1 deletes the contact with an index of 1.
Step 2. The parser parses the input command and returns a DeleteCommand.
Step 3. The DeleteCommand is executed by the LogicManager and delete popup get displayed.
Step 4. If user click Ok on the pop-up, model updates the filteredPersonList and removes the contact, otherwise cancel the deletion.
The following sequence diagram shows how a delete command goes through the Logic component:
The following activity diagram summarizes the delete pop-up mechanism:
The clean command extends Command and implements Undoable. The clean command deletes the contacts whose GradYear field is earlier than the current year, deleting contacts who have graduated from the address book. The clean command is undoable.
Given below is an example usage scenario and how the clean command behaves at each step.
Step 1. The user executes clean in 2024.
Note: The clean command checks if there are contacts with GradYear 2023 or earlier. If there are none, it will return an error message to the user.
Step 2. The clean command deletes all contacts with GradYear 2023 or earlier.
The following sequence diagram shows how a clean command goes through the Logic component:
Note: There are no destroy markers (X) for CleanCommand and GradYearPredicate as they are preserved in the undo command stack.
The following activity diagram summarizes what happens when a user executes a clean command:
Aspect: UI display when clean executes after a find command:
Alternative 1: Display all contacts.
clean.find command.Alternative 2 (current implementation): Retain the search results of find and only display those contacts.
find.clean until they return to the default view with list.The find command extends Command and implements Undoable. The find command searches and filters the contacts based on the following parameters: NAME, PHONE, ROOM_NUMBER, and TAG.The find command is undoable.
Given below is an example usage scenario and how the find command behaves at each step.
Step 1. The user issues a find command followed by specific parameters.
For example: t/friends n/Alex r/08-0805 p/9124 6892, searches for a profile with a
tag of friends, a name called Alex, a room number of 08-0805, and a phone number of 9124 6842.
Note : These parameters can be combined in any sequence, allowing for versatile parameter configurations.
Step 3. The FindCommand get executed and updates the filteredPersonList within the model, reflecting the search.
results based on the specified criteria.
The export command extends FileAccessCommand and by extension, Command. The export command exports the contacts in DorManagerPro to a JSON file in the data folder of the app.
Given below is an example usage scenario and how the export command behaves at each step.
Step 1: The user executes the export command.
Step 2: The export command exports all data currently contained by DorManagerPro to a JSON file in the data folder of the application.
Note: The name of the JSON file is the time of export in the format MM-dd-yyyy-HHmmssPM.
The following sequence diagram shows how an export command goes through the Logic component:
The following activity diagram summarizes what happens when a user executes an export command:
Aspect: The name of the JSON file on export.
Alternative 1: Use a generic format such as SAVE_FILE_1, SAVE_FILE_2.
Alternative 2 (current implementation): The time of the device's system at the moment of export.
exports happen within a short peri od of time. Also has no mention of contents of JSON file.Alternative 3: A brief summary of the file such as FIRST-Alex_Jones LENGTH-20.
The import command extends FileAccessCommand and by extension, Command. It also implements Undoable. import loads data from a save file into DorManagerPro, with the file path of the save file provided by the user. The import command is undoable.
Given below is an example usage scenario and how the import command behaves at each step.
Step 1. The user executes import fp/./data/SaveFile3.json
Step 2. The import command locates the save file via the file path and reads the data in the save file into DorManagerPro if it is of the correct format and has valid data.
Note: An error message is raised if the file path does not exist in the device or if the file itself cannot be read into DorManagerPro.
The following sequence diagram shows how an import fp/./data/SaveFile3.json command goes through the Logic component:
Note: There is no destroy marker (X) for ImportCommand as it is preserved in the undo command stack.
The lifeline for ImportCommandParser should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
The following activity diagram summarizes what happens when a user executes an import command:
Aspect: The exact format of the FILE_PATH parameter
Alternative 1: Take in only the name of the JSON file in the data folder of the home folder.
import into the data folder.Alternative 2 (current implementation): Require the user to type in the full file path of the JSON file they wish to import.
The undo mechanism is facilitated by the interface Undoable.
It has the undo() method. The undo() method is called when the user executes the undo command.
The undo() method reverses the effects of the command that was previously executed.
The undo() method is implemented in the undoable command classes, such as AddCommand, DeleteCommand, EditCommand, etc.
The Model component stores a history of executed undoable commands in a stack.
When a command is executed successfully, the command is pushed onto the stack.
When the user executes the undo command, the Model component pops the last command from the stack and calls the undo() method of the command.
These operations are exposed in the Model interface as Model#pushToUndoStack() and Model#undoAddressBook().
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 undo stack is initialised as empty.
Step 2. The user executes delete 5 command to delete the 5th person in the address book. The delete command is pushed onto the undo stack.
Step 3. The user executes add n/David … to add a new person. The add command is also pushed onto the undo stack.
Note: If a command is not undoable or fails its execution, it will not be pushed onto the undo stack.
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 pop the last command from the undo stack and call its undo() method. The undo() method of the command will then reverse the effects of the command.
Note: If the undo stack is empty, then there are no commands to undo. The undo command checks if this is the case. If so, it will return an error to the user.
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:
Step 5. The user then decides to execute the command list. Commands that do not modify the address book, such as list, will not be pushed to the undo stack. Thus, the undo stack remains unchanged.
Step 6. The user executes clear, which is pushed to the undo stack.
The following activity diagram summarizes what happens when a user executes a new command:
Aspect: How undo executes:
Alternative 1: Saves the entire address book.
Alternative 2 (current implementation): Individual command knows how to undo by itself.
delete, just save the person being deleted).Target user profile: University dormitory manager (teacher residents or admins at Dorm Halls)
Value proposition: Provide fast and centralised access to vital resident information.
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | forgetful dorm manager | see usage instructions | refer to instructions when I forget how to use the App |
* * * | dorm manager | add a new contact | keep track of students in my dorm |
* * * | dorm manager | delete a contact | remove entries when residents leave the dorm to prevent clutter |
* * * | dorm manager | view contacts | |
* * * | dorm manager | see emergency contacts of my residents | act quickly in the event of an emergency |
* * * | strict dorm manager | know my residents' room number | go check on them |
* * | bustling dorm manager | find a contact by their details (eg. name, room) | locate contacts without having to go through the entire list |
* * | dorm manager | edit a contact | update contact details |
* * | clumsy dorm manager | undo my actions | restore information if I accidentally delete them |
* * | dorm manager | give roles (responsibilities) to my residents | foster communal living |
* * | forgetful dorm manager | keep track of the roles of my residents (eg. RA, CCA leader) | know their responsibilities |
* * | dorm manager | find residents with certain roles (eg. RA, CCA leader) | view and contact them as a group |
* * | impatient dorm manager | load / save all resident details to a file | avoid typing in each resident's details |
* | dorm manager | sort contacts by name, room number | locate a contact easily |
* | forgetful dorm manager | search by partial matches | find contacts without memorising their full name |
* | neat dorm manager | group residents by block, floor, cluster, year | keep contacts organised in specific groups |
* | dorm manager | filter search results by roles or groups | find contacts in specific groups quickly |
* | dorm manager | view a summary of resident groups | get an overview of the dorm population |
* | dorm manager | keep track of demerit points of my residents | evict them when needed |
* | anxious dorm manager | know the phone, email and home address of my residents | contact residents through multiple channels in case they don't respond |
* | thoughtful dorm manager | know the major of my residents | provide care and support during stressful periods |
* | wholesome dorm manager | know the clubs of my residents | support their arts showcases / sports competitions |
* | enthusiastic dorm manager | know the food preferences of my residents | prepare welfare packs for them |
* | dorm manager | know the medical conditions of my residents | provide timely medical assistance |
* | dorm manager | know the nationality of my residents | better respect their culture |
* | thoughtful dorm manager | add a small description of each resident | note the quirks and interests of each resident |
* | dorm manager | keep the commands short and powerful | use it effectively with CLI experience |
(For all use cases below, the System is DorManagerPro, and the Actor is the user who refers to university dormitory managers unless specified otherwise.)
Use Case: UC01 - Add a profile
MSS:
User requests to add a specific profile, specifying name, contact number and email address.
DorManagerPro adds the profile.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
1c. DorManagerPro detects that the specified profile already exists.
Steps 1c1-1c2 are repeated until a valid profile is indicated. Use case resumes from step 2.
1d. DorManagerPro detects invalid parameters specified by user.
Steps 1d1-1d2 are repeated until the parameters are valid. Use case resumes from step 2.
*a. At any time, User chooses to stop adding a profile.
Use case ends.
Use Case: UC02 - Edit profile
Precondition: There is at least one profile added into DorManagerPro.
MSS:
User requests to edit or add additional information for a specific profile. This can be the name, phone number, email address, address, emergency contact details, graduation year or tags.
DorManagerPro updates the profile with the new or updated information.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
1b. DorManagerPro cannot find the specified profile to update.
Steps 1b1-1b2 are repeated until the command is correct. Use case resumes from step 2.
1c. DorManagerPro detects invalid parameters specified by user.
Steps 1c1-1c2 are repeated until the parameters are valid. Use case resumes from step 2.
*a. At any time, User chooses to stop editing.
Use case ends.
Use Case: UC03 - Delete all graduated students
Precondition: There is at least one graduated student profile added into DorManagerPro.
MSS:
User requests to delete all graduated students from the DorManagerPro address book.
DorManagerPro deletes all students with graduation years earlier than the current year.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
1b. DorManagerPro cannot find any students who have graduated.
Use case ends.
*a. At any time, User chooses to stop deleting all graduated students.
Use case ends.
Use Case: UC04 - View profiles
Precondition: There is at least one profile added into DorManagerPro.
MSS:
User requests to view all profiles.
DorManagerPro displays all profiles.
User requests to view certain profiles based on the profiles features (tags, roomNumber, number, name).
DorManagerPro displays all profiles with all attached information.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
3a. DorManagerPro detects an error in the command format.
Steps 3a1-3a2 are repeated until the command is correct. Use case resumes from step 4.
*a. At any time, User chooses to stop viewing a profile.
Use case ends.
Use Case: UC05 - Delete a profile
Precondition: There is at least one profile added into DorManagerPro.
MSS:
User requests to delete a specific profile.
DorManagerPro asks if user to confirm they want to delete the profile.
User confirms.
DorManagerPro deletes the profile.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
1b. DorManagerPro cannot find the specified profile to delete.
Steps 1b1-1b2 are repeated until the command is correct. Use case resumes from step 2.
1c. DorManagerPro detects invalid parameters specified by user.
Steps 1c1-1c2 are repeated until the parameters are valid. Use case resumes from step 2.
2a. User expresses they do not want to delete the profile after all.
Use case ends.
*a. At any time, User chooses to stop deleting a profile.
Use case ends.
Use Case: UC06 - Undoing an action
Precondition: There is at least one undoable action in the current session of DorManagerPro that has yet to be undone.
MSS:
User requests to undo the latest undoable action.
DorManagerPro restores the app to the state it was before the latest undoable action was carried out.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
1b. DorManagerPro detects that there are no undoable actions in the current session of DorManagerPro that has yet to be undone.
Use case ends.
*a. At any time, User chooses to stop undoing an action.
Use case ends.
Use Case: UC07 - Exporting the current data
MSS:
User requests to export the current data.
DorManagerPro exports the current data to a json file.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
*a. At any time, User chooses to stop exporting the current data.
Use case ends.
Use Case: UC08 - Importing data from a json file
Precondition: There is a json file in the valid format required to load to the address book.
MSS:
User requests to import data from a json file, specifying a file path to the json file.
DorManagerPro displays all profiles loaded from the imported json file.
Use case ends.
Extensions:
1a. DorManagerPro detects an error in the command format.
Steps 1a1-1a2 are repeated until the command is correct. Use case resumes from step 2.
1b. DorManagerPro detects an invalid file path or file format specified by user.
Steps 1b1-1b2 are repeated until the parameters are valid. Use case resumes from step 2.
*a. At any time, User chooses to stop importing.
Use case ends.
17 or above installed.pdf and docx that is often used for data storage.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
Saving window preferences
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: Delete popup shows up. After confirming on the popup, 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.
Other incorrect delete commands to try: delete, delete x, ... (where x is larger than the list size)
Expected: Similar to previous.
find find t/ John Doe, a phone number of 98765432, a room number of 08-0805, and a tag of friends.find n/John Doe p/98765432 r/08-0805 t/friends find n/John Doe p/abcd find n/John Doe r/abcd /, which is an invalid character in DorManagerPro. Exporting a contact list with one or more contacts.
export Exporting a contact list with zero contacts.
export { "persons" : [ ] }Importing a json file with valid data.
./data/SaveFile.json.import fp/./data/SaveFile.json SaveFile.json is loaded into DorManagerPro.Importing a json file with invalid data.
./data/SaveFile.json.import fp/./data/SaveFile.json
Expected: No information is imported into DorManagerPro. Error details shown in the status message.Importing a file that is not of json format.
./data/text.import fp/./data/text
Expected: Same as above.Importing a folder.
./data.import fp/./data
Expected: Same as above.Trying to import a file that does not exist on the device.
import fp/./data/SaveFile4.json where SaveFile4.json does not exist on the device Adding a person with only compulsory parameters specified.
Adding a person with all possible parameters specified.
add n/John Doe p/98765432 e/johnd@example.com r/05-0523 a/311, Clementi Ave 2, #02-25 t/Floor10 t/Table Tennis t/Floor 5 Adding a person with some compulsory parameters missing.
add n/John Doe add n/John Doe e/johnd@example.com r/05-0523 a/311, Clementi Ave 2, #02-25 t/Floor10 t/Table Tennis t/Floor 5 Adding a person with data that does not conform to data validation.
add n/John Doe p/abcd e/johnd@example.com add n/John Doe p/1234567 e/HAI Adding a person with duplicate phone.
add n/John Doe p/12345678 e/johnd@example.com add n/Alex Yeoh p/12345678 e/heyhey@example.com Editing a person with only some optional parameters specified.
edit 1 n/John Doe Editing a person with all possible parameters specified.
edit 1 n/John Doe p/98765432 e/johndoe@example.com r/05-0523 a/311, Clementi Ave 2, #02-25 en/Bob ep/12346789 g/2020 t/Floor10 Editing a person with data that does not conform to data validation.
edit 1 p/abcd edit 1 e/HAI Editing a person with duplicate phone.
edit 1 p/12345678 edit 2 p/12345678 Undoing a delete command.
delete command.undoUndoing a clear command.
clear command.undoNo command to undo.
undolist command. Multiple persons in the list, with at least 1 person with GRADUATION_YEAR field earlier than the current year.clean, executed in YEAR, where YEAR is the current year. clean dasd, executed in YEAR, where YEAR is the current year. find command, typing find n/NAME, replacing NAME with the name of any person in the address book.clean, executed in YEAR, where YEAR is the current year. find n\NAME. Use list to see the effects of the deletion. An example is shown below with screenshots.
clean, executed in YEAR, where YEAR is the current year. Team size: 5
Add more precise functionality to the clean command. The clean command currently does not allow removal of students who have graduated in the current year, as it can only detect the graduation year but not the month. We plan to add support for storing a more specific graduation date, such that we can accurately remove students who have graduated immediately after their graduation.
Add support for setting EmergencyName, EmergencyPhone and GraduationYear using the add command.
The add command currently does not allow setting emergency contact details and graduation year of students.
The only way to set these fields is through the edit command, which can be inconvenient for users.
We plan to add support for setting EmergencyName, EmergencyPhone and GraduationYear to the add command.
Add more features to the help command pop up window. The help command pop up window currently only shows instructions for three commands, add, edit and delete. We plan
to add instructions for all other features to make it easier to familiarise themselves with the commands without going to the external User Guide.
Add support to file path formatting in import. Currently, the FILE_PATH parameter for the import command only takes in forward slashes, /, when taking in user input, e.g. import fp/./data/SaveFile.json would be a valid file path for import, but import fp/.\data\SaveFile.json would not be valid. We plan to add support to \ as a delimiter between folders and files in the future to be more intuitive for users of all Operating Systems, especially those that use backslashes in file paths like Windows.
Improve specificity of import error messages. Currently, the error message for when the file exists on the device but is otherwise incompatible with DorManagerPro, whether this be because it is of the wrong file type, has a format incompatible with DorManagerPro or contains invalid data is as follows:
Could not read data from file FILE_PATH due to inability to find or access the file.
This error message could be more specific and our team plans to update this to the following error message:
DorManagerPro could not access the file at FILE_PATH. This could be because the file is of the wrong type, it has a format incompatible with DorManagerPro or it contains invalid data. Please check that the file path leads to a JSON file with valid data and formatting.
Consistent behavior for find. Currently, find has some inconsistent behaviour depending on the field that it is being searched by, making it counterintuitive for users. The problems are as following:
The name search is case-insensitive, but tag search is not. We plan to modify find t/ tag search to make it case-insensitive.
Searching by name filters contacts that match at least one keyword (i.e. OR search). E.g. Hans Bo will return Hans Gruber, Bo Yang. However, searching by phone number only filters contacts that match exactly to the optional country code, optional area code, and compulsory number. E.g. 98765432 will not return +65 98765432.
We plan to modify find p/ to allow searching by country code or area code only, and compulsory number only, so as to make this more versatile for users.
As we have adapted AB3 for university dorm managers, our main efforts were in adding support for other necessary fields, enhancing the duplicate handling and data validation, and providing extra functions to streamline data saving, adding, updating and to safeguard against mistakes. This posed substantial difficulties for us, as we had to work within the AB3 model and implement the multiple features to be compatible with the rest of the app. Thus, the was of considerable effort.
Here are some of the achievements of DorManagerPro:
Lines of Code: 24608
The undo functionality was initially implemented by extending an abstract class ConcreteCommand with the undo abstract method.
However, the import command is an undoable command that also extends the FileAccessCommand class.
This posed a challenge as the import command could not extend two classes at once because Java does not allow multiple inheritance.
To overcome this, we had to refactor the ConcreteCommand class to an interface Undoable and let all undoable commands implement this interface.
This allowed us to implement the undo method in the import command.
Import and export was initially deemed odd to do since it would have to access Storage, whereas all other commands at the time only needed to have access to Model to be executed. Accordingly, we were fairly certain that it would have been inadequate for the import and export commands to inherit directly from Command.
The workaround our team decided on was to create a new class FileAccessCommand that would require a Model and Storage for it's execute which export and import could then inherit from. As FileAccessCommand inherits from Command this allowed export and import to continue using the polymorphism when parsing commands and in the LogicManager while having a unique execute to carry out its functions.
While AddressBook3 initially had address as a compulsory field when adding a person to the contact list, our team felt that in the context of DorManagerPro, addresses could instead be optional. In most cases, all the residents would by default live in the dorm managed by the user, and by extension have a common address. We then had to contemplate between the outright removal of the field or only making it optional. We decided to make it optional as it could still provide helpful information such as the students permanent residence outside the dorm in case the user had to contact them. Regardless, it was still quite a challenge to make the once compulsory field optional since it was so intertwined with the original AddressBook3.