Skip to content

Commit

Permalink
Update portfolio
Browse files Browse the repository at this point in the history
  • Loading branch information
hoholyin committed Oct 24, 2019
1 parent 6a4790f commit 3ba88fa
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/.gradle/
/build/
src/main/resources/docs/
.sh
testAll.sh

# IDEA files
/.idea/
Expand Down
33 changes: 24 additions & 9 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa

This section describes some noteworthy details on how certain features are implemented.

// tag::addBook[]
//tag::addBook[]
=== Add book feature
==== Implementation

Expand All @@ -163,10 +163,12 @@ Additionally, it implements the following operation:

Given below is an activity diagram of a book being added to the catalog.

image::AddBookActivityDiagram.png[]
.Activity Diagram for adding a book
image::AddBookActivityDiagram.png[width=300, align=center]

Given below is a class diagram of a book after being added to the catalog.

.Class Diagram for `Book`
image::BookClassDiagram.png[]

==== Design Considerations
Expand Down Expand Up @@ -198,23 +200,34 @@ We need to come up with a solution to give us "B00001" in the given example.
* **Alternative 2:** Use brute force to start iterating from "B00001" to obtain the first unused serial number.
** Pros: Will be easy to implement.
** Cons: Will be inefficient once the number of books grow.
// end::addbook[]
//end::addBook[]

// tag::printLoanSlip[]
=== [Proposed] Print loan slip feature
=== Generate Loan Slip feature
==== Proposed Implementation

The printing of loan slip feature is facilitated by `LoanSlipIUtil`.
Essentially, it implements the following operations:

* `LoanSlipUtil#mountLoanSlip()` -- Mounts a loan slip in preparation for generation of loan slip in pdf form.
* `LoanSlipUtil#unmountLoanSlip()` -- Unmounts a loan slip ,usually after generating a pdf version of it.
* `LoanSlipUtil#mountLoan()` -- Mounts a loan slip in preparation for generation of loan slip in pdf form.
* `LoanSlipUtil#unmountLoan()` -- Unmounts a loan slip ,usually after generating a pdf version of it.
* `LoanSlipUtil#createLoanSlipInDirectory()` -- Creates a pdf version of the mounted loan slip in the loan_slips folder.

Given below is the sequence diagram of the generation of loan slip during the loan of a book.

.Sequence Diagram for the generation of a loan slip
image::LoanSlipGeneration.png[]

The following describes the sequence of events displayed in the figure above.

* The `LoanCommand` is executed
* The `LoanCommand` retrieves the `Book` and the `Borrower`
* The `LoanCommand` creates a new `Loan`
* The `LoanCommand` mounts the new loan in `LoanSlipUtil`
* The `Storage` component creates and save a new `LoanSlipDocument` in a saved folder
* The `Logic` component opens the newly generated `LoanSlipDocument` for the librarian to print it immediately
* The `Logic` component unmounts the `LoanSlipDocument` at the end of the process

==== Design Considerations

===== Aspect: How to create and use an instance of a `LoanSlipDocument`.
Expand All @@ -223,17 +236,19 @@ image::LoanSlipGeneration.png[]
** Pros: Will be straightforward to implement.
** Cons: The `Logic` component and the `LoanCommand` object needs to have knowledge on all individual methods of `LoanSlipDocument` to be able to create a loan slip.
* **Alternative 2 (current choice):** Create a Facade class `LoanSlipUtil` to facilitate creation of `LoanSlipDocument`.
** Pros: The `Logic` component and the `LoanCommand` object can now use the full functionality of `LoanSlipDocument` via the static class `LoanSlipUtil` without knowing `LoanSlipDocument`'s internal implementation.
** Pros: The `Logic` component and the `LoanCommand` object can now use the full functionality of `LoanSlipDocument` via the static class `LoanSlipUtil` without knowing the internal implementation of `LoanSlipDocument`.
** Cons: There is more code to be written and we must consider how to save state within a static class such that it can be continually reused.

I have decided to go with Alternative 2. The Facade class provides the system with a *simplified view* of generating a loan slip, making it *easier to use*. It also *decouples* the code, making it easier to modify in the future.

===== Aspect: Implementation to allow extension (loan multiple books at one go).

* **Alternative 1 (current choice):** Mount a loan in `LoanSlipUtil` for each book.
** Pros: Will be easy to extend in the future as we can just mount multiple loans using `LoanSlipUtil` before generating all loans in a single Loan Slip.
** Pros: Will be easy to extend in the future as we can just mount multiple loans using `LoanSlipUtil` before generating all loans in a single loan slip.
** Cons: Will require more code when mounting loans in the Facade class.
* **Alternative 2:** Re-create `LoanSlipDocument` whenever a new loan comes in.
** Pros: Will only need to make adjustments to `Logic` component to contain an `Optional<LoanSlipDocument>` field and update accordingly whenever a new `Loan` comes in.
** Cons: Violates Single Responsibility Principle as the Logic class will now have to change if we change the implementation of LoanSlipDocument.
** Cons: Violates Single Responsibility Principle as the Logic class will now have to change if we change the implementation of `LoanSlipDocument`.
// end::printLoanSlip[]

=== Logging
Expand Down
9 changes: 7 additions & 2 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ Format: `clear`
==== Adding a book: `add`

Adds a new book to library records. +
Format: `add t/TITLE a/AUTHOR sn/BOOK_SN [g/GENRE]`
Format: `add t/TITLE a/AUTHOR [sn/BOOK_SN] [g/GENRE]`

[TIP]
A book can have any number of genres (including 0)

[TIP]
You do not need to specify the serial number if you wish so. +
Liberry will then auto-generate a valid serial number for the new book.
LiBerry will then auto-generate a valid serial number for the new book.

Examples:

Expand Down Expand Up @@ -232,6 +232,11 @@ Loans the book with serial number B00041
* `loan sn/B00201 sn/B02929 sn/B00203` +
Loans the books with serial numbers B00201, B02929 and B00203

Upon loaning a book, a printable loan slip in pdf format will be generated.

.Printable PDF version of a Loan Slip
image::LoanSlip.png[width=250, align=center]

==== Renewing book(s): `renew`

Renew book(s) from the list of currently loaned books, i.e., extend their due dates +
Expand Down
Binary file added docs/images/LoanSlip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 90 additions & 41 deletions docs/team/HoHolYin.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=Ho Hol Yin - Project Portfolio
= Ho Hol Yin - Project Portfolio
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets
Expand All @@ -10,77 +10,126 @@
== About the Project

//Change to one line later
My team believes in a right to education for everyone. With a common belief to improve literacy in the world,
we decided to create a library management system called 'LiBerry' that is free and easy to use for all.
'LiBerry' is designed for smaller communities with a lack of expertise and resources to manage a library.
This library management system is able to add and remove books to and from the library. It is also able to register
borrowers and mark a book as loaned to a borrower. On top of it, it is also able to automatically calculate loan
periods and fines for any overdue loans, as well as generate a loan slip for every loan.
With a common belief to improve literacy in the world, my team decided to create a library management system called
'LiBerry' that is free and easy to use. 'LiBerry' is designed for small communities with a lack of expertise and
resources to manage a library.

This is what our system looks like:
This library management system is able to:

image::Ui.png[width="150", align="center"]
* Add books to the library
* Remove books from the library
* Register borrowers
* Mark a book as loaned to a borrower
* Calculate loan periods and fines for any overdue loans

This is what the main page of our system looks like:

.Graphical user interface for LiBerry
image::Ui.png[]

== Summary of contributions
|===
|_This section shows a summary of my coding, documentation, and other helpful contributions to the team project._
|===

* *Major enhancement*: The ability to *automatically generate loan slips in pdf* for every loan.
** What it does: Allows the librarian to print the generated loan slip for the borrower.
** Justification: Since our target group is small impoverished communities, it is unlikely they will have internet access to check the status of their loans. Therefore, it will be suitable to provide them with a printed version of the loan.
** Highlights: This feature is challenging to implement as it will require us to create a new pdf document from scratch. On top of that, this document will have to be suitably styled as a loan slip using information from the loan.
** Credits: This feature is made possible with the 'iText 7' library. However, it was still required of me to understand the API well and in depth such that I can apply it appropriately to the context of our project.


* *Major enhancement*: Implemented the ability to *add books*
** What it does: allows the user to add books to the system.
** Justification: This feature is the core functionality of any library management system and will greatly enhance the efficiency of the system if implemented and designed well.
** Highlights: This feature is challenging to implement as it will require us to store the books and their serial numbers in an efficient way due to the following 4 requirements:
*** We want our system to be able to *support up to 10,000 books*
*** We require all books to have a *unique serial number* tagged to it
*** We allow librarians to assign new books *any valid serial number* should they wish so.
*** We want all input commands to return results in *less than 1 second*
** Credits: This feature is adapted from the 'add person' feature from Address Book 3. However, we have made many changes to it to allow books to, for example, be loaned out or tagged with a unique serial number.
image::LoanSlip.png[width=350, align=center]

* *Minor enhancement*:
** Implemented the ability to *add books*
** Implemented the ability to *delete books*
** Implemented the ab
** Implemented the ability to *display information* about a book

* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_
* *Code contributed*:

* *Other contributions*:

** Project management:
*** Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub
*** Managed the release of `v1.3` on GitHub. In `v1.3`, we have the following additional features:
**** Pay fines
**** Renew loans
**** Generate loan slip
**** Edit Borrower details
**** Search overdue books and books that are on loan

** Enhancements to existing features:
*** Updated the GUI color scheme (Pull requests https://github.com[#33], https://github.com[#34])
*** Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests https://github.com[#36], https://github.com[#38])
*** Optimised the generation of a new serial number when a new book is added
**** Done through Pull Request https://github.com/AY1920S1-CS2103T-F13-1/main/pull/118[#118]. This enhancement allows the system to efficiently locate and allocate the smallest available serial number to the new book.
*** Made the `Book` Object immutable in preparation for the undo/redo feature in the future
**** Done through Pull Request https://github.com/AY1920S1-CS2103T-F13-1/main/pull/147[#147]. This modification allows the system to track the different states of the system throughout its usage. This is required in order to implement the undo/redo function.

** Documentation:
*** Did cosmetic tweaks to existing contents of the User Guide: https://github.com[#14]
*** Wrote the https://github.com/AY1920S1-CS2103T-F13-1/main/blob/master/docs/DeveloperGuide.adoc#Design-Model[documentation] for the `Model` component of the system.
*** Described the https://github.com/AY1920S1-CS2103T-F13-1/main/blob/master/docs/DeveloperGuide.adoc#generate-loan-slip-feature['Generate Loan Slip'] feature and its design considerations.

** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com[#12], https://github.com[#32], https://github.com[#19], https://github.com[#42]
*** Contributed to forum discussions (examples: https://github.com[1], https://github.com[2], https://github.com[3], https://github.com[4])
*** Reported bugs and suggestions for other teams in the class (examples: https://github.com[1], https://github.com[2], https://github.com[3])
*** Some parts of the history feature I added was adopted by several other class mates (https://github.com[1], https://github.com[2])
** Tools:
*** Integrated a third party library (Natty) to the project (https://github.com[#42])
*** Integrated a new Github plugin (CircleCI) to the team repo
*** https://github.com/nus-cs2103-AY1920S1/addressbook-level3/pull/49/files/22e0d669e265d0f2835df4e4a2d0f15a57b05795[Reviewed](with non-trivial comments) a Pull Request from another group
*** Contributed to forum discussions as a group (Shared a https://github.com/nus-cs2103-AY1920S1/forum/issues/115[tip] on how to check code coverage when running tests)
*** https://github.com/nus-cs2103-AY1920S1/addressbook-level3/pull/49/files/22e0d669e265d0f2835df4e4a2d0f15a57b05795[Reported] bugs and suggestions for other teams in the class.

_{you can add/remove categories in the list above}_
** Tools:
*** Integrated a third party library (iText 7) to the project in https://github.com/AY1920S1-CS2103T-F13-1/main/pull/150[this] Pull Request

== Contributions to the User Guide


|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|_This section outlines my contributions to the team's User Guide. The following are excerpts from the 'LiBerry' User Guide. These excerpts show the additions I made for the 'Add Book' and 'Loan' feature. In the 'Loan' feature, my contributions include only the loan slip portion._
|===
==== Add Book Feature
****
Adding a book: `add`
//include::../UserGuide.adoc[tag=delete]
Adds a new book to library records. +
Format: `add t/TITLE a/AUTHOR [sn/BOOK_SN] [g/GENRE]`
[TIP]
A book can have any number of genres (including 0)
[TIP]
You do not need to specify the serial number if you wish so. +
LiBerry will then auto-generate a valid serial number for the new book.
Examples:
* `add t/Harry Botter and the Baby's Potty a/Raylei Jolking sn/B02010 g/children`
* `add t/Inferno a/Tande g/classic g/epic`
****
==== Loan Book Feature
****
Loaning book(s): `loan`
Loan book(s) by their serial number +
Format: `loan sn/BOOK_SN...`
Examples:
* `loan sn/B00041` +
Loans the book with serial number B00041
* `loan sn/B00201 sn/B02929 sn/B00203` +
Loans the books with serial numbers B00201, B02929 and B00203
Upon loaning a book, a printable loan slip in pdf format will be generated.
.Printable PDF version of a Loan Slip
image::LoanSlip.png[width=250, align=center]
****

== Contributions to the Developer Guide

|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|_This section highlights my contributions to the Developer Guide. The following are excerpts from the 'LiBerry' Developer Guide. These excerpts show the additions I have made for the 'Add Book' and 'Generate Loan Slip' feature._
|===

include::../DeveloperGuide.adoc[tag=undoredo]

include::../DeveloperGuide.adoc[tag=dataencryption]

include::../DeveloperGuide.adoc[tag=addBook]

== PROJECT: PowerPointLabs
include::../DeveloperGuide.adoc[tag=printLoanSlip]

---

_{Optionally, you may include other projects in your portfolio.}_

0 comments on commit 3ba88fa

Please sign in to comment.