The UI mockup was generated with ChatGPT using the following input.
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, GamerListPanel, 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 Gamer 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 BlockBookParser 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 gamer).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:
BlockBookParser 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 BlockBookParser 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,
Gamer objects (which are contained in a UniqueGamerList object).
Gamer objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Gamer> 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.UserPrefs object that represents the user's preferences. This is exposed to the outside as a ReadOnlyUserPrefs object.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 BlockBook, which Gamer references. This allows BlockBook to only require one Tag object per unique tag, instead of each Gamer needing their own Tag objects.

API : Storage.java
The Storage component,
BlockBookStorage and UserPrefsStorage, 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.blockbook.commons package.
This section describes some noteworthy details on how certain features are implemented.
The proposed undo/redo mechanism will be facilitated by VersionedBlockBook. It will extend BlockBook with an undo/redo history, stored internally as an blockBookStateList and currentStatePointer. Additionally, it should implement the following operations:
VersionedBlockBook#commit() - Saves the current BlockBook state in its history.VersionedBlockBook#undo() - Restores the previous BlockBook state from its history.VersionedBlockBook#redo() - Restores a previously undone BlockBook state from its history.These operations should be exposed in the Model interface as Model#commitBlockBook(), Model#undoBlockBook() and Model#redoBlockBook() 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 VersionedBlockBook will be initialized with the initial BlockBook state, and the currentStatePointer pointing to that single BlockBook state.
Step 2. The user executes delete 5 command to delete the 5th gamer in BlockBook. The delete command calls Model#commitBlockBook(), causing the modified state of BlockBook after the delete 5 command executes to be saved in the blockBookStateList, and the currentStatePointer is shifted to the newly inserted BlockBook state.
Step 3. The user executes add name/David … to add a new gamer. The add command also calls Model#commitBlockBook(), causing another modified BlockBook state to be saved into the blockBookStateList.
Note: If a command fails its execution, it will not call Model#commitBlockBook(), so the BlockBook state will not be saved into the blockBookStateList.
Step 4. The user now decides that adding the gamer was a mistake, and decides to undo that action by executing the undo command. The undo command will call Model#undoBlockBook(), which will shift the currentStatePointer once to the left, pointing it to the previous BlockBook state, and restores BlockBook to that state.
Note: If the currentStatePointer is at index 0, pointing to the initial BlockBook state, then there are no previous BlockBook states to restore. The undo command uses Model#canUndoBlockBook() 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#redoBlockBook(), which shifts the currentStatePointer once to the right, pointing to the previously undone state, and restores BlockBook to that state.
Note: If the currentStatePointer is at index blockBookStateList.size() - 1, pointing to the latest BlockBook state, then there are no undone BlockBook states to restore. The redo command uses Model#canRedoBlockBook() 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 BlockBook, such as list, will usually not call Model#commitBlockBook(), Model#undoBlockBook() or Model#redoBlockBook(). Thus, the blockBookStateList remains unchanged.
Step 6. The user executes clear, which calls Model#commitBlockBook(). Since the currentStatePointer is not pointing at the end of the blockBookStateList, all BlockBook states after the currentStatePointer will be purged. Reason: It no longer makes sense to redo the add 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 BlockBook.
Alternative 2: Individual command knows how to undo/redo by itself.
delete, just save the gamer being deleted).{more aspects and alternatives to be added}
{Explain here how the data archiving feature will be implemented}
Target user profile:
Value proposition: BlockBook makes it easy for Minecraft gamers to connect with other players by saving contacts of players they meet on servers. With a familiar command line interface, adding, organising and finding is a breeze.
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a ... | I want to ... | So that I can... |
|---|---|---|---|
* * * | general user | add a new contact | link multiple contact methods to a gamer |
* * * | general user | delete a gamer | remove contact entries that I no longer need |
* * * | general user | list out my contacts | see my contacts that I saved previously |
* * * | general user | view a contact’s profile with their full details | access comprehensive details when needed |
* * | general user | find a gamer by name | locate details of gamers without having to go through the entire list |
* * | new user | see usage instructions | figure out how to use the app easily |
* * | general user | update contact details | keep track of my contacts' latest information |
* * | general user | avoid adding duplicate contacts | not store the same contact twice by accident |
* * | general user | sort the contacts alphabetically | access my contacts easier |
* * | general user | sort the contacts by added date | find my contacts I recently added |
* * | minecraft gamer / pro typer | delete contacts in bulk | delete more contacts at one go |
* * | general user | see clear error messages when I enter invalid commands | correct my mistakes quickly |
* * | general user | add contacts to a favourites list | access my favourite contacts easier |
* * | general user | list out my favourite contacts | find my favourite contacts |
* * | general user | add a personal note to a contact's profile | preserve context information about a contact |
* * | general user | create a social group | create groups with contacts with a context |
* * | general user | add contact to social group | find the contacts I want to play with based on context |
* | general user | use autocomplete when typing in CLI | type faster and easier when I forget the command |
* | general user | add profile picture to contact | recognise contacts more easily via visual |
* | minecraft gamer | see quality sprite styles that align with minecraft | have a good interface experience |
(For all use cases below, the System is the BlockBook (BB) and the Actor is the user, unless specified otherwise)
As these represent the expected behaviour of the final iteration, some use cases might not reflect the current functionality of the app.
UC01 - Add Contact
MSS
Use case ends.
Extensions
3a. BB detects that the gamertag field is empty or contains invalid characters.
3a1. BB displays an error and requests correct data.
3a2. User enters new data.
Steps 3a1-3a2 are repeated until the data entered is correct.
Use case resumes from step 4.
3b. BB detects that a contact with the same gamertag already exists.
*a. At any time, User chooses to cancel adding the contact.
UC02 - List All Contacts
MSS
Use case ends.
Extensions
2a. The contact list is empty.
UC03 - Favourite a Contact
MSS
Use case ends.
Extensions
3a. BB cannot find a contact matching the entered gamertag.
4a. The contact is already marked as a favourite.
UC04 - Add Profile Picture to Contact
MSS
Use case ends.
Extensions
3a. BB detects that the gamertag is empty or contains invalid characters.
5a. BB detects that the provided image is invalid or cannot be accessed.
*a. At any time, User chooses to cancel.
UC05 - Add Note to Contact
MSS
Use case ends.
Extensions
3a. BB cannot find a contact matching the entered gamertag.
5a. User enters a note that exceeds the maximum character limit.
*a. At any time, User chooses to cancel.
UC06 - Sort Contacts by Added Date
MSS
Use case ends.
Extensions
2a. BB finds no contacts.
UC07 - Update Contact
MSS
Use case ends.
Extensions
3a. BB cannot find a contact matching the entered gamertag.
5a. BB cannot identify the attribute to edit.
7a. BB detects that the new gamertag is already in use by another contact.
7b. BB detects that the entered value contains invalid characters.
*a. At any time, User chooses to cancel.
17 or above installed.add, delete) should cause the GUI to update without noticeable delay (less than 1 second).{More to be added}
l can be an alias for list, and d can be an alias for delete.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 gamer while all gamers are being shown
Prerequisites: List all gamers using the list command. Multiple gamers in the list.
Test case: delete 1
Expected: First contact is deleted from the list. Gamertag of the deleted contact shown in the status message. Timestamp in the status bar is updated.
Test case: delete 0
Expected: No gamer is deleted. Error details shown in the status message. Status bar remains the same.
Test case: delete 1 2
Expected: The first two contacts are deleted from the list. Gamertags of the deleted contacts shown in the status message. Timestamp in the status bar is updated.
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 ... }