-
Notifications
You must be signed in to change notification settings - Fork 89
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-T17-2] CafeCTRL #14
base: master
Are you sure you want to change the base?
[CS2113-T17-2] CafeCTRL #14
Conversation
Added Selecting Storage
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.
Overall, the team did a great job in their implementation.
In terms of software engineering practices, we can tell that most code quality and coding standards were abided to (e.g. naming convention, less than 80 characters per line). However, one suggestion that I would make is to remove unused / dead code or leave a comment there to tell the reader the purpose of not deleting it entirely.
In terms of Object Oriented Programming, I really enjoy seeing that there is a separation of concerns and that there are several domains created for different purposes. For instance, command is command, menu is menu and pantry is pantry. This is from personal experience but perhaps we can abstract the logic even more.
Note: This is for educational purposes. Do not attempt this unless you have ample time and find what I say make sense and no additional marks would be given
- Maybe we can read up on Domain Driven Development (DDD). We can declare the domains that is needed first (maybe in terms of interfaces) before we start working on it.
- For instance, let us consider the Chef object. Does a normal chef have a UI object with him? What if we shift into cookDish method instead and use it as a dependency rather than a member? The issue with this is it violates the Single Responsibility Principle, we try to combine the printing logic with the other logic.
- Perhaps we can consider implementing an interface called ChefInterface that has the necessary attributes that belong to a Chef and implement it, and maybe create an overarching service class (or use the command class) to make the classes interact with each other like how normal chefs would.
ui.printLine(); | ||
} | ||
} while (!command.isExit()); | ||
//this.storage.saveAll(this.menu, this.orderList, this.pantry); |
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.
Why don't we remove this dead code since it is not being used here?
} | ||
|
||
public static void main(String[] args) throws IOException { | ||
CafeCtrl cafeCtrl = new CafeCtrl(); |
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.
No change is required here, I was just curious if there is a need for this line here. Why not create a method called initCafe()
rather than creating a new instance of it?
* Adds a menu item to the user | ||
*/ | ||
public class AddDishCommand extends Command { | ||
public static final String COMMAND_WORD = "add"; |
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.
Nice to use capital for constants
public static final String COMMAND_WORD = "view_stock"; | ||
protected Ui ui; | ||
protected Pantry pantry; | ||
|
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.
Perhaps we can review all the files and ensure consistency in the spacing between each line?
//@@author DextheChik3n | ||
public static ArrayList<String> encodeMenu(Menu menu) { | ||
/* | ||
ArrayList<Dish> dishArrayList = menu.getMenuItemsList(); | ||
String tasksFilePathString = this.fileManager.openTextFile(); | ||
|
||
if (dishArrayList.isEmpty()) { | ||
this.fileManager.overwriteFile(tasksFilePathString, ""); //overwrite text file to store empty text | ||
} | ||
//todo: remove testing code | ||
dishArrayList.add(new Dish("test", (float) 1.2)); | ||
dishArrayList.add(new Dish("test", (float) 1.2)); | ||
|
||
//input arraylist data into text file | ||
for (int i = 0; i < dishArrayList.size(); i++) { | ||
String taskDataRow = "chicken rice | 5.00 | rice 50g"; | ||
|
||
if (i == 0) { | ||
this.fileManager.overwriteFile(tasksFilePathString, taskDataRow); | ||
} else { | ||
this.fileManager.appendToFile(tasksFilePathString, taskDataRow); | ||
} | ||
} | ||
*/ | ||
return null; | ||
} |
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.
Maybe we can remove this dead code since it returns null and does not do anything
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.
we are still in progress in implementing the storage to text file functionality so it was left commented out
// ArrayList<String> encodedMenu = this.fileManager.readTextFile(FilePath.MENU_FILE_PATH); | ||
// return Decoder.decodeMenuData(encodedMenu); |
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.
Maybe we can return the dead code here too
One thing to take note of: Since you are dealing with money, there is a possibility that other teams might break your product using big numbers (causing overflow), negative numbers, non-2 decimal places pricing. Extra caution had to be taken care of for this (A.K.A. consider unit testing + assertions before mock PE 1) |
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.
Maybe remove arrow 6,7
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.
arrow 22 has a typo ? maybe you wanted to specify it as showMenuBottom(varname: String)
?
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.
looks good
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.
Maybe modify arrow to show showToUser(<static var name>, ..)
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.
although its returning void, you may want to consider adding the dotted arrows here to standardize with/follow the other diagrams
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.
The diagrams look great! Although there might be too many details and are overwhelming. Remember to change the accessibilities and figure numbers.
docs/DeveloperGuide.md
Outdated
@@ -4,10 +4,154 @@ | |||
|
|||
{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 comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove the default placeholder text
docs/DeveloperGuide.md
Outdated
|
||
![Parser Class Diagram](images/class/Parser.png) |
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.
The accessibility of a variable or method should be + (public) or - (private) instead of colours by default in plantUML
### Storage | ||
API: [Storage.java]({repoURL}src/main/java/seedu/cafectrl/storage/Storage.java) | ||
|
||
![Storage Class Diagram](images/class/Storage.png) |
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.
Same issue regarding accessibility as before
|
||
### Edit Price | ||
|
||
![Edit Price Execution](images/sequence/EditPriceCommand_execute.png) |
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.
Activation bar for 6th step should start after the arrow
|
||
### Add Dish | ||
|
||
![Add Dish Execution](images/sequence/AddDishCommand_execute.png) |
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.
No figure number
docs/DeveloperGuide.md
Outdated
|
||
![List Menu Execution](images/sequence/ListMenuCommand_execute.png) | ||
|
||
Figure 1: Execution of list_menu command |
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.
Why is this figure 1?
docs/DeveloperGuide.md
Outdated
|
||
Note that `CafeCtrl` only have access to the interface `ParserUtil` although the run-time type object is `Parser`. With this, we are able to decrease coupling between `CafeCtrl` and `Parser`, allowing for easier maintenance. This also ensures the testability as we could provide mock or stub dependencies during testing, we could isolate the behavior of the class and focus on unit testing without external dependencies. | ||
|
||
![Parser Parsing User Input Sequence Diagram](images/sequence/Parser.png) |
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.
Alt should have multiple braches, if there's only one possible branch, should use opt instead
### Storage | ||
API: [Storage.java]({repoURL}src/main/java/seedu/cafectrl/storage/Storage.java) | ||
|
||
![Storage Class Diagram](images/class/Storage.png) |
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.
The storage class diagram does not follow CS2113 standard. You may want to look at the notes. For example, shouldn't have the C logo etc.
![List Menu Execution](images/class/ListMenuCommandClass.png) | ||
|
||
![List Menu Execution](images/sequence/ListMenuCommand_execute.png) | ||
|
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.
Adding the number for each step is not necessary
I really like the way you include both class diagram and sequence diagram to illustrate your components and features! |
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.
Generally looks good to me!
|
||
### Edit Price | ||
|
||
![Edit Price Execution](images/sequence/EditPriceCommand_execute.png) |
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.
It seems like the method called in 6th step doesn't follow the sequence diagram format?
|
||
### Edit Price | ||
|
||
![Edit Price Execution](images/sequence/EditPriceCommand_execute.png) |
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.
8th step arrow may need to point to the start of the activation bar
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.
Very good DG; I only added a few nitpicks
docs/DeveloperGuide.md
Outdated
- `Parser` : Makes sense of user input to return the appropriate command | ||
- `Command` : Executes the comman requested by the user. | ||
|
||
How the architecture components interact with each other |
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.
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.
Thanks for pointing out! I think your suggestion makes sense and I will edit accordingly!
docs/DeveloperGuide.md
Outdated
|
||
![Parser Class Diagram](images/class/Parser.png) | ||
|
||
*Figure 4: Parser Class Diagram* |
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.
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.
Thanks for pointing out! Will edit it
docs/DeveloperGuide.md
Outdated
- is composed of `FileManager` object as the text file needs to be located first before reading or writing. | ||
|
||
### Data Component | ||
API: [] |
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.
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.
We forgot to add hyperlink here! It is updated in the latest version
docs/DeveloperGuide.md
Outdated
### Add Dish | ||
|
||
![Add Dish Execution](images/sequence/AddDishCommand_execute.png) | ||
*Figure 8: Execution of add_dish command* |
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.
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.
oops I forgot to add a newline thanks for pointing it out 👍
docs/DeveloperGuide.md
Outdated
e.g. (1. Chicken Rice $2.50) is shown. | ||
|
||
### Add Order | ||
A add_order command can be used to add `order` to an `orderList` in `Sales`. |
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.
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.
Noted, thanks!
docs/DeveloperGuide.md
Outdated
## Product scope | ||
### Target user profile | ||
|
||
Café proprietors seeking for a software solution to optimize the management of their café's operations |
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.
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.
Will add more details here, thank you!
|
||
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command `delete 1`. | ||
|
||
![Architecture Encode Data](images/sequence/Architecture_Encode_Data.png) |
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.
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.
Hmmm I am not sure which part you are referring to, could you specific which statement is it?
|
||
API: [ListMenuCommand.java]({repoURL}src/main/java/seedu/cafectrl/command/ListMenuCommand.java) | ||
|
||
When the `execute()` method of ListMenuCommand is invoked in Main, it checks if the size of the menu by running `menu.getSize()`. |
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.
It's nice to check whether the list is empty or not before the execution.
|
||
* *glossary item* - Definition | ||
### User stories |
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.
The user stories are clear and considerate enough to make sure all kinds of user can realize their needs.
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.
Thank you!
|
||
### Edit Price | ||
|
||
![Edit Price Execution](images/sequence/EditPriceCommand_execute.png) |
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.
in 6th step should have an arrow before
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.
hmm I dont quite get what you mean, could you specify where should the arrow be at?
…es-v2.1 Task 320, Error handling for decoding of sales.txt, list_ingredients and list_sale command
# Conflicts: # src/main/java/seedu/cafectrl/ui/ErrorMessages.java # src/main/java/seedu/cafectrl/ui/Messages.java
Include patter and mathcer in PPP
list_sale command.
Pantry class in DG.
Edit UG v2.1
Update DG, UG and PPP
Update HelpCommand
Update PPP
Edit PPP to reduce page length
Add manual testing for edit price
Edit PPP to reduce page length
# Conflicts: # docs/team/ziyi105.md
Reduce PPP length
Disable assertion
CaféCTRL aims to optimize managing of inventory and cash flow in a restaurant. Our CLI platform empowers users to streamline stock inventory, menu and orders. Users will also briefly be able to gain valuable insights through comprehensive sales reporting, enabling them to analyze sales trends and calculate revenue/profit margins, eliminating the need for cross-platform management.