-
Notifications
You must be signed in to change notification settings - Fork 231
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-F15-4] BookBuddy #54
base: master
Are you sure you want to change the base?
Changes from 219 commits
710ffae
b96b434
7b035be
84adc3c
de13d71
3a3fc92
ed5e560
9412bb1
ec569b3
4b1f6d9
0609e25
d027b8f
1c787a4
9a0e416
27e46ca
f30228c
c0194a2
9c47da6
63ffe2d
428e620
d73c73c
bf0a3ea
0526880
fd72967
1b6a222
9ada02d
e5c0a5c
73bb92d
b71fd50
456c954
97f9875
861e712
5fa73e6
f08aa61
516797b
07002fc
3ef2737
b238ed1
cae51b9
68c9344
df7ae15
a1840d0
e82d270
a512908
90c9aae
ba52217
e93069d
26e84cf
780b896
ba647d8
2c78698
55e1268
9b2ab9c
3858f9f
add2227
56345d5
cf3daab
d7e92ad
7c4477f
34a8243
49d219a
6c1bbd5
a1786c9
db5f12a
32f516b
0d17ef0
11ec90c
d4dbd0a
0edcddd
ef92ceb
04f8aa4
e469438
a5e0f9a
0068a36
3e787fe
ae844d6
c9e4191
21d8e28
2601b0e
6c0edaa
f2a0828
2f4958c
dd5b2d6
efdff81
beff5a6
0d3d4f5
b361ce6
925208b
66dfae5
1678a54
955f809
eeb669b
38ee255
e38893b
9b85f94
6ee9ecf
42af33b
d7ed909
2855eaf
bb3302f
17d3a48
a47ef27
1ae9490
264917b
f666bd6
9427462
88bafb9
85274a1
688503c
0d39ad8
6833b5e
bb45824
87060d0
dffe06e
ad0f9ec
3358171
e0d1899
ba3f7d5
62ae195
a487345
88bc37e
2a7af01
f4d2568
08eb0d2
8dd8f05
cff2977
43d9261
3c91489
ebd04d4
68af54f
4e08a33
36a2fc4
cf9dc87
c333b14
6e48fef
92a7e1f
a7835ea
0aa462b
c5082dc
8cccf6b
79d8aeb
932c633
72c68bf
ebf9b86
8559dee
6463a01
5cf817e
d5924d8
61a1891
b9e8c4c
107ecf5
8384f7e
1416bed
0d34f56
3651acc
a0049c9
2142474
2717594
dd5ae54
45cd16a
44ca3a9
f66375c
0ba1a36
c8c63de
04b28cc
12e624b
136b5eb
9c46538
02fddf2
9fb9833
28e1199
63975a9
667c9d8
b513ee2
2533bcb
3da37aa
109ccf0
6e58f53
5188332
3c7c0e2
cc761d9
403bc58
1dd2c99
e703274
69975db
cfd1585
49c7f48
ea5d2be
557fd42
7f236e8
0ba2be9
370caac
24fe1ec
7b274bf
37f6238
94c732e
712c2d1
dfb7676
506aa0e
64ca366
9da2be0
3848b30
81b9039
86d816a
a80d49a
8c8da3e
b1e0630
6b0cb79
4bef2e7
5d8a3c9
7a8d578
d280ed7
4bf529b
b8abbe3
ca5e9cf
932c875
1d750b2
fcfcb12
3af4592
9c10219
e224239
b8911ff
cd7d18f
df95894
8d3c479
6db89d7
9a02c5e
55920fa
936c109
4145f9e
f09e119
8b8d0d5
9f3e950
2f83c33
2e2a319
4531ae6
fc2e81f
37be28c
14aba18
0f94ae2
6f95e4d
0d9a1b1
bc88e68
0c0481e
f0ed1ef
9801dbf
344520f
3ef2f65
468cb72
d822274
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Apr 01, 2024 6:16:13 PM seedu.bookbuddy.BookBuddy main | ||
INFO: BookBuddy application started. | ||
Apr 01, 2024 6:16:13 PM seedu.bookbuddy.BookBuddy getUserInput | ||
INFO: Starting to get user input. | ||
Apr 01, 2024 6:20:29 PM seedu.bookbuddy.BookBuddy main | ||
INFO: BookBuddy application started. | ||
Apr 01, 2024 6:20:29 PM seedu.bookbuddy.BookBuddy getUserInput | ||
INFO: Starting to get user input. | ||
Apr 03, 2024 12:51:38 PM seedu.bookbuddy.BookBuddy main | ||
INFO: BookBuddy application started. | ||
Apr 03, 2024 12:51:38 PM seedu.bookbuddy.BookBuddy getUserInput | ||
INFO: Starting to get user input. | ||
Apr 03, 2024 12:57:30 PM seedu.bookbuddy.parser.parservalidation.Exceptions validateCommandArguments | ||
WARNING: The add Command requires a book title | ||
Apr 03, 2024 12:57:30 PM seedu.bookbuddy.parser.parservalidation.Exceptions handleException | ||
WARNING: Invalid command argument: The add Command requires a book title | ||
Apr 03, 2024 12:57:30 PM seedu.bookbuddy.parser.ParserMain parseCommand | ||
WARNING: Sorry but that is not a valid command. Please try again | ||
Apr 03, 2024 12:57:30 PM seedu.bookbuddy.parser.parservalidation.Exceptions handleException | ||
WARNING: Command is invalid: Sorry but that is not a valid command. Please try again or type: help |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
 | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:-------:|:---------------------------------------:|:---------: | ||
 | Joy Liu | [Github](https://github.com/liuzehui03) | [Portfolio](docs/team/johndoe.md) | ||
 | Joshua Ho | [Github](https://github.com/joshuahoky) | [Portfolio](docs/team/johndoe.md) | ||
 | GARETH Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Zong Yao | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,110 @@ | |
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
|
||
Reference to AB-3 Developer Guide | ||
* [Source URL](https://se-education.org/addressbook-level3/DeveloperGuide.html#documentation-logging-testing-configuration-dev-ops) | ||
* Used as template to structure this DeveloperGuide | ||
* Reference to AB-3 diagrams code | ||
|
||
Reference to AB-3 diagrams code | ||
* [Source URL](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams) | ||
* Used as reference to understand PlantUML syntax | ||
|
||
|
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you could remove the placeholder text so that it's clearer where the Design and Implementation section begins |
||
|
||
### Categorising the different books by their genres | ||
This functionality enables the categorization of books into distinct groups based on their genres, facilitating better | ||
organization and tracking. The implementation of this feature involves interactions across multiple classes within the | ||
system. | ||
#### Overview | ||
The process of categorizing books by genre is a multi-step operation that involves the following classes: | ||
1. `BookDetails`: This class contains methods that handle the categorization of books. | ||
2. `Book`: Individual book objects are updated with their respective genres directly in this class. | ||
3. `Parser`: This class is responsible for parsing the input command to extract the specific index and genre. | ||
|
||
#### Detailed Workflow | ||
Below is an example usage: | ||
Here’s a step-by-step guide on how the feature works: | ||
Step 1: The user initiates the process by inputting a command like `set-genre 1 Fantasy`. Here, the `Parser` class plays | ||
a crucial role as it interprets the command and segregates it into a manageable array. The first part of this array holds | ||
the command `set-genre`, which indicates the action to be executed. | ||
|
||
Step 2: The second segment of the input string is then further dissected into two components, which are the index (`1`) | ||
and the genre (`Fantasy`). This step is essential for identifying the specific book and the genre it needs to be | ||
associated with. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good display of alternatives considered! |
||
Step 3: With the index and genre clearly identified, these parameters are passed to the `setBookGenreByIndex` method | ||
within the `BookDetails` class. This method is then responsible for assigning the specified genre to the book located at | ||
the given index. | ||
|
||
#### Implementation and Rationale | ||
The decision to involve multiple classes in this operation is driven by the principles of object-oriented programming, | ||
which emphasize modularity, encapsulation, and separation of concerns. By distributing responsibilities across different | ||
classes, the system remains flexible, with each class focusing on a specific aspect of the functionality. | ||
|
||
* The `BookDetails` class is central to managing book attributes and behaviors, making it the logical location for methods | ||
* that categorize books. | ||
* The `Book` class represents individual books, and it is here that genre information is ultimately stored, aligning with | ||
* the principle that objects should manage their own state. | ||
* The `Parser` class abstracts the complexity of command interpretation, ensuring that user inputs are correctly understood | ||
* and acted upon by the system. | ||
|
||
#### Alternatives Considered | ||
An alternative design could have centralized the categorization logic within a single class, such as `BookDetails` or | ||
`Parser`. However, this approach was discarded in favor of the current design to avoid overloading a single class with | ||
multiple responsibilities and to adhere to the Single Responsibility Principle. By distributing the tasks, the system | ||
gains in maintainability and scalability, facilitating future enhancements and modifications. | ||
|
||
### BookList Class Component | ||
The `BookList` class is responsible for all actions involving the list of books that the user has. | ||
|
||
#### Overview | ||
The `BookList` class contains one protected static ArrayList named books. This ArrayList will contain Book objects. The methods in | ||
this class all change the ArrayList according to the command given. | ||
|
||
#### Detailed Workflow | ||
Apart from the constructor, the methods of this class like getSize(), addBook() all either return a piece of information about the ArrayList, | ||
the book object that is selected or change an attribute of the ArrayList or selected book object. For the printAllBooks() method, the ArrayList | ||
is iterated through, with the details of each book being printed out according to the toString() format of each book. Other than that, methods like | ||
markDoneByIndex() and markUndoneByIndex() both will change the isRead() attribute of the book of the given index. This class handles errors related to the | ||
ArrayList, throwing exceptions for invalid indexes and invalid actions based on current state (if trying to mark a book that is already read). | ||
|
||
#### Implementation and Rationale | ||
|
||
### Parser Class Component | ||
The `Parser` class is responsible for parsing any input from the user and making sense of them to execute the correct commands. | ||
|
||
#### Overview | ||
The `Parser` class contains several predefined string constants representing the valid commands and a public method to parse the | ||
input from the user. | ||
|
||
#### Detailed Workflow | ||
Whenever input from the user is detected by the program, the `Parser` class will split the command into 2 parts, with the first part | ||
containing the command and the second containing details of the command (if present). The command entered is then evaluated using a | ||
switch statement, with the value of it being compared to the values of each case. In the case of a match, the `Parser` class will then | ||
execute the respective action associated with that command by calling other classes from the program such as `BookList` or `BookDetails`. | ||
This class also handles errors and exceptions associated with the users input. For example, if the user were to give the command `mark` without | ||
specifying an index for which book to mark, or gives a negative number, an appropriate error message will be shown and the command will be rendered | ||
invalid. | ||
|
||
#### Implementation and Rationale | ||
The `Parser` class incorporates exception handling to detect invalid or unrecognized commands. This allows the program to continue running | ||
while prompting the user for valid input | ||
|
||
By abstracting out the parsing functionality of BookBuddy into a separate `Parser` class, the complexity of parsing user input is removed | ||
from the main code. It is instead replaced by a simple interface for the user to work with, adhering to the abstraction concept of | ||
object-oriented programming. | ||
|
||
## Product scope | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
Users that want an all-in-one app to track the books read, progress for each book. | ||
Progress for each book can be recorded according to the number of pages read. | ||
Users will be able to sort books according to genre. | ||
Users can sort books according to Read or Unread. | ||
Users will also be able to search for books via keywords in book titles | ||
|
||
### Value proposition | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Duke | ||
# BookBuddy | ||
|
||
{Give product intro here} | ||
|
||
|
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 you give credit to the sources you referenced!