O'Reilly logo

Test-Driven Java Development - Second Edition by Viktor Farcic, Alex Garcia

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

Introducing the new feature

After getting to know the code more, it seems that the most important functional change is to replace the current status (fragment):

@XmlRootElement 
public class Book { 
 
  private final String title; 
  private final String author; 
  private int status; //<- this attribute 
  private int id; 

And replace it with a collection of them (fragment):

@XmlRootElement 
public class Book { 
  private int[] statuses; 
  // ... 

This might seem to work (after changing all access to the field to the array, for example), but this also prompts a functional requirement.

The Alexandria software should be able to store books and lend them to users who have the power to return them. The user can also query the system for books, by author, book title, ...

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