O'Reilly logo

Groovy Programming by John Savage, Kenneth Barclay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required