Skip to content
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 32 commits into from Oct 23, 2019
Merged
Show file tree
Hide file tree
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
Sep 25, 2019
6e73dd6
Add new command: Remark
Sep 25, 2019
3f671ae
Merge branch 'tutorial-adding-command'
Sep 25, 2019
ea7590c
Update UserGuide.adoc
wpuffs Sep 29, 2019
c907562
Update UserGuide.adoc
wpuffs Sep 29, 2019
43aa00b
Update Ui.png
Sep 29, 2019
1011cb1
Update UserGuide.adoc
wpuffs Sep 29, 2019
09529ff
Update Ui.png
Sep 30, 2019
00d6e20
Revert "Update Ui.png"
Sep 30, 2019
425a715
Revert "Update UserGuide.adoc"
Sep 30, 2019
284567d
Revert "Update Ui.png"
Sep 30, 2019
c1ba200
Revert "Update UserGuide.adoc"
Sep 30, 2019
57fc252
Revert "Update UserGuide.adoc"
Sep 30, 2019
e5c943f
Revert "Merge branch 'tutorial-adding-command'"
Sep 30, 2019
6841673
Revert "Remove all instances of address"
Sep 30, 2019
ce3e8d9
Update UserGuide.adoc
Sep 30, 2019
414c095
Update UserGuide.adoc
wpuffs Sep 30, 2019
fecff89
Merge upstream
wpuffs Oct 15, 2019
c58b97f
Add activity and sequence diagram for Add command
wpuffs Oct 22, 2019
be333c5
Merge branch 'master' of https://github.com/AY1920S1-CS2103T-W11-3/ma…
wpuffs Oct 22, 2019
ce3d9d1
Change sequence diagram
wpuffs Oct 22, 2019
cbaee3d
Change activity diagram
wpuffs Oct 22, 2019
5e9ed8c
Resize activity diagram
wpuffs Oct 22, 2019
3a6739a
Update DeveloperGuide.adoc
wpuffs Oct 22, 2019
529fbc3
Merge branch 'master' into branch-dg
wpuffs Oct 22, 2019
b920f52
Update DeveloperGuide.adoc
wpuffs Oct 22, 2019
a8fcf40
Update DeveloperGuide.adoc
wpuffs Oct 22, 2019
8b78aab
Update DeveloperGuide.adoc
wpuffs Oct 22, 2019
f8fa438
Update DeveloperGuide.adoc
wpuffs Oct 22, 2019
774738b
Update DeveloperGuide.adoc
wpuffs Oct 22, 2019
7736d29
Update DeveloperGuide.adoc
wpuffs Oct 23, 2019
760add4
Update DeveloperGuide.adoc
wpuffs Oct 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 42 additions & 40 deletions docs/DeveloperGuide.adoc
@@ -1,4 +1,4 @@
= AddressBook Level 3 - Developer Guide
= EatMe Developer Guide
:site-section: DeveloperGuide
:toc:
:toc-title:
Expand All @@ -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

Expand Down Expand 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`]

Expand Down Expand Up @@ -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[]

Expand Down Expand Up @@ -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.

Comment on lines +165 to +168
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this still needed

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.
Expand Down Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The 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

Expand Down Expand Up @@ -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}_
Expand All @@ -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.

Expand Down Expand Up @@ -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 ... }_
Expand Down
Binary file added docs/images/add-ad.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/add-sd.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.