We have already seen the Caché population utility in action. We populated Contact
twice: first without Address
and then with Address
. In both cases we relied completely on the default behavior of the utility to generate appropriate data for the different properties in our class. The default behavior worked well. It generated names for the Name
property, city names for the City
property, street addresses for the Street
property, and so on. It also randomly selected either Business
, which we restricted to these two possible values. Now, however, the default behavior will not give us exactly what we want. PhoneNumber
contains a property called Number
and the default behavior of the populate utility for a property named Number
is to generate a random number, but not a random phone number.
Property Number As %String (POPSPEC="USPhone()");
After updating the class definition, save and recompile the classes.
Now, use Terminal to remove all instances of Contact
. Use the following command: