Listing 9.3


#1

I understand what the code is doing (including the correction) however, the heading says: Generating crimes (CrimeLab.java).

Where in Crimelab.java? Isn’t CrimeLab a class? Shouldn’t this code be going into CrimeActivity.java? Is that a typo?


#2

As I understood (also you can see in Figure 9.2), CrimeLab is a Model which needs to have all crime information, that’s why Listing 9.3 generates and stores crimes in CrimeLab.java.
CrimeActivity is just supposed to handle(control) this.


#3

Thanks. I guess I’ll have to go back and re-read that section a fully understand what they mean by “Model” and this whole thing of “Singleton”.