-
Notifications
You must be signed in to change notification settings - Fork 248
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
[CS2113-T14-2] BagPacker #61
base: master
Are you sure you want to change the base?
Changes from 96 commits
85f5942
361a83b
ae8f534
7fdeba0
cf3ed33
8382441
aa5a3ab
d612948
b0b31f6
27b8f81
4a8a4c9
885facc
c772bef
e72174d
85d3e83
adefc67
d02a5ff
de4b199
694a76f
d5be78c
8a50b5f
7974a60
dce0bbe
6477103
6e617ca
9710bb5
1cc74b5
e88c03a
7251549
316b797
57e47a8
e8ebcc4
d18bae7
d20a18f
8bbc64a
5225b4e
758b414
3f23dd3
5c1f9ba
333be3e
591b288
cbe5d81
db427d0
af362e0
d7357dc
36307bd
216139a
7d1726a
2df3681
6835838
76547af
f2b4128
ebdd848
2c539df
3c20551
6a77b72
cf95ec9
85f7761
5c8580d
a2f4f30
9590621
0695481
7176bd5
99867b4
f1ac640
4f565bb
6d154b8
cf2396b
85bb9a1
d130f5c
ff1659c
0862107
4af3061
4af5a77
f623b7d
f42e3b2
fc44af9
c509128
0d6175a
70b4993
8a0fd04
ed04cb8
d5e3e99
1ce08ba
7bb6246
e0cc133
cdb9ac3
a24dd50
cacc835
70927da
bb05a19
d0da069
96d4ce5
4f3e0f2
e099deb
e020059
9d86a8f
dac3ed3
cf948a9
5a06658
af540bf
452f4ac
a065726
9749bd3
da33a85
993cc48
1f3a1d4
856e650
a2653bb
fb6e8e4
c03c1ad
7fa6f3b
f691231
16dea0f
4a6d141
bb64508
6eed896
0ce0eb4
f480250
ddede05
4277e97
ffd9ee9
0ae5782
22505a8
b2f7780
e9649ea
d633157
0bae023
5735b92
ff6cb4d
9ba9ec6
9c57b47
ffffeff
272bb0f
4c99a75
8e2ba1e
ae4fd89
5a011c2
59ae4c2
ecc01b0
63cdb17
1b98427
31a2ff2
8b7e483
54ed6f1
060da8f
72abf8c
73423a9
8e463a0
92cf247
21d747e
e80ffa6
a32e526
f0c0b7d
f1a912d
c3ea4d4
92c8d7a
eae9edb
60535b2
3386590
4128954
398cf59
d292db8
d72f25a
882dccc
d603023
41460b6
4478813
74de3d3
622f381
a93e50f
2662c2e
46d7152
655f263
8153ed0
9255f52
d7076fa
c8d77e0
76dc857
c4ed890
1a99f54
d0f6894
3f411ed
7fcb1e2
0b5e5aa
3ac6145
6933d89
b90a9bb
58f1ec5
c6b97b7
dd921bf
db387da
c832743
6773978
be61520
a6db58d
3446496
26e8c69
a57c8fe
ef945a4
200a318
da12fa3
fd74f73
b81ffe6
5bc7267
9408258
c277df2
a42d370
0165064
f0960b9
eab0201
9043c8b
ac02f60
fc8f2b6
89f0c50
576f39b
125a8f0
419ab8d
1ca2408
9cf4006
cddeb6a
e8057c3
078b7c1
46d3685
0e29781
df11cfc
1066674
9d2ea03
bbcfe00
a1c1540
d157f87
7f5b495
c6694bb
6030645
e53f52c
0afc9ce
7a8aae6
e4f304c
b5de0bd
53c3759
c20417e
dd746c6
7258e4a
fbc4821
5e74f23
b040234
477950a
25fdb7a
d320cd9
2d20bbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:----------:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | Yinxuan (Sophie) Tang | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://i.ibb.co/FHBJtW7/myface.png) | Linus Puah | [Github](https://github.com/linuspuah) | [Portfolio](docs/team/LinusPortfolio.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,115 @@ | ||
[DeveloperGuide.md](DeveloperGuide.md) | ||
# Developer Guide | ||
|
||
## Acknowledgements | ||
|
||
{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} | ||
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. 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. |
||
|
||
## Design & implementation | ||
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. 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 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. Would be good to include Main architectural design and class diagram for each class to showcase the whole project design |
||
|
||
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. Should be better to mention the main components of the app architecture to understand the overview of components used? |
||
{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: | ||
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. It would be better if you could try standardising whether to add the full stop at the end of the sentence. |
||
1. Read input - ```runBagPacker()``` method in ```BagPacker``` calls the ```Parser``` class to read user input command | ||
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 | ||
|
||
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. Would be nice to see some class and sequence diagrams |
||
#### Add Command | ||
|
||
Add command is used to add a quantity of item(s) to the packing list. | ||
|
||
Mechanism: ```AddCommand.execute()``` calls the ```PackingList.addItem()``` method from the ```PackingList``` class which executes the ```ArrayList.add()``` method to add the item to the ```PackingList``` ArrayList. | ||
It then updates the ```quantity``` variable according to the quantity inputted by the user. | ||
|
||
|
||
#### Preventing duplicate items | ||
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.
|
||
|
||
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. | ||
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. Maybe class diagram would better clarify interactions between the classes rather than text description? |
||
|
||
Below is the UML diagram showing what occurs during `add` function. | ||
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. I think specifying the below diagram as Sequence Diagram would be a good idea 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. Maybe it is better to add the return of control in your diagram. |
||
![img_1.png](img_1.png) | ||
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 use of UML diagram to understand workflow of the command. 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. 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. 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. 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. 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.
|
||
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`. | ||
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. Would it be a good idea to give the |
||
|
||
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. | ||
|
||
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 workflow explanation of the command 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. Would it be better to place this explanation in front of the diagram? |
||
#### Delete Command | ||
|
||
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. | ||
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. Would be great to see the diagrams here! 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. Nice and concise explanation of mechanism |
||
|
||
|
||
#### Help Command | ||
Help command is used to exit the BagPacker application. | ||
|
||
Execute: ```HelpCommand.execute()``` prints the following help message. | ||
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. Would be nice to know what type of help commands are available. |
||
|
||
``` | ||
All Commands: | ||
1. add : Adds a quantity of items to the packing list. | ||
Example: add 3 toothbrushes | ||
2. delete : Deletes an item from the packing list. | ||
Example: delete 1 | ||
3. list : List all items in packing list. | ||
Example: list | ||
4. pack : Marks an item as packed in the packing list. | ||
Example: pack 2 of 3 | ||
Meaning: packs 2 quantities of the third item in the packing list | ||
5. unpack : Marks an item as unpacked in the packing list. | ||
Example: unpack 1 of 2 | ||
Meaning: unpacks 1 quantity of the second item in the packing list | ||
6. bye : Stops the BagPacker Application | ||
Example: bye | ||
____________________________________________________________ | ||
|
||
``` | ||
|
||
#### Bye Command | ||
```ByeCommand``` is used to exit the BagPacker application. | ||
|
||
Mechanism: ```ByeCommand.execute()``` updates the static boolean ```isBagPackerRunning``` to be false. | ||
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. In which class is the |
||
The ```runBagPacker()``` method will continually parse and execute relevant commands (refer to Command Mechanisms in DG) until | ||
```isBagPackerRunning == false``` which occurs upon the execution of the ```byeCommand```. | ||
|
||
#### DeleteList Command | ||
```DeleteListCommand``` is used to delete a whole packing list in the BagPacker application. | ||
|
||
Mechanism: ```DeleteListCommand.execute()``` reassigns the existing ```packingList``` to a new empty ArrayList of Items, thus deleting the ```packingList```. | ||
|
||
|
||
|
||
## Product scope | ||
|
||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
BagPacker is for NUS students, in particular, exchange students who travel a lot and want a simple CLI to keep track of their packing. | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
BagPacker aims to help busy students simplify their packing process by allowing easy adding of items to pack and record of the items they have already packed so that they can be organised and aboard their travels with ease. | ||
|
||
|
||
## User Stories | ||
|
||
|Version| As a ... | I want to ... | So that I can ...| | ||
|--------|----------|---------------|------------------| | ||
|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 ... | | ||
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 job with specifying the user stories by version! Gives a good understanding of the actual program and the progress made |
||
|---------|----------|------------------------------------------------|------------------------------------------------------------------------------| | ||
| v1 | user | Add an item to my packing list | update my packing list | | ||
| v1 | user | Remove an item from my packing list | update my packing list | | ||
| v1 | user | view a list of my packed and unpacked items | keep track of my packing list | | ||
| v1 | user | mark an item as packed | keep track of what is packed | | ||
| v1 | user | mark an item as unpacked | keep track of what is unpacked | | ||
| v1 | new user | see usage instructions | refer to them when I forget how to use the application | | ||
| 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 | | ||
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. very well-managed by specifying the version to be implemented and prioritizing the key features. |
||
|
||
## Non-Functional Requirements | ||
|
||
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. should be better to add in instructions for manual testing to get an overview of all commands? |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md (rejected hunks) | ||
@@ -83,7 +83,16 @@ | ||
|
||
Mechanism: ```DeleteListCommand.execute()``` reassigns the existing ```packingList``` to a new empty ArrayList of Items, thus deleting the ```packingList```. | ||
|
||
+#### Pack Command | ||
+```PackCommand``` is used to mark an item in the list as packed. | ||
|
||
+Mechanism: ```PackCommand.execute()``` calls the ```PackingList.packItem()``` method from the ```PackingList``` class. | ||
+This will execute the ```setPacked()``` method to set the value of the boolean ```isPacked``` to be ```true```, and mark the item as packed in the ```PackingList``` ArrayList. | ||
+ | ||
+#### Unpack Command | ||
+```Unpack Command``` is used to mark an item in the list as unpacked. | ||
+Mechanism: ```UnpackCommand.execute()``` calls the ```PackingList.unpackItem()``` method from the ```PackingList``` class. | ||
+This will execute the ```setPacked``` method to set the value of the boolean ```isPacked``` to be ```false```, and mark the item as unpacked in the ```PackingList``` ArrayList. | ||
|
||
## Product scope | ||
|
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. Nice decision to include the reference frame! 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. The 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. Does |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[LinusPortfolio.md](LinusPortfolio.md) # portfolio | ||
|
||
# Linus Puah Jia He - Project Portfolio Page | ||
|
||
## Overview | ||
|
||
### Summary of Contributions | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# John Doe - Project Portfolio Page | ||
|
||
## Overview | ||
|
||
|
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.
Would be good to include table of contents in the top of the DG