CHAPTER 6 CASE STUDY
A LIBRARY APPLICATION (MODELING)
This chapter illustrates how Groovy’s Lists and Maps might be used in practice. For this first case study, we construct a simple model of the loan data maintained by a library. For a more realistic example, see those chapters in which we revisit the problem and construct a more elaborate implementation.
In keeping with modern practice, we develop the library application as a series of iterations. This lets us change the implementation of the case study in a controlled manner. The first iteration illustrates the use of a List and the second a Map.
6.1 ITERATION I: SPECIFICATION AND LIST IMPLEMENTATION
A library maintains a record of books on loan to its borrowers. In this very simplistic ...