41 The library application

 

In this capstone, you will

  • Define an ordered sequence of items using Set
  • Add and remove elements to it to track book loans
  • Create book instances from a parsed CSV file using Map
  • Handle parsing failures using Try
  • Validate book loans or returns by providing expressive error messages using Either

In this capstone, you’ll create an application to keep track of books loaned in a library. Each book has a unique ID and can be checked out by only one user at a time but returned by anyone. Each user can take up to 5 books. You need to write the code to read and parse the available books from a CSV file. In particular, you’ll use a publicly accessible data set called “goodbooks-10k” by Zajac Zygmunt. You can find its latest version as well as a detailed description of its content on its website:

The data set contains 6 million ratings for 10,000 popular books (with most ratings). There are also the following.

  • Books marked by users to read

  • Book metadata (author, year, etc.)

  • Tags/shelves/genres

41.1 Download the base project

41.2 Parsing a book entity

41.3 The business logic layer

41.3.1 Performing a book search

41.3.2 Reserving a book

41.3.3 Returning a book

41.4 Let’s give it a try!

41.5 Possible improvements to our solution

Summary