Skip to content

Conversation

@dylankhoo
Copy link

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.

@dylankhoo dylankhoo changed the title [CS2113T-T12-2] BookKeeper [CS2113-T12-2] BookKeeper Mar 2, 2025
Copy link

@wenxin-c wenxin-c left a 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.

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.

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?

Comment on lines 44 to 47
case "add-book":
addBook(commandArgs);
break;
case "view-inventory":

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);

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.

Comment on lines 155 to 160
// @Test
// void extractCommandArgs_missingArguments_exceptionThrown() {
// IncorrectFormatException exception = assertThrows(IncorrectFormatException.class, ()
// -> InputParser.extractCommandArgs("delete-loan "));
// assertEquals("Invalid command format.\nExpected: COMMAND [ARGUMENTS]", exception.getMessage());
// }

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.

Copy link

@Jasonlobo21 Jasonlobo21 left a 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.

![addLoan.png](images/addLoan.png)

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.

![addLoan.png](images/addLoan.png)

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.
![removeBook.png](images/removeBook.png)

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.}

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.

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:
![saveInventory.png](images/saveInventory.png)

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:
![loadInventory.png](images/loadInventory.png)

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:
![](images/classDiagram.png)

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.

![addBook.png](images/addBook.png)

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.

![addLoan.png](images/addLoan.png)

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:

![loadInventory.png](images/loadInventory.png)

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`:

![delete_loan.png](images/deleteLoan.png)

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?

Copy link

@Xavierleejrui Xavierleejrui 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

└── Formatter.java # Formats and displays output
```

The following is the class diagram of the application:

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:
![](images/classDiagram.png)

## Implementation

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

![addBook.png](images/addBook.png)

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`.

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:

Choose a reason for hiding this comment

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

clear workflow good job


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.

![addBook.png](images/addBook.png)

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:

![loadInventory.png](images/loadInventory.png)

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.

ShengBin-101 and others added 9 commits April 3, 2025 20:34
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
ShengBin-101 and others added 30 commits April 8, 2025 02:03
Fix InputParser to handle names with "s/o"
Fix update-title to use case-sensitive comparison
Search-title Sequence Diagram in DG
Update dylan-PPP for page limit
Update dylan-PPP for page length constraints
Edit PPP shengbin-101.md, to fit to 2 pages
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.

10 participants