[CS2113-T11-1] HotelLite Manager#32
Conversation
danbaterisna
left a comment
There was a problem hiding this comment.
Good explanation of the design, but can be made clearer in some parts.
|
|
||
| The objective of the `AddHousekeeperCommand` is to take in user input and spilt it into two parts which is the name and age of a Housekeeper. These details make up parts of the Housekeeper profile. With the name and age derived, this information will be added into a new Housekeeper object, which will be recorded into the list of housekeeper. The class diagram below depicts how the `AddHousekeeperCommand` interacts with other classes. | ||
|
|
||
|  |
There was a problem hiding this comment.
I think this diagram is too complicated for what it claims to do, since it shows lots of internal details when its goal is to show how AddHousekeeperCommand interacts with other classes. Consider focusing on important associations and only leaving in important attributes? (The same can be said for the AddItemCommand's class diagram.)
| - `AddItemCommand#getItem` - Extracts the item saved within the AddItemCommand object. | ||
| - `AddItemCommand#execute` - Adds the item into the list of items. | ||
|
|
||
|  |
There was a problem hiding this comment.
This sequence diagram is quite large. To help with reading, consider breaking it up into parts for each individual step?
|
|
||
| ### check room information by level | ||
|
|
||
| The checking room information by level mechanism is facilitated `CheckRoomByLevelCommand`. It extends command. Additionally, it implements the following operations: |
There was a problem hiding this comment.
I think command should be monospaced, as in Command?
| Step 1: When the user enters the command `Add Item Toilet Roll / 15`, the `Duke` class would pass the user input to the `Command Parser` Class. | ||
|
|
||
| Step 2: The `Command Parser` Class would run the `parse` method and create an `AddItemCommand` object containing an `Item` object which is made up of the name of the item to add as well as its pax which are found within the user input. | ||
|
|
||
| Step 3: The `AddItemCommand` class would be passed back to the `Duke` class. | ||
|
|
||
| Step 4: The `execute` method of the `AddItemCommand` class would be run and the `ItemList` Object would be extracted from the `List Container` object and the `AddItemCommand` object would pass its Item object to the `ItemList` Object's `addItemToList` method. | ||
|
|
||
| Step 5: The `addItemToList` method would then call the `checkForItemDuplicates` method to check if there are any items within the item list with the same name as the item we are about to add. | ||
|
|
||
| Step 6:I f there are is an item with a matching name found, we would then call the `UI` object and execute the `UI`'s `printItemAlreadyInTheListErrorMessage` method which would print a message informing the user that the item the user wants to add is already found within the item list and hence nothing would be added. Step 7 and 8 are skipped. | ||
|
|
||
| Step 7: If there are no items with a matching name found, we would add the `Item` object to its ArrayList of `Item` objects called listOfItems. The `AddItemCommand` then call the `UI` and execute the `UI`'s `printAddItemAcknowledgementMessage` method which would print an acknowledgement message to the user informing him that the item has been added into the item list. | ||
|
|
||
| Step 8: The `ItemListFileManager` object would be called and we would pass the item list to its `writeItemListToFile` method to write the updated item list into the file ListFolder/ItemList.txt. | ||
|
|
There was a problem hiding this comment.
I don't quite understand what this enumeration is listing out. If this is the execution of an AddItemCommand, consider adding a few sentences explaining so. Would it also be better to add a sequence diagram to accompany this explanation?
| __Step 1.__ The user launches the application. In the `Duke` class, an empty instance of the `AssignmentMap` class, | ||
| called `assignmentMap`, is created. | ||
|
|
||
|  |
warrencxw
left a comment
There was a problem hiding this comment.
Generally, the segment under Design & Implementation looks well established. However, formatting between all the diagrams is inconsistent (different diagrams seem to be made with different softwares) and as such may result in difficulty in reading for the reader.
|
|
||
|  | ||
|
|
||
| __Interaction__ To understand the interaction between objects of these classes in order to actually add an entry into the hash map inside an `AssignmentMap`, refer to the sequence diagram below. |
There was a problem hiding this comment.
Consider leaving a newline after the header "Interaction" to allow this segment to help it be clearer. Otherwise it may sound as if "Interaction" belongs to the sentence which does not appear to be the case.
|
|
||
| __Interaction__ To understand the interaction between objects of these classes in order to actually add an entry into the hash map inside an `AssignmentMap`, refer to the sequence diagram below. | ||
|
|
||
|  |
There was a problem hiding this comment.
A few issues with the sequence diagram:
- Return arrows should simply contain the object it returns,
returncan be omitted. - If nothing is returned, it can simply be a blank dotted arrow pointing back to the caller.
- Syntax of content for return arrows should be as follows: variableName: ClassName
Consider making the following changes for better clarity:
- Calling arrow for
AssignmentMap#addAssignmentrequires a closing bracket in the text - Return arrow for
RoomList#getRoomListcan simply be labelledrooms: ArrayList<Room> - Return arrow for
HousekeeperList#getHousekeeperListcan simply be labelledhs: ArrayList<Housekeeper> - Return arrow for
AssignmentMap#houseKeeperExistsshould befound: booleanfor typeboolean. Additionally, the set of arrows forAssignmentMap#houseKeeperExistsshould be enlarged as it is very hard to read at this size. - Return arrows from
:AssignmentMapto;AssignHousekeeperCommandand onwards can simply be blank.
| Step 1. The user launches the application. In the `Duke` class, an empty instance of the `SatisfactionList` class, | ||
| called `satisfactionList`, is created. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| Step 2. The user types the command `add satisfaction Bob 5`. In the `Duke` class, a `Command` object |
There was a problem hiding this comment.
Should Step# be bolded as per above for consistency?
| entity that created those instances, but those are not indicated in the diagram. Furthermore, for neatness, the | ||
| `User` entity should be the left-most entity, but that could not be formatted properly in the diagram. | ||
|
|
||
|  |
There was a problem hiding this comment.
Consider changing the arrow from Duke to CommandParser to be a solid arrow rather than a dotted arrow as you are making a method call rather than returning from a method call.
Additionally, consider adding a : to all class/object entities in the sequence diagram, e.g. :CommandParser to follow the correct formatting.
| to verify if name has been recorded. If name is not in records, `HousekeeperList#addHousekeeper()` would be called to | ||
| add the housekeeper, `susan` and `33` into the housekeeperList. | ||
|
|
||
|  |
There was a problem hiding this comment.
Consider aligning all arrows (e.g. arrowhead for methods should point to the tip of the activation bar) and offsetting each separate arrow to indicate order of occurrence (e.g. parse() occurs before AddHousekeeperCommand() and thus the arrow for AddHousekeeperCommand() should be offset slightly below the arrow of parse().
|
|
||
| Step 5: The `addItemToList` method would then call the `checkForItemDuplicates` method to check if there are any items within the item list with the same name as the item we are about to add. | ||
|
|
||
| Step 6:I f there are is an item with a matching name found, we would then call the `UI` object and execute the `UI`'s `printItemAlreadyInTheListErrorMessage` method which would print a message informing the user that the item the user wants to add is already found within the item list and hence nothing would be added. Step 7 and 8 are skipped. |
There was a problem hiding this comment.
Should it be Step 6: If ...?
Consider fixing the formatting issue in this line to help with readability.
YaxinJoy
left a comment
There was a problem hiding this comment.
Overall Structure is clear! Just exists some little problems I think.
| 1. Command given from the user: `add housekeeper susan / 33`. This command meant to add a new housekeeper called susan who is 33 years old. | ||
| 2. The parse method from `CommandParser` will run parse to create `AddHousekeeperCommand` and would be return to Duke. | ||
| 3. The execute method in `AddHousekeeperCommand` will be performed. It first checks with the housekeeperList if the name of the housekeeper to be added has been recorded into the list. If it has not been recorded, housekeeperList would then add this new user into the records. Ui will be called to print a confirmation to show that the housekeeper has been entered into the list. | ||
| 5. If housekeeper exist, the housekeeper profile would not be added into the list. |
There was a problem hiding this comment.
Consider the same format of showing steps of the usage of a command.
|  | ||
|
|
||
| __Step 3.__ The `CommandParser` class replaces the `Assign Susan ## 301` in the user input with an empty string, | ||
| leaving just `Susan ## 301`. Then, an instance of `AssignHousekeeperCommand` is created which extends the class `Command`. |
There was a problem hiding this comment.
For the diagram of step2, consider changing the relationship between Duke and CommandParser from dependence to the association. I think it should be association if you are using the object of another class?
| The objective of the AddItemCommand is to allow the user to add a new item to the list of items found within the inventory. It takes in the user input and spilt it up into two parts which are the name of the item to be added and its pax. These two information would then be used to create an Item Object and the Item Object would be saved into a list of items. | ||
|
|
||
| Below is the partial class diagram detailing the design of the Add Item Command Class as well as its interactions with the various other classes required to execute the Add Item Command. | ||
|  |
There was a problem hiding this comment.
For the diagram of Add Item Command, I think one method named public UI in UI might need to delete public as it's already shown as + in the class diagram.
| ## Product scope | ||
| ### Target user profile |
There was a problem hiding this comment.
Consider adding more info under Product Scope
|
|
||
| Step 5: The `excute` method will then call `printRoom(int level, RoomList roomList)` method to print room information at target level. | ||
|
|
||
|  |
There was a problem hiding this comment.
Consider adding the activation bar in each class. Besides, some variable does not show its usage after assigning value to them (e.g., isValidLevel). Consider adding opt block for this variable.
allyfern72
left a comment
There was a problem hiding this comment.
Many details were offered in the DG with a somewhat clear overall format. There were only minor infringements that the team could consider addressing.
|
|
||
| The objective of the `AddHousekeeperCommand` is to take in user input and spilt it into two parts which is the name and age of a Housekeeper. These details make up parts of the Housekeeper profile. With the name and age derived, this information will be added into a new Housekeeper object, which will be recorded into the list of housekeeper. The class diagram below depicts how the `AddHousekeeperCommand` interacts with other classes. | ||
|
|
||
|  |
There was a problem hiding this comment.
Good idea on representing the AddHousekeeperCommand using UML. Would it be clearer to focus more on the AddHousekeeperCommand aspect in the class diagram by removing other details (e.g. methods like printHousekeeperNoted())?
| 1. Command given from the user: `add housekeeper susan / 33`. This command meant to add a new housekeeper called susan who is 33 years old. | ||
| 2. The parse method from `CommandParser` will run parse to create `AddHousekeeperCommand` and would be return to Duke. | ||
| 3. The execute method in `AddHousekeeperCommand` will be performed. It first checks with the housekeeperList if the name of the housekeeper to be added has been recorded into the list. If it has not been recorded, housekeeperList would then add this new user into the records. Ui will be called to print a confirmation to show that the housekeeper has been entered into the list. | ||
| 5. If housekeeper exist, the housekeeper profile would not be added into the list. |
There was a problem hiding this comment.
Is the font formatting correct? Would denoting all the classes that appeared in the class diagram as code be more effective in relating this example to the class diagram?
| Step 1: When the user enters the command `Add Item Toilet Roll / 15`, the `Duke` class would pass the user input to the `Command Parser` Class. | ||
|
|
||
| Step 2: The `Command Parser` Class would run the `parse` method and create an `AddItemCommand` object containing an `Item` object which is made up of the name of the item to add as well as its pax which are found within the user input. | ||
|
|
||
| Step 3: The `AddItemCommand` class would be passed back to the `Duke` class. | ||
|
|
||
| Step 4: The `execute` method of the `AddItemCommand` class would be run and the `ItemList` Object would be extracted from the `List Container` object and the `AddItemCommand` object would pass its Item object to the `ItemList` Object's `addItemToList` method. | ||
|
|
||
| Step 5: The `addItemToList` method would then call the `checkForItemDuplicates` method to check if there are any items within the item list with the same name as the item we are about to add. | ||
|
|
||
| Step 6:I f there are is an item with a matching name found, we would then call the `UI` object and execute the `UI`'s `printItemAlreadyInTheListErrorMessage` method which would print a message informing the user that the item the user wants to add is already found within the item list and hence nothing would be added. Step 7 and 8 are skipped. | ||
|
|
||
| Step 7: If there are no items with a matching name found, we would add the `Item` object to its ArrayList of `Item` objects called listOfItems. The `AddItemCommand` then call the `UI` and execute the `UI`'s `printAddItemAcknowledgementMessage` method which would print an acknowledgement message to the user informing him that the item has been added into the item list. | ||
|
|
||
| Step 8: The `ItemListFileManager` object would be called and we would pass the item list to its `writeItemListToFile` method to write the updated item list into the file ListFolder/ItemList.txt. |
There was a problem hiding this comment.
I noticed that the font formatting highlights how the different class diagram elements are being used. Nice work!
|
|
||
| Step 2: The `Command Parser` Class would run the `parse` method and create an `AddItemCommand` object containing an `Item` object which is made up of the name of the item to add as well as its pax which are found within the user input. | ||
|
|
||
| Step 3: The `AddItemCommand` class would be passed back to the `Duke` class. |
There was a problem hiding this comment.
Should Duke be UI or is it another class altogether? It does not appear on the class diagram and is slightly confusing.
|
|
||
| __Step 5.__ The `assignmentMap` looks for the appropriate `Room` object for `301` in the `RoomList` and then looks for the appropriate `Housekeeper` object for `Susan`. It then adds both to the hashmap contained inside itself. | ||
|
|
||
|  |
There was a problem hiding this comment.
I'm not sure if each step requires an object diagram. An object diagram is more suited for static representation rather than a dynamic one.
I think having the class diagram in the "design" section accompanied with the sequence diagram below would suffice.
|
|
||
| Step 7: Changes in the list will be updated to file by calling `HousekeeperFileManager#save()` method. | ||
|
|
||
|  |
|
|
||
| __Interaction__ To understand the interaction between objects of these classes in order to actually add an entry into the hash map inside an `AssignmentMap`, refer to the sequence diagram below. | ||
|
|
||
|  |
|
|
||
| The following sequence diagram shows what would happen if the user typed `add satisfaction Bob 5`. | ||
|
|
||
| PLEASE NOTE: Due to the limitation of PlantUML, the lengths of the activation bars may not be correct, and |
|
|
||
| __Interaction__ To understand the interaction between objects of these classes in order to actually add an entry into the hash map inside an `AssignmentMap`, refer to the sequence diagram below. | ||
|
|
||
|  |
| to verify if name has been recorded. If name is not in records, `HousekeeperList#addHousekeeper()` would be called to | ||
| add the housekeeper, `susan` and `33` into the housekeeperList. | ||
|
|
||
|  |
|
|
||
| Step 5: The `excute` method will then call `printRoom(int level, RoomList roomList)` method to print room information at target level. | ||
|
|
||
|  |
# Conflicts: # docs/team/alinazheng.md
Fixes #348
Add SiewYangZhi's PPP
Small edit to alinazheng.md
Aiman's PPP Draft added
Update name in PPP
Rename aimanimtiaz.md to aiman-imtiaz.md
change ppp file name
Changed name of PPP to github username
…dParser Alina zheng delete refactor command parser
Improve CommandParser and remove logo
Remove dups
…ANFix Fix NAN for average satisfaction
…into resolve-conflicts
Running PR for adding and/or fixing docs before submission
Small fix to empty housekeeper rating case
…into Faliciaong-FinalTouchUp # Conflicts: # ListFolder/event_file.txt
…into Faliciaong-FinalTouchUp
…into resolve-conflicts # Conflicts: # ListFolder/event_file.txt
Faliciaong final touch up
Delete design and implementation for DG
…ions Update Item Exceptions to be more detailed
Fix DG line
Final Release of hotel-lite manager










This HotelLite Manager ChatBot aids the Hotel Manager with day-to-day hotel operations such as inventory management and housekeeping matters. Room status checks and customer satisfaction tracking are also made easier with the HotelLite Manager. It's designed for CLI users, so users can type in commands to do things like check inventory or check room status quickly. The hotel manager's workflow and the hotel's overall performance will be boosted by using this ChatBot