forked from nus-cs2103-AY1920S1/addressbook-level3
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
Update developer guide with add feature #87
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
5e1abfd
Remove all instances of address
6e73dd6
Add new command: Remark
3f671ae
Merge branch 'tutorial-adding-command'
ea7590c
Update UserGuide.adoc
wpuffs c907562
Update UserGuide.adoc
wpuffs 43aa00b
Update Ui.png
1011cb1
Update UserGuide.adoc
wpuffs 09529ff
Update Ui.png
00d6e20
Revert "Update Ui.png"
425a715
Revert "Update UserGuide.adoc"
284567d
Revert "Update Ui.png"
c1ba200
Revert "Update UserGuide.adoc"
57fc252
Revert "Update UserGuide.adoc"
e5c943f
Revert "Merge branch 'tutorial-adding-command'"
6841673
Revert "Remove all instances of address"
ce3e8d9
Update UserGuide.adoc
414c095
Update UserGuide.adoc
wpuffs fecff89
Merge upstream
wpuffs c58b97f
Add activity and sequence diagram for Add command
wpuffs be333c5
Merge branch 'master' of https://github.com/AY1920S1-CS2103T-W11-3/ma…
wpuffs ce3d9d1
Change sequence diagram
wpuffs cbaee3d
Change activity diagram
wpuffs 5e9ed8c
Resize activity diagram
wpuffs 3a6739a
Update DeveloperGuide.adoc
wpuffs 529fbc3
Merge branch 'master' into branch-dg
wpuffs b920f52
Update DeveloperGuide.adoc
wpuffs a8fcf40
Update DeveloperGuide.adoc
wpuffs 8b78aab
Update DeveloperGuide.adoc
wpuffs f8fa438
Update DeveloperGuide.adoc
wpuffs 774738b
Update DeveloperGuide.adoc
wpuffs 7736d29
Update DeveloperGuide.adoc
wpuffs 760add4
Update DeveloperGuide.adoc
wpuffs File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
= AddressBook Level 3 - Developer Guide | ||
= EatMe Developer Guide | ||
:site-section: DeveloperGuide | ||
:toc: | ||
:toc-title: | ||
|
@@ -12,9 +12,9 @@ ifdef::env-github[] | |
:note-caption: :information_source: | ||
:warning-caption: :warning: | ||
endif::[] | ||
:repoURL: https://github.com/AY1920S1-CS2103T-W11-3/main/tree/master | ||
:repoURL: https://github.com/AY1920S1-CS2103T-W11-3/main | ||
|
||
By: `Team SE-EDU` Since: `Jun 2016` Licence: `MIT` | ||
By: `AY1920S1-CS2103T-W11-3` Since: `Sep 2019` Licence: `MIT` | ||
|
||
== Setting up | ||
|
||
|
@@ -79,7 +79,7 @@ image::UiClassDiagram.png[] | |
|
||
*API* : link:{repoURL}/src/main/java/seedu/address/ui/Ui.java[`Ui.java`] | ||
|
||
The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `EateryListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class. | ||
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. | ||
|
||
The `UI` component uses 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 link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow`] is specified in link:{repoURL}/src/main/resources/view/MainWindow.fxml[`MainWindow.fxml`] | ||
|
||
|
@@ -123,11 +123,11 @@ The `Model`, | |
|
||
* stores a `UserPref` object that represents the user's preferences. | ||
* stores the Address Book data. | ||
* exposes an unmodifiable `ObservableList<Eatery>` 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. | ||
* exposes 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. | ||
* 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 `Eatery` can reference. This would allow `Address Book` to only require one `Tag` object per unique `Tag`, instead of each `Eatery` 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 `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. + | ||
+ | ||
image:BetterModelClassDiagram.png[] | ||
|
||
|
@@ -162,6 +162,10 @@ This method of replacing an Eatery with a modified Eatery (isOpen field set to f | |
|
||
Given below is an example usage scenario and how the close mechanism behaves at each step. | ||
|
||
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 `AddressBook` will be initialized with the initial Json data stored. | ||
|
||
Step 2. The user executes `close `1 command to close the 1st Eatery in the address book. | ||
|
@@ -209,6 +213,33 @@ image::CloseCommitActivityDiagram.png[] | |
** Cons: Requires proper handling of individual data structures to ensure each list is maintained and updated correctly. | ||
// end::close[] | ||
|
||
// tag::add[] | ||
=== Add eatery feature | ||
==== Implementation | ||
|
||
The add mechanism is facilitated by `AddressBook`. It implements the following operations: | ||
|
||
* `AddressBook#hasEatery(Eatery e)` -- Checks if an Eatery with the same identity as Eatery e exists in the address book. | ||
* `AddressBook#addEatery(Eatery e)` -- Adds an Eatery to the address book. The eatery must not already exist in the address book. | ||
|
||
These operations are exposed in the `Model` interface as `Model#hasEatery()` and `Model#addEatery()` respectively. | ||
|
||
Given below is an example usage scenario and how the add eatery mechanism behaves at each step. | ||
|
||
Step 1. The user launches the application for the first time. The `AddressBook` will be initialized with the default eateries. | ||
|
||
Step 2. The user executes `add \n Two Chefs Eating Place \a 116 Commonwealth Cres, #01-129 \c Chinese` to add a new eatery. The `add` command also calls `Model#addEatery(Eatery e)`. | ||
|
||
[NOTE] | ||
If the command is missing a `Name`, `Address`, or `Category` parameter, the execution of the add command will fail and the application will throw a `ParseException`. | ||
|
||
The following sequence diagram shows how the add operation works: | ||
image:add-sd.PNG[] | ||
|
||
The following activity diagram summarizes what happens when a user executes a new command: | ||
image::add-ad.PNG[] | ||
Comment on lines
+237
to
+240
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good that you have diagrams for future developers to refer back to! |
||
// end ::add[] | ||
|
||
// tag::dataencryption[] | ||
=== [Proposed] Data Encryption | ||
|
||
|
@@ -278,27 +309,11 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un | |
|
||
|`* * *` |person with many food allergies |keep track of dishes I have ordered before |avoid ordering hazardous food | ||
|
||
<<<<<<< HEAD | ||
|`* * *` |foodie |remember places |share this experience with my family and friends | ||
|
||
|`* *` |digital nomad |tag places with free power + wifi |sit there for extended periods of time | ||
|
||
|`*` |working adult |view the menu beforehand |save time from thinking what to eat | ||
======= | ||
<<<<<<< HEAD | ||
|`* * *` |user |find a person by name |locate details of eateries without having to go through the entire list | ||
======= | ||
|`* * *` |foodie |remember places |share this experience with my family and friends | ||
>>>>>>> upstream/master | ||
|
||
|`* *` |digital nomad |tag places with free power + wifi |sit there for extended periods of time | ||
|
||
<<<<<<< HEAD | ||
|`*` |user with many eateries in the address book |sort eateries by name |locate a person easily | ||
======= | ||
|`*` |working adult |view the menu beforehand |save time from thinking what to eat | ||
>>>>>>> upstream/master | ||
>>>>>>> upstream/master | ||
|======================================================================= | ||
|
||
_{More to be added}_ | ||
|
@@ -313,25 +328,12 @@ _{More to be added}_ | |
|
||
*MSS* | ||
|
||
<<<<<<< HEAD | ||
======= | ||
<<<<<<< HEAD | ||
1. User requests to list eateries | ||
2. AddressBook shows a list of eateries | ||
3. User requests to delete a specific person in the list | ||
4. AddressBook deletes the person | ||
======= | ||
>>>>>>> upstream/master | ||
1. User requests to view his todo list | ||
2. EatMe toggles to the todo mode | ||
3. User requests to mark an eatery as visited in the list | ||
4. EatMe shifts the data over | ||
5. EatMe toggles to the main mode | ||
6. EatMe requests user for whatever information left that is required before saving in the main mode | ||
<<<<<<< HEAD | ||
======= | ||
>>>>>>> upstream/master | ||
>>>>>>> upstream/master | ||
+ | ||
Use case ends. | ||
|
||
|
@@ -472,14 +474,14 @@ _{ more test cases ... }_ | |
|
||
=== Deleting a person | ||
|
||
. Deleting a person while all eateries are listed | ||
. Deleting a person while all persons are listed | ||
|
||
.. Prerequisites: List all eateries using the `list` command. Multiple eateries in the list. | ||
.. Test case: `delete 1` + | ||
.. 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` + | ||
.. 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) _{give more}_ + | ||
.. Other incorrect delete commands to try: delete, delete x (where x is larger than the list size) _{give more}_ + | ||
Expected: Similar to previous. | ||
|
||
_{ more test cases ... }_ | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is this still needed