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

Get Get Programming with Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.