-
Notifications
You must be signed in to change notification settings - Fork 233
[CS2113-T12-2] BookKeeper #47
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
base: master
Are you sure you want to change the base?
[CS2113-T12-2] BookKeeper #47
Conversation
wenxin-c
left a comment
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 well done in the tp so far. Good use of abstraction and OOP. Minor details especially in the sequence diagram for your consideration. Keep it up.
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 shouldn't be a break for InputHandler activation bar when it is calling InputParser method. You might consider summarise the initial add loan xxx or make it multiple lines so that the diagram will be larger.
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.
Is there supposed to be a self-invocation at the start of the activation bar for InputHandler?
| case "add-book": | ||
| addBook(commandArgs); | ||
| break; | ||
| case "view-inventory": |
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.
You could consider converting the commands into named constants so that it could be easier to use in other places and to maintain in the future, similar to magic numbers or literals that you might use frequently/change in the future.
| */ | ||
| public static String[] extractAddBookArgs(String input) throws IncorrectFormatException { | ||
| // Split the input into required fields and optional note | ||
| String[] splitInput = input.trim().split("( a/)|( cat/)|( cond/)|( loc/)", 5); |
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.
You might consider making the array name sound more noun and plural, e.g. inputParts, splittedInputs etc.
| // @Test | ||
| // void extractCommandArgs_missingArguments_exceptionThrown() { | ||
| // IncorrectFormatException exception = assertThrows(IncorrectFormatException.class, () | ||
| // -> InputParser.extractCommandArgs("delete-loan ")); | ||
| // assertEquals("Invalid command format.\nExpected: COMMAND [ARGUMENTS]", exception.getMessage()); | ||
| // } |
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.
Remember to remove commented code.
Jasonlobo21
left a comment
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, good effort in the DG heading towards the right direction
|
|
||
| The following UML sequence diagram shows how the `add-loan BOOK_TITLE n/BORROWER_NAME d/RETURN_DATE p/PHONE_NUMBER e/EMAIL` command is handled. | ||
|
|
||
|  |
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, i think the SD are great across all the ones in the developer guide. However, in all the SD, the header are mislabeled, which is missing the : for eg :InputHandler
| The following UML sequence diagram shows how the `add-loan BOOK_TITLE n/BORROWER_NAME d/RETURN_DATE p/PHONE_NUMBER e/EMAIL` command is handled. | ||
|
|
||
|  | ||
|
|
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 instead of labling "add-loan BOOK_TITLE n/BORROWER_NAME d/RETURN_DATE p/PHONE_NUMBER e/EMAIL" can just write in simple singlish eg add loan with book title, borrower name. Because when using developer guide may not have the code to understand the functions straight away.
| `InputHandler` coordinates with `BookList`, `LoanList` and `Formatter` classes to implement the feature. | ||
|
|
||
| The following UML sequence diagram shows how the `remove-book TITLE` command is handled. | ||
|  |
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.
For this SD, missing dotted line back to user even if its just a success message to alert the calling of function is done
| if you have not organized the code into clearly divided components (no penalty if you didn't), you can use a single | ||
| class diagram (if it is not too complicated) or use several class diagrams each describing a different area of the | ||
| system.} | ||
|
|
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.
could potentially include architecturediagram and OD for the InputParser, BookList, Formatter, and Storage`.
| `InputHandler` calls `Storage.saveInventory(...)` to save the updated inventory. | ||
|
|
||
| 7. Success message is displayed: | ||
| `Formatter` is used to print a message indicating successful removal. |
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, I think even the explanation of implementation is very good. Keep up the good work!
| The method `saveInventory(bookList)` is invoked by `InputHandler` after any method call that makes changes to the current inventory. | ||
|
|
||
| The following UML sequence diagram shows the relevant behaviour: | ||
|  |
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.
For the first alt bar which call mkdirs, Should include a small activation bar there as well as a dotted arrow to return to files's activation bar
| The method `loadInventory()` is called once by `InputHandler` at the start of the program. | ||
|
|
||
| The following UML sequence diagram shows the relevant behaviour: | ||
|  |
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.
I think could include activation bars for the missing one in the SD and dotted arrow returning once job is done
| ``` | ||
|
|
||
| The following is the class diagram of the application: | ||
|  |
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 the class diagram could be made more concise as the attributes and methods look quite lengthy with all of the various types present? Maybe the relevance of the attributes and methods to the explanation within implementation later on could be improved upon?
|
|
||
| The following UML sequence diagram shows how the `add-book add-book BOOK_TITLE a/AUTHOR cat/CATEGORY cond/CONDITION loc/LOCATION [note/NOTE]` command is handled. | ||
|
|
||
|  |
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 entities in the addBook sequence diagram looks like they are missing colons
|
|
||
| The following UML sequence diagram shows how the `add-loan BOOK_TITLE n/BORROWER_NAME d/RETURN_DATE p/PHONE_NUMBER e/EMAIL` command is handled. | ||
|
|
||
|  |
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.
I like how detailed the addLoan SD is! However, the number of frames and text in the method calls make the SD a bit hard to follow. Maybe some parts of the SD could be abstracted out?
|
|
||
| The following UML sequence diagram shows the relevant behaviour: | ||
|
|
||
|  |
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 entity doesn't seem to return at the end of its activation bar although the explanation notes that "Finally, the populated bookList is returned." which gives the idea that the returning of bookList should be terminating the activation bar.
|
|
||
| The following UML sequence diagram shows the behaviour of `delete-loans TITLE n/BORROWER_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.
There looks to be an additional dotted line above the "dotted" commands uml note. Maybe this was left in on accident?
Xavierleejrui
left a comment
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.
DG review
| └── Formatter.java # Formats and displays output | ||
| ``` | ||
|
|
||
| The following is the class diagram of the application: |
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.
I believe that the class diagram is quite comprehensive, although it may be too comprehensive as it could be improved to give a better understanding of the overarching high level code.
| The following is the class diagram of the application: | ||
|  | ||
|
|
||
| ## Implementation |
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 interesting implementation, however would it be better if you add in some design considerations to explain why you decided to go ahead with the different classes
|  | ||
|
|
||
| 1. User issues command: | ||
| The user inputs the command in the CLI with the required arguments, e.g., `add-book The Great Gatsby a/F. Scott Fitzgerald cat/Fiction cond/Good loc/Shelf B1 note/important`. |
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 this be too many inputs for the user to keep track of, especially with the a/ , cond/ terms at the start before every line. Would it be better to just parse through based on the inputs
| 6. Changes are saved to persistent storage: | ||
| `InputHandler` calls `Storage.saveLoans(...)` and `Storage.saveInventory(...)` to save the updated book details. | ||
|
|
||
| 7. Success message is displayed: |
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.
clear workflow good job
…into shengbin-DG-week11-fixes
DG - Fix Save Inventory Activation Bar
Add expected outcomes
|
|
||
| The following UML sequence diagram shows how the `add-book add-book BOOK_TITLE a/AUTHOR cat/CATEGORY cond/CONDITION loc/LOCATION [note/NOTE]` command is handled. | ||
|
|
||
|  |
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 it be better to add the else statements as well into your alt blocks?
|
|
||
| The following UML sequence diagram shows the relevant behaviour: | ||
|
|
||
|  |
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 other sequence diagrams seem to have a return arrow from the Formatter after print functions but this one does now. Would be good to standardize.
…into shengbin-DG-week11-fixes
the notes are weirdly positioned but I couldn't find a way to make it arranged nicer...
DG - Fix Load Inventory Sequence Diagram and Explanation
the notes are weirdly positioned but I couldn't find a way to make it arranged nicer...
…ixDG3 # Conflicts: # docs/diagrams/classDiagram.puml # docs/images/classDiagram.png
Fix InputParser to handle names with "s/o"
…into shengbin-PED-fixes
Fix update-title to use case-sensitive comparison
Update developer guide
Search-title Sequence Diagram in DG
Update missing info
DG Sequence Diagram Minor Edits
Update shengbin PPP
Update dylan-PPP
Update dylan-PPP for page limit
Update dylan-PPP for page length constraints
Edit PPP shengbin-101.md
Edit PPP shengbin-101.md, to fit to 2 pages
BookKeeper helps librarians efficiently update book inventories, track borrowed and returned books with borrower details, and streamline operations like categorization and tracking, ensuring a smooth and organized library experience.