In the phonebook application, there are check boxes that use a special
model (CheckBoxModel) to populate a Set<Long>. This set stores the
primary-key of all the checked contacts. These are then fed to the DAO
to delete all the selected contacts.

But, let's say that there is an option called "change all selected
names to 'fred'". It would be silly to have a DAO method called,
"changeFirstName(int id, String new_name)". Instead, this would be
cleaner:

for (Contact curr_contact: selected_contacts) {
  curr_contact.setFirstName("fred");
  contact_dao.save(curr_contact);
}

This means that, instead of storing primary keys in a Set<Long>, we
should store the actual object in a Set<Contact>. Assuming that the
object being stored is serializable and fairly small, are there any
performance implications here?

Thanks,

Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to