New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added commands for reminders in UG and amended DG for MoneyGoWhere #95
added commands for reminders in UG and amended DG for MoneyGoWhere #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also upload the new png files for the diagrams
docs/DeveloperGuide.adoc
Outdated
* does not depend on any of the other three components. | ||
|
||
[NOTE] | ||
As a more OOP model, we can store a `Tag` list in `Address Book`, which `Person` can reference. This would allow `Address Book` to only require one `Tag` object per unique `Tag`, instead of each `Person` needing their own `Tag` object. An example of how such a model may look like is given below. + | ||
As a more OOP model, we can store a `Tag` list in `Moneygowhere`, which `Spending` can reference. This would allow `Spending Book` to only require one `Tag` object per unique `Tag`, instead of each `Spending` needing their own `Tag` object. An example of how such a model may look like is given below. + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spending Book
docs/DeveloperGuide.adoc
Outdated
@@ -157,56 +157,56 @@ This section describes some noteworthy details on how certain features are imple | |||
=== [Proposed] Undo/Redo feature | |||
==== Proposed Implementation | |||
|
|||
The undo/redo mechanism is facilitated by `VersionedAddressBook`. | |||
It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. | |||
The undo/redo mechanism is facilitated by `VersionedMoneygowhere`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VersionedSpendingBook
docs/DeveloperGuide.adoc
Outdated
The undo/redo mechanism is facilitated by `VersionedAddressBook`. | ||
It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. | ||
The undo/redo mechanism is facilitated by `VersionedMoneygowhere`. | ||
It extends `Moneygowhere` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpendingBook
spendingBookStateList
docs/DeveloperGuide.adoc
Outdated
* `Versionedmoneygowhere#commit()` -- Saves the current address book state in its history. | ||
* `Versionedmoneygowhere#undo()` -- Restores the previous address book state from its history. | ||
* `Versionedmoneygowhere#redo()` -- Restores a previously undone address book state from its history. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VersionedSpendingBook
replace address book to spending book
docs/DeveloperGuide.adoc
Outdated
|
||
These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. | ||
These operations are exposed in the `Model` interface as `Model#commitmoneygowhere()`, `Model#undomoneygowhere()` and `Model#redomoneygowhere()` respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commitSpendingBook
undoSpendingBook
redoSpendingBook
docs/DeveloperGuide.adoc
Outdated
|
||
The following sequence diagram shows how the undo operation works: | ||
|
||
image::UndoSequenceDiagram.png[] | ||
|
||
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 `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. | ||
The `redo` command does the opposite -- it calls `Model#redomoneygowhere()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
docs/DeveloperGuide.adoc
Outdated
|
||
[NOTE] | ||
If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone address book 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. | ||
If the `currentStatePointer` is at index `moneygowhereStateList.size() - 1`, pointing to the latest address book state, then there are no undone address book states to restore. The `redo` command uses `Model#canRedomoneygowhere()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
docs/DeveloperGuide.adoc
Outdated
|
||
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 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#commitMoneygowhere()`, `Model#undoMoneygowhere()` or `Model#redoMoneygowhere()`. Thus, the `MoneygowhereStateList` remains unchanged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
docs/DeveloperGuide.adoc
Outdated
|
||
image::UndoRedoState4.png[] | ||
|
||
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. We designed it this way because it no longer makes sense to redo the `add n/David ...` command. This is the behavior that most modern desktop applications follow. | ||
Step 6. The user executes `clear`, which calls `Model#commitMoneygowhere()`. Since the `currentStatePointer` is not pointing at the end of the `MoneygowhereStateList`, all address book states after the `currentStatePointer` will be purged. We designed it this way because it no longer makes sense to redo the `add n/David ...` command. This is the behavior that most modern desktop applications follow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
docs/DeveloperGuide.adoc
Outdated
** Cons: We must ensure that the implementation of each individual command are correct. | ||
|
||
===== Aspect: Data structure to support the undo/redo commands | ||
|
||
* **Alternative 1 (current choice):** Use a list to store the history of address book states. | ||
** Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project. | ||
** Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both `HistoryManager` and `VersionedAddressBook`. | ||
** Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both `HistoryManager` and `VersionedMoneygowhere`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
[-> LogicManager : execute("reminder d/today m/Pay bill") | ||
activate LogicManager | ||
|
||
LogicManager -> MoneyGoWhereParser : parseCommand("reminder d/today m/Pay bill") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpendingBookParser
docs/DeveloperGuide.adoc
Outdated
[NOTE] | ||
The above sequence diagram demonstrates how a new reminder is constructed from valid user input. | ||
|
||
Following is the activity diagram including the series of actions performed by MoneyGOWhere when it receives `DeleteReminderCommand` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MoneyGoWhere typo
…the configuration
No description provided.