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

[CS2113T-T13-1] Shoco #15

Open
wants to merge 916 commits into
base: master
Choose a base branch
from

Conversation

JLoh579
Copy link

@JLoh579 JLoh579 commented Mar 3, 2020

damithc pushed a commit to damithc/tp-draft that referenced this pull request Mar 14, 2020
Fix stock commands to be directly executed.
Copy link

@yantingsanity yantingsanity left a comment

Choose a reason for hiding this comment

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

Hello! I think that your team's DG looks quite good, just that there are some minor fixes here and there! 👍 Perhaps, you guys can check if you are using Duke class or Shoco class as there are some confusions in some of the diagrams and maybe can think of more design considerations too? Overall, good work! 😄

The following sequence diagram below shows how the add feature works. The details of the adding item's values
are shown in a separate sequence diagram below:

![alt text](images/AddFeature.png)

Choose a reason for hiding this comment

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

Is the activation bar for the Duke supposed to be longer? as I assumed that the Duke instance will still be there while AddCommand is executing its commands. 😆

image

Choose a reason for hiding this comment

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

The sequence diagram is clear on how it works. I also think that the activation bar should be longer. Other than that, It looks great


![alt text](images/AddFeature.png)

![alt text](images/AddFeature_SD.png)

Choose a reason for hiding this comment

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

As per the image below,

  1. Should the method name be the same as the ref frame which stated "Add item values"?
  2. Should the alt frame be more near the left corner? 😆
  3. I think that this "X" in this frame may be a little redundant as it was the "X" can be found in your above diagram for the AddCommand instance.

image

1. <code>Duke</code> class receives user input from the <code>Ui</code> class.
2. A <code>Parser</code> object is created to call its <code>parseCommand</code> method.
* The <code>Parser</code> object instantiates an <code>EditCommand</code> object based on the user input.
3. The <code>Duke</code> class calls the <code>execute</code> method of the <code>EditCommand</code> object.

Choose a reason for hiding this comment

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

Perhaps for the execute method, you can call it as EditCommand#execute()?

2. A <code>Parser</code> object is created to call its <code>parseCommand</code> method.
* The <code>Parser</code> object instantiates an <code>EditCommand</code> object based on the user input.
3. The <code>Duke</code> class calls the <code>execute</code> method of the <code>EditCommand</code> object.
4. In the <code>execute</code> function, the <code>item</code> to be edited (based on the specified index of the

Choose a reason for hiding this comment

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

Perhaps, you can state what function you are calling to get the specified index as seen in your diagram for more user readability?

Choose a reason for hiding this comment

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

thanks for that suggestion, I will include it in!


- Alternative 1 (current choice): User must provided a description for item, Duplicates are
not allowed in the list.
- Pros: User has minimal potential to see unreasonable list in the Shopping List. For

Choose a reason for hiding this comment

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

Could this section be more simplified and maybe more explanation? It was a little confusing 😆
Maybe, can explain more about what is unreasonable list and minimal potential so that users can understand.
Perhaps could use words like "lesser probability of viewing incorrectly formatted list?"


##### Aspect: Data structure to support the edit feature

- Alternative 1 (current choice): Only parameters present in user input are treated as values to update.

Choose a reason for hiding this comment

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

Good design considerations! 👍

<code>Command</code> class with a String representing the keyword specified by the user.

The <code>Shoco</code> class first receives user input from the <code>Ui</code> class before it creates a
<code>Parser</code> object and calls its <code>parseCommand</code> function to instantiate a

Choose a reason for hiding this comment

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

Perhaps, you can use Parser#parseCommand() and for the other methods in your description?

The following sequence diagram below shows how the clear list feature works. Note the <code>Ui</code> class is
omitted to emphasise the other classes:

![alt text](images/Clear.png)

Choose a reason for hiding this comment

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

Is this supposed to be Duke class or Shoco class? haha

image

The following sequence diagram below shows how the reset budget feature works. Note the <code>Ui</code> class is
omitted in the sequence diagram to emphasise on the other classes:

![alt text](images/Reset_Budget.png)

Choose a reason for hiding this comment

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

Can refer to the comment in Clear List feature!

@lowxizhi
Copy link

3.1.1 Current implementation, Process of object creation:

The reference frame names "add item values" vs "update item values" are not consistent.

Screenshot 2020-03-31 at 12 18 03 PM

Screenshot 2020-03-31 at 12 17 59 PM

@lowxizhi
Copy link

3.1.1 Current implementation, Process of object creation:

Duke class is not mentioned previously in DG. Is it supposed to be Shoco class?

Screenshot 2020-03-31 at 12 17 59 PM

@lowxizhi
Copy link

3.1.1 Current implementation, Process of object creation:

Activation bar for constructors in Parser and AddCommand are not attached to the head.

Screenshot 2020-03-31 at 12 17 59 PM

Copy link

@synCKun synCKun left a comment

Choose a reason for hiding this comment

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

DG review, good job overall!


##### Aspect: Data structure to support the add feature

- Alternative 1 (current choice): User must provided a description for item, Duplicates are
Copy link

Choose a reason for hiding this comment

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

Maybe this section could be clearer on why alternative 1 was chosen over alternative 2.

The following sequence diagram below shows how the edit feature works. The details of updating the items' values
have been omitted from the diagram. Those details are shown in a separate sequence diagram below:

![alt text](images/EditFeature.png)
Copy link

Choose a reason for hiding this comment

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

1
I was wondering if the activation bar of duke can just be replaced by a life line, since the activation bar ends before those of the called functions, which may be confusing.

![alt text](images/EditFeature_SD.jpg)


#### 3.2.2 Design considerations
Copy link

Choose a reason for hiding this comment

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

Good considerations, could be clearer if a short line were to be given to explain why the current choice is chosen over the other alternative.

3. The <code>Duke</code> class calls the <code>execute</code> method of the <code>AddCommand</code> object.
4. In the <code>execute</code> function, the <code>item</code> to be add is called from the <code>ShoppingList</code>
object, using items.add().
5. In the SD, the AddCommand will add <code>item</code> if the description is provided and one / both price and
Copy link

Choose a reason for hiding this comment

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

What does SD stand for? :o

@lowxizhi
Copy link

lowxizhi commented Mar 31, 2020

3.1.1 Current implementation, Process of object creation, Point 4:

From this statement "the item to be add is called from the ShoppingList object, using items.add()", I infer that items.add() calls the item to be added from the ShoppingList object. This seems problematic as:

  1. The meaning of "add" does not corresponds with the description "to call the item to be added". Consider changing the name of the method to fit its purpose better, or rephrase the purpose of items.add() in the description.
  2. In the sequence diagram, the arrow labelled item.add(add) was pointing from the AddCommand class to the ShoppingList class, which does not correspond to the statement of "the item to be added is called from the ShoppingList object". Consider rephrasing the purpose of items.add() in the description.
  3. In the sequence diagram, the method item.add(add) is called. However, there is no indication or explanation for the variable "add" that was passed into the method item.add().
  4. On the overall, from the description and sequence diagram, I find it confusing as to where the item was added, and where the item to be added came from.

Screenshot 2020-03-31 at 12 17 59 PM

@lowxizhi
Copy link

3.1.1 Current implementation, Process of object creation:

In the sequence diagram, the object name "items"/"Items" is not consistent in "Items.add(add)" method and "items:ShoppingList".

Screenshot 2020-03-31 at 12 17 59 PM

@lowxizhi
Copy link

3.1.1 Current implementation, Process of object creation:

In the sequence diagram, the alt tab is not attached to the top left corner of the box.
Screenshot 2020-03-31 at 12 18 03 PM

@lowxizhi
Copy link

In the design considerations of each implemented feature, there is good explanation of the pros and cons of the alternatives considered. It would be good if the reason for ultimately choosing 1 alternative over the other is stated.

@lowxizhi
Copy link

UML diagrams are generally neat and consistent throughout the DG. One mistake spotted throughout is that the activation bar for constructors are not attached to the head.

Copy link

@nguan1 nguan1 left a comment

Choose a reason for hiding this comment

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

Overall, a clear and concise developer guide that is well formatted with clear diagrams.

For the design considerations section for your commands, it may be prudent to make a single statement as to why you chose to create a separate command class for each command, instead of repeating similar reasoning for each command.

Also, the activation bar should attached to the class, when you call a constructor, in your sequence diagrams.
image
For example, you guys have the bars detached from the class when Parser() is called. However, the module requires you to do something like this:
image

Otherwise your group's developer guide is a quality piece of work.
Keep up the great work!

Copy link

@rsanchez-macias rsanchez-macias left a comment

Choose a reason for hiding this comment

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

Great DG! I really liked your sequence diagrams and the features you added. The pros and cons were nice to have an idea on how you approached the project. 👍

<code>Command</code> class. The user input **must contain at least a description** out of these parameters:
*description*, *price*, *quantity*. User can choose not to input price or quantity as the price will set to
default which is 0.0 if the user did not input any value for price. On the other hand, quantity will set to
default which is 1 if the user did not input any value for quantity.

Choose a reason for hiding this comment

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

The description for the add feature is great, maybe adding a sample input and output would help see how the feature works?

The following sequence diagram below shows how the add feature works. The details of the adding item's values
are shown in a separate sequence diagram below:

![alt text](images/AddFeature.png)

Choose a reason for hiding this comment

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

The sequence diagram is clear on how it works. I also think that the activation bar should be longer. Other than that, It looks great


![alt text](images/AddFeature_SD.png)

#### 2.1.2 Design considerations

Choose a reason for hiding this comment

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

Just a minor thing, should this section be 3.1.2?


Diagram 2:

![alt text](images/Unmark.png)

Choose a reason for hiding this comment

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

image

Should the activation bar UnmarkCommand be longer than ShoppingList? I am thinking that control returns to UnmarkCommand after an item is unmarked in ShoppingList


- Cons: Might significantly increase the code base with another class being added

- Alternative 2: Implement the mark and unmark feature in either the <code>Duke</code> or <code>Parser</code> class

Choose a reason for hiding this comment

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

Maybe rename Duke to Shoco to match the name of the app?

Choose a reason for hiding this comment

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

Other than that, great explanations 👍

The following sequence diagram below shows how the <code>Shoco</code> object creates the <code>FindCommand</code> object. Note the <code>Ui</code> class is
omitted in the sequence diagram to emphasise on the other classes:

![alt text](images/Find.png)

Choose a reason for hiding this comment

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

image

The sequence diagrams are great, and I have an idea of how the app works now. However, I noticed that most sequence diagrams contain how Duke and Parser work together, and the only things that change are the circled parts (FindCommand, AddCommand, DisplayCommand). Maybe you could add a separate section on how Duke and Parser work together, and then omit it from the other sequence diagrams?

Choose a reason for hiding this comment

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

Then, the diagrams would be more focused on the feature itself

having to edit the mark and unmark feature difficult.

&nbsp;
<b><a href="#developer-guide">&#129053; back to top</a></b>

Choose a reason for hiding this comment

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

I really like that you added links to go back to the top :) very useful 👍

The reset budget feature is implemented using a <code>ResetBudgetCommand</code> class which extends the main
<code>Command</code> class with a variable representing the budget amount.

The <code>Duke</code> class first receives user input from the <code>Ui</code> class before it creates a

Choose a reason for hiding this comment

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

For section 3 in general (implementation), the explanations for each feature are good. I noticed that for the add feature, the implementation is explained in a list, but it is just paragraphs for some other features. I think that maybe doing all of the explanations like the add feature would be great, and then it would help with consistency.

image

image

Choose a reason for hiding this comment

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

Oh sorry, there are two screenshots, one for AddCommand and another for DisplayCommand. White background makes it look like there is only one 😅

### Purpose of this guide
This guide describes the software architecture and design of the SHOCO application.
It will evolve throughout the design and implementation of each SHOCO release.
Currently, this document is for the first public release of the application, SHOCO v1.0.

Choose a reason for hiding this comment

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

Small thing, but should this be SHOCO v2.0? I saw that the Appendix contains info about v2.0

Copy link

@RenzoTsai RenzoTsai left a comment

Choose a reason for hiding this comment

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

Very good DG. it is concise and clear!

class, <code>WriteData</code> class, <code>FileUtil</code> class and
<code>CommandLineTable</code> class.

![alt text](images/ClassDiag.png)

Choose a reason for hiding this comment

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

Maybe here lacks of the some Associations. e.g : In your Parser, there is a private newCommand, so there should be one link between Parser and Command.
image

Comment on lines 49 to 70

<!-- @@author kokjoon97 -->
The <code>Shoco</code> class manages all required resources in the execution of the application. These include
a <code>ShoppingList</code> object to keep track of the <code>Item</code> objects the user has added to his list and
a <code>Budget</code> object to store the user's budget.

<code>Shoco</code> also has a <code>Storage</code> object for saving and loading data from memory - this data includes
the latest saved <code>ShoppingList</code> and <code>Budget</code>.

There is a dependency from <code>Shoco</code> to <code>Parser</code> as it only creates an instance of the <code>Parser</code>
every time user input is received by the <code>Ui</code> and does not keep track of the <code>Parser</code> which is deleted
after it is done parsing the current user input. The <code>Parser</code> determines what command is being invoked by the
user before creating a new <code>Command</code> object. It then returns the reference to the new <code>Command</code> object
to <code>Shoco</code>.

At any point in time, <code>Shoco</code> only stores up to one <code>Command</code> and no more. This
<code>Command</code> has to be executed before <code>Shoco</code> can receive more user input.
<!-- @@author -->
&nbsp;

<b><a href="#developer-guide">&#129053; back to top</a></b>
&nbsp;

Choose a reason for hiding this comment

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

Very clear overview. Looks good!

The following sequence diagram below shows how the add feature works. The details of the adding item's values
are shown in a separate sequence diagram below:

![alt text](images/AddFeature.png)

Choose a reason for hiding this comment

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

Is it supposed to add an object creation mark here?
image


This next sequence diagram will show how the <code>FindCommand</code> creates the <code>filteredItems</code> list:

![alt text](images/FindItem.png)

Choose a reason for hiding this comment

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

Is it supposed to add activation bars in this picture?
image

@@ -0,0 +1,70 @@
//@@author kokjoon97

Choose a reason for hiding this comment

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

The sequence diagram used here is using minimal notation, but other diagrams have activiation bars so probably it is better to keep everything the same style.

@@ -0,0 +1,682 @@
package seedu.duke.utils;

Choose a reason for hiding this comment

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

I think normal it is more like normal association so maybe change the dashed line in the UML?

@@ -0,0 +1,27 @@
package seedu.duke.commands;

Choose a reason for hiding this comment

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

It should be better to let Shoco class has 1 Command class everytime as 0..1 is a bit weird.

Copy link

@JeremyTakigawa JeremyTakigawa left a comment

Choose a reason for hiding this comment

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

Overall it is a very well-written DG.

JLoh579 and others added 30 commits April 11, 2020 13:38
Resize of images, edit pr issue number
Fix issue with diagrams not appearing
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.