This app is based on AddressBook-Level3, courtesy of SE-EDU
Libraries used: JavaFX, JUnit5, Jackson
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
, WeddingListPanel
, 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 contact).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), as well as Wedding objects (contained in a UniqueWeddingList
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.ActiveTags
object that represents a collection of the current active tags in the AddressBook.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 proposed undo/redo mechanism is facilitated by VersionedAddressBook
. It extends AddressBook
with an undo/redo history, stored internally as an addressBookStateList
and currentStatePointer
. Additionally, it 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.These operations are exposed in the Model
interface as Model#commitAddressBook()
, Model#undoAddressBook()
and Model#redoAddressBook()
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
will be initialized with the initial address book state, and the currentStatePointer
pointing to that single address book state.
Step 2. The user executes delete 5
command to delete the 5th contact in the address book. The delete
command calls Model#commitAddressBook()
, causing the modified state of the address book after the delete 5
command executes to be saved in the addressBookStateList
, and the currentStatePointer
is shifted to the newly inserted address book state.
Step 3. The user executes add n/David …
to add a new contact. The add
command also calls Model#commitAddressBook()
, causing another modified address book state to be saved into the addressBookStateList
.
Note: If a command fails its execution, it will not call Model#commitAddressBook()
, so the address book state will not be saved into the addressBookStateList
.
Step 4. The user now decides that adding the contact was a mistake, and decides to undo that action by executing the undo
command. The undo
command will call Model#undoAddressBook()
, which will shift the currentStatePointer
once to the left, pointing it to the previous address book state, and restores the address book to that state.
Note: If the currentStatePointer
is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The undo
command uses Model#canUndoAddressBook()
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#redoAddressBook()
, which shifts the currentStatePointer
once to the right, pointing to the previously undone state, and restores the address book to that state.
Note: If the currentStatePointer
is at index addressBookStateList.size() - 1
, pointing to the latest address book state, then there are no undone AddressBook states to restore. The redo
command uses Model#canRedoAddressBook()
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 5. The user then decides to execute the command list
. Commands that do not modify the address book, such as list
, will usually not call Model#commitAddressBook()
, Model#undoAddressBook()
or Model#redoAddressBook()
. Thus, the addressBookStateList
remains unchanged.
Step 6. The user executes clear
, which calls Model#commitAddressBook()
. Since the currentStatePointer
is not pointing at the end of the addressBookStateList
, all address book states after the currentStatePointer
will be purged. Reason: It no longer makes sense to redo the add n/David …
command. This is the behavior that most modern desktop applications follow.
The following activity diagram summarizes what happens when a user executes a new command:
Aspect: How undo & redo executes:
Alternative 1 (current choice): Saves the entire address book.
Alternative 2: Individual command knows how to undo/redo by itself.
delete
, just save the contact being deleted).Target user profile:
Wedding planners who:
Value proposition: Wedding planners frequently manage a large number of contacts which can become overwhelming. PlanPerfect simplifies this process through 2 main core functionalities:
With its fast and efficient Command Line Interface (CLI), PlanPerfect enables users to manage their contacts significantly faster than traditional mouse/GUI-driven apps, providing greater flexibility and speed for busy wedding planners.
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * | User | Add new contacts | Expand my wedding planner network |
* * * | User | Delete contacts | Get rid of unneeded contacts |
* * * | User | Tag contacts | Organise my contacts |
* * * | User | Untag contacts | Organise my contacts |
* * * | User | View a list of all contacts | Retrieve the contact information |
* * | User | Edit contacts | Update my contacts' information upon changes |
* * | User | Filter contacts by tag | Find specific profiles of interest quickly |
* * | User | Archive contacts | Prevent clutter in my contacts without a full deletion |
* * | First-time user | See help messages | Learn how to use the app |
* * | User | See a confirmation message before I clear all data | Avoid accidentally losing all of my data |
* | User | View which wedding service providers a client is paired with | Easily find contacts associated with a wedding |
* | User | Add notes for a specific contact | Add my own details |
* | User | Sort contacts alphabetically | Organize and access contacts easily |
* | Forgetful user | Set reminders to talk to contacts | Remember to communicate with contacts |
* | User | Import contacts from an existing CSV/text file | Add new contacts quickly |
* | Busy user | Schedule calls with contacts | Remember when to call people |
* | Organised user | Create folders | Organise my contacts into categories |
* | Efficient user | Make mass operations | Add/delete/archive numerous contacts in one go |
* | User | Create wedding events with associated contacts | Park relevant contacts for that wedding in one place |
* | User | Create todo lists for each wedding | Manage tasks efficiently |
* | User | Send my contacts to other users | Allow my colleagues to contact the same people |
* | User | Add descriptions to contacts | See more clarifying details about the contact |
* | User | Search contacts by name or tag | Quickly access a contact |
* | Curious user | See statistics | See how many contacts are added |
* | User | Export all my data as a spreadsheet/CSV | Transfer it to other softwares if needed |
* | Clumsy user | Undo the latest action | So that wrong actions can be undone |
* | User | Copy the email of the contacts to clipboard | Email contacts conveniently |
Note: For all the use cases below, the System is PlanPerfect and the Actor is an arbitrary Wedding Planner.
Use case: UC01 - List all contacts
MSS
Wedding planner requests to list all contacts
PlanPerfect shows a list of all contacts (clients, vendors, venues, etc.).
Use case ends.
Use case: UC02 - Delete a contact
MSS
Wedding planner views the list of all contacts (UC01).
Wedding planner requests to delete a specific contact in the list.
PlanPerfect deletes the contact.
PlanPerfect shows a success message.
Use case ends.
Extensions
2a. The given contact index is invalid or the contact list is empty.
Use case: UC03 - Add a contact
MSS
Wedding planner requests to add a contact (e.g., a new client, vendor, or wedding service provider).
PlanPerfect adds the new specified contact.
PlanPerfect shows a success message to the wedding planner.
Use case ends.
Extensions
1a. The input format for adding the contact is invalid.
1a1. PlanPerfect shows an error message requesting for the correct input format.
Use case ends.
1b. PlanPerfect detects a duplicate contact entry (by phone number) in the addressbook.
1b1. PlanPerfect displays an error message showing the duplicated contact.
Use case ends.
Use case: UC04 - Edit a contact
MSS
Extensions
1a. The input format for adding the contact is invalid.
1a1. PlanPerfect shows an error message requesting for the correct input format.
Use case ends.
1b. Wedding planner requests to edit a contact's phone number to one that is held by another contact.
1b1. PlanPerfect shows an error message that the input phone number already exists in PlanPerfect.
Use case ends.
Use case: UC05 - Tag a contact
MSS
Wedding planner views the list of all contacts (UC01).
Wedding planner requests to attach a tag (e.g., vendor type, client status) to a specific contact.
PlanPerfect adds a tag to the contact.
PlanPerfect shows a success message to the wedding planner.
Use case ends.
Extensions
3a. Contact does not exist in PlanPerfect
3a1. PlanPerfect shows an error message
Use case ends.
Use case: UC06 - Untag a contact
MSS
Wedding planner views the list of all contacts (UC01).
Wedding planner requests to remove a tag from a specific contact.
PlanPerfect removes the tag from the specified contact.
PlanPerfect shows a success message.
Use case ends.
Extensions
1a. Contact does not exist in PlanPerfect
1a1. PlanPerfect shows an error message
Use case ends.
1b. User wants to remove all tags from contact
1b1. User enters all in the untag command
1b2. PlanPerfect removes all tags from the specified contact.
Use case ends.
Use case: UC07 - List contacts by tag
MSS
Wedding planner requests to view a list of contacts that have specific tag(s) (e.g., photographers, caterers, clients in progress).
PlanPerfect shows a list of contacts who have the specified tag(s).
Use case ends.
Extensions
1a. The list of contacts with the specified tag is empty.
Use case ends.
Use case: UC08 - Find contact by name
MSS
Wedding planner requests to retrieve a contact's details by name.
PlanPerfect shows the specified contact's details.
Use case ends.
Extensions
1a. Contact does not exist in PlanPerfect.
1a1. PlanPerfect shows a message that the contact could not be found.
Use case ends.
Use case: UC09 - Getting help
MSS
Wedding planner asks for help.
PlanPerfect shows a list of valid commands with examples.
Use case ends.
Use case: UC10 - Sort contacts alphabetically
MSS
Wedding planner requests to sort contacts alphabetically.
PlanPerfect sorts and displays the contacts in alphabetical order.
Use case ends.
Use case: UC11 - Filter contacts by tag
MSS
Wedding planner requests to view contacts tagged with one or more tag.
PlanPerfect shows the list of contacts tagged with the tags input by the user.
Use case ends.
Extensions
1a. The input format is invalid.
1a1. PlanPerfect shows an error message.
Use case ends.
Use case: UC12 - Clear all wedding and contact data
MSS
Use case ends.
Extensions
1a1. PlanPerfect retains all data.
1a2. PlanPerfect shows a message indicating that the wedding and contact data has not been cleared.
Use case ends.
Use case: UC13 - View contacts of a specified wedding
MSS
Wedding planner requests to view contacts stored in a specified wedding.
PlanPerfect shows the list of all contacts involved in a specified wedding.
Use case ends.
Extensions
1a. The given wedding index is invalid.
1a1. PlanPerfect shows an error message requesting for a valid wedding index.
Use case ends.
Use case: UC14 - Add a wedding
MSS
Wedding planner requests to add a new wedding.
PlanPerfect adds the wedding with the specified details to PlanPerfect.
Use case ends.
Extensions
1a1. PlanPerfect shows an error message detailing why the details provided are invalid.
Use case ends.
Use case: UC15 - Delete a wedding
MSS
User requests to delete a wedding with specified details.
PlanPerfect deletes the wedding.
Use case ends.
Extensions
1a1. PlanPerfect shows an error message.
Use case ends.
Use case: UC16 - Edit a wedding
MSS
User requests to edit the name and/or date of the wedding.
PlanPerfect edits the wedding as specified.
Use case ends.
Extensions
1a. The input format for editing the wedding is invalid.
1a1. PlanPerfect shows an error message.
Use case ends.
1b. PlanPerfect detects a duplicate wedding entry (by wedding name) in the addressbook.
1b1. PlanPerfect displays an error message showing the duplicated wedding details.
Use case ends.
Use case: UC17 - Assign a contact to a wedding
MSS
Wedding planner requests to assign a specific contact to a particular wedding.
PlanPerfect assigns the contact to the wedding, adding the contact to the wedding contacts list.
Use case ends.
Extensions
1a. The specified wedding index is invalid.
1a1. PlanPerfect shows an error message.
Use case ends.
1b. The specified contact index is invalid according to the current contacts list in the address book.
1b1. PlanPerfect shows an error message.
Use case ends.
1c. The specified contact has already been assigned to the wedding.
1c1. PlanPerfect shows an error message.
Use case ends.
Use case: UC18 - Unassign a contact from a wedding
MSS
Wedding planner is already viewing a wedding and requests to unassign a contact from that wedding.
PlanPerfect unassigns the contact from the wedding, removing the contact from the wedding contacts list.
Use case ends.
Extensions
1a1. PlanPerfect shows an error message.
Use case ends.
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.
Adding a contact
list
command. You can add contacts while in a wedding view, but upon the contact being added, you will be redirected to the all contacts view.add n/John Doe p/91234567 e/johnd@example.com a/123 John St.
Deleting a contact
delete 1
delete 0
delete
, delete x
(where x is larger than the list size)Editing a contact
edit 2 n/Jane Smith p/98765432
Tagging a contact
tag 2 t/florist designer
Untagging a contact
untag 2 t/photographer videographer
Adding a wedding
list
command. You can add a wedding while in a wedding view, but if you intend assigning contacts as you add a wedding, you will only be able to assign contacts from the current wedding view into the wedding being added, which may not be optimal.addw n/Emily and John Wedding d/25/12/2024 c/1 2
Deleting a wedding
deletew 1
Editing a wedding's details
editw 1 n/Emmy and Johnny d/29/12/2024
Viewing wedding details
view 1
Assigning and unassigning contacts to/from a wedding
assign 1 c/3
unassign c/3
edit
, delete abc
, add n/
(missing parameters).To summarise, PlanPerfect extends the AB3 framework considerably by not only enhancing and adding new
contact-management features (like tag
, untag
, filter
) but also a list of weddings as a new entity type with its
own attributes and a new set of wedding commands. It has also considerably
altered some of the AB3's pre-existing contact management features, especially regarding the nature of tag
management and changed the UI to increase its complexity and better reflect an integrated wedding and contacts view.
Difficulty level:
Challenges faced:
assign
/filter
) operate on the current view or main view for newly added
commands dependent on whether they were in the main/filtered/wedding view, which created more complexity for the team.Achievements of the project:
Team size: 5
Improve duplicate detection handling for Wedding Names: Currently, Wedding names are case-sensitive, which could result in unintended duplicates ("smith and john" & "Smith and John" are treated as distinct entries). We plan to introduce case-insensitive comparison to catch potential duplicates even if capitalization differs.
More accurate error messages for extreme numerical inputs: The current error message for contact indexes provided which are larger than the MAX_INT or less than or equal to 0 is "Invalid command format!" which is too general. We plan to improve error handling to provide an "Invalid index" error message instead.
Improve parsing for address fields with text resembling flags (eg. a/
or t/
): We plan to update the address
parsing logic to differentiate between actual command flags and address text that may resemble these flags to
allow users to store addresses like 1 Street e/b Building
or Frenk t/t road
without triggering errors that
multiple values have been specified for single-valued fields.
Add support for names with non-alphanumeric characters (eg. -, @, .): Currently, names are forbidden to contain special characters and will show an error stating that names should only contain alphanumeric characters. Special characters like hyphens (-), at symbols (@), and periods (.), are common in some names, thus we plan to make an update to allow the addition of names with special characters. This update will ensure that names with such characters can be added without errors.
Make the current view name (located in the blue box on top of the weddings list panel) more specific: Currently,
the view name is either set to the wedding name (e.g., "John and Mary Wedding") or "Not viewing any wedding." This
could be made more specific when the user applies filters or search commands. For example, if the user filters a
wedding by tags, the view name could display "John and Mary Wedding – Filter: Florist." Similarly, when
using the Find command, it could show "Search Results for: john" instead of "Not viewing any wedding" when the user
enters find john
.