Skip to content

[CS2113-T14-2] BagPacker#61

Open
shannentan wants to merge 378 commits into
nus-cs2113-AY2223S2:masterfrom
AY2223S2-CS2113-T14-2:master
Open

[CS2113-T14-2] BagPacker#61
shannentan wants to merge 378 commits into
nus-cs2113-AY2223S2:masterfrom
AY2223S2-CS2113-T14-2:master

Conversation

@shannentan

Copy link
Copy Markdown

BagPacker is an app to help travelers manage their packing lists.

vishnuvk47 pushed a commit to vishnuvk47/tp that referenced this pull request Mar 24, 2023

@varnika1402 varnika1402 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall good explanation of some commands with UML diagram. It would be better to include more detail in the DG.

Comment thread docs/DeveloperGuide.md
When `contains()` returns `true`, method `addItem(item)` will be interrupted and a `DuplicateItemException` will be thrown from `packingList`, which will be caught by `a`. If `contains()` returns false, the item will be added onto `packingList`.

In both scenarios, `ui.printToUser` will be called to print a message to the user. In the former case, `ExistItemError` will be printed, while `AddSuccess` will be shown if the item was added with no issues.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good workflow explanation of the command

Comment thread docs/DeveloperGuide.md
| v2b | user | Save my packing list | keep track of my packing list even after leaving the app |

## Non-Functional Requirements

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should be better to add in instructions for manual testing to get an overview of all commands?

Comment thread docs/DeveloperGuide.md
original source as well}

## Design & implementation

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should be better to mention the main components of the app architecture to understand the overview of components used?

Comment thread docs/DeveloperGuide.md Outdated
This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good use of UML diagram to understand workflow of the command.

@DavidVin357 DavidVin357 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The existing sequence diagrams are good enough, but the DG definitely lacks class diagrams.

Otherwise, the description gives enough information to understand the product and its implementation, though more diagrams would decrease mental effort needed.

Comment thread docs/DeveloperGuide.md Outdated

When using the `add` function, we have decided to implement a passive function that checks whether the item with the same name already exists in the packingList.

This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe class diagram would better clarify interactions between the classes rather than text description?

Comment thread docs/img_1.png Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice decision to include the reference frame!

Comment thread docs/img_1.png Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The getDescription calls get pretty confusing here - maybe try to create another activation bar for detaching them to clarify the functionality?

Comment thread docs/DeveloperGuide.md

Delete command is used to delete an item from the packing list.

Mechanism: ```DeleteCommand.execute()``` calls the ```PackingList.deleteItem()``` method from the ```PackingList``` class which executes the ```ArrayList.remove()``` method to remove the item from the ```PackingList``` ArrayList.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would be great to see the diagrams here!

Comment thread docs/img_1.png Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does Exception thrown back statement mean actual throw or just showing the error to the user? Would be nice to have it more clearly stated or visualized!

Comment thread docs/DeveloperGuide.md
|--------|----------|---------------|------------------|
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application|
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list|
| Version | As a ... | I want to ... | So that I can ... |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job with specifying the user stories by version! Gives a good understanding of the actual program and the progress made

Comment thread docs/DeveloperGuide.md Outdated
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the
original source as well}

## Design & implementation

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One more idea would be to create a detailed class diagram of the Exception classes - this would greatly help developers with what to use when handling new exceptions for new functionality

Comment thread docs/DeveloperGuide.md Outdated
This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Screenshot 2023-03-30 at 9 10 14 AM

Should contains(item) be referenced as an sd block rather than as the condition in the alt block?

Comment thread docs/DeveloperGuide.md Outdated
This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Screenshot 2023-03-30 at 9 10 14 AM

Should there be an additional activation bar when packingList calls its add method?

Comment thread docs/DeveloperGuide.md Outdated
This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Screenshot 2023-03-30 at 9 10 14 AM

Should the calls to ui be pointed at its lifeline rather than the entity, and be aligned to its activation bar? And, shouldn't the alt block contain the two possibilities of calls to the UI entity?

Comment thread docs/DeveloperGuide.md Outdated

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)
When `execute()` is called in `a`(object of class `AddCommand`), the `addItem(item)` method is called in the object `packingList`. This method will see if method `contains()` will return `true`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it be a good idea to give the AddCommand instance a more descriptive name?

Comment thread docs/DeveloperGuide.md Outdated
Comment on lines +36 to +41
The `contains()` method, which is shown as a reference on the right of the UML diagram, is a boolean method that loops through all items in the packingList, and returns `true` if any of the existing items have the same description as the item to be added in `toAdd`, and `false` otherwise.

When `contains()` returns `true`, method `addItem(item)` will be interrupted and a `DuplicateItemException` will be thrown from `packingList`, which will be caught by `a`. If `contains()` returns false, the item will be added onto `packingList`.

In both scenarios, `ui.printToUser` will be called to print a message to the user. In the former case, `ExistItemError` will be printed, while `AddSuccess` will be shown if the item was added with no issues.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it be better to place this explanation in front of the diagram?

Comment thread docs/DeveloperGuide.md Outdated
#### Bye Command
```ByeCommand``` is used to exit the BagPacker application.

Mechanism: ```ByeCommand.execute()``` updates the static boolean ```isBagPackerRunning``` to be false.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In which class is the isBagPackerRunning static variable stored? Would it be a good idea to specify?

Comment thread docs/DeveloperGuide.md

Delete command is used to delete an item from the packing list.

Mechanism: ```DeleteCommand.execute()``` calls the ```PackingList.deleteItem()``` method from the ```PackingList``` class which executes the ```ArrayList.remove()``` method to remove the item from the ```PackingList``` ArrayList.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice and concise explanation of mechanism

Comment thread docs/DeveloperGuide.md
2. Create command object - The ```Parser``` class creates a corresponding command object of the relevant command
3. Execute command object - ```runBagPacker()``` method executes the ```.execute()``` method (overridden by child classes) of the command object
which runs the actual command function

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would be nice to see some class and sequence diagrams

Comment thread docs/DeveloperGuide.md Outdated
| v2a | user | find an item by name | find the pack status of an item without having to go through the entire list |
| v2a | user | remove my packing list | clear my list once I am done packing |
| v2a | user | Specify the quantity of an item I need to pack | keep track of individual item quantities being packed |
| v2b | user | Save my packing list | keep track of my packing list even after leaving the app |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

very well-managed by specifying the version to be implemented and prioritizing the key features.

Comment thread docs/DeveloperGuide.md
#### Help Command
Help command is used to exit the BagPacker application.

Execute: ```HelpCommand.execute()``` prints the following help message.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would be nice to know what type of help commands are available.

@Gan868611 Gan868611 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should add detailed diagram to all the features

Comment thread docs/DeveloperGuide.md Outdated
@@ -1,29 +1,115 @@
[DeveloperGuide.md](DeveloperGuide.md)
# Developer Guide

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would be good to include table of contents in the top of the DG

Comment thread docs/DeveloperGuide.md Outdated
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the
original source as well}

## Design & implementation

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would be good to include Main architectural design and class diagram for each class to showcase the whole project design

Comment thread docs/DeveloperGuide.md Outdated
It then updates the ```quantity``` variable according to the quantity inputted by the user.


#### Preventing duplicate items

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preventing duplicate items and add command now are on the same layer which makes it ambiguous. Since preventing duplicate items is under add command then it should be one layer down

Comment thread docs/DeveloperGuide.md Outdated

This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think specifying the below diagram as Sequence Diagram would be a good idea

Comment thread docs/DeveloperGuide.md Outdated
This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

image

  1. Exception handling in Sequence Diagram is ambiguous.
  2. Missing self invocation activation bar for .add(item)
  3. Suggest to check out the correct method to showcase static method.(It should point to activation bar)
  4. Incorrect use of Reference frame, should check out module website( should have ref and sd frame)
  5. Return of true and false should be dashed line.
  6. As it is already in loop frame, there is no need to do self-invocate the whole activation bar.

@xiaoge26 xiaoge26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added my reviews! Good effort!

Comment thread docs/DeveloperGuide.md Outdated
This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.
![img_1.png](img_1.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

image
Maybe there should be two Ui entities instead of one, as the two possible calls does not call the same Ui object.

Comment thread docs/DeveloperGuide.md Outdated

{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the
original source as well}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It may be better to give a brief overview of how your application works ] at the beginning of the docs, including the main commands and components, before diving into each component individually.

Comment thread docs/DeveloperGuide.md Outdated

This is done through the `contains()` method in class `PackingList()`, which is called during `execute` in an `AddCommand` object.

Below is the UML diagram showing what occurs during `add` function.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe it is better to add the return of control in your diagram.

Comment thread docs/DeveloperGuide.md

{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.}
### Command Mechanisms:
For all valid commands, the mechanism of implementation are as follows:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It would be better if you could try standardising whether to add the full stop at the end of the sentence.

tangphi and others added 23 commits April 1, 2023 15:23
Edit code formatting and wording
Resolve GitHub issues #90, #93, #95, #99, #120, #123
Save and load feature added
fix - improve load() function in Storage class to read quantities of above 9
linuspuah and others added 30 commits April 10, 2023 22:33
Fix bug - characters get cut off in pdf
Add line break
Fix DG broken link and more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants