The project I'm on is trying to decide whether
to use the ideas in Ray Ryan's presentation.
I am arguing for it, but I'm running into some
difficulties.
1) His presentation has a class representing
contacts with a list of detail ids:
public class Contact implements Serializable {
String name;
ArrayList<ContactDetailId> detailIds;
// constructors
// getters and setters
// toString
}
There are ContactDetail objects that contain
ContactDetailId objects. However, the
presentation only has one type of ContactDetail,
Phone. The sample version I've seen has toy
phones created in the onModuleLoad method.
Where would these ids come from in a real
example? If the phones are stored in a database,
I guess I would use their primary key. However,
I would want to distinguish a Phone key of '23'
from an Address key of '23'. I could prefix
these keys with a string: 'phone 23' or 'address
23'. I could instead create classes for each type
of detail id:
public class PhoneId extends ContactDetailId {
// constructors
}
public class AddressId extends ContactDetailId {
// constructors
}
However, much of the data we shall administer
will come from a lightweight directory, and I am
not clear how best to extract an id from
multivalued element of a directory node.
Would I use <username>-cn-2 for the second
common name of a user? For single-valued
items, I could use <username>-displayName as
my format.
2) Suppose I have a form to edit or create a
contact. If I download a contact the way Ray Ryan
recommends, I get a list of ContactDetailIds.
However, the form probably expects the data I'm
editing in a specific order. The ids may tell me what
they are ids for, but they may not. I may find
myself instead having the client asking the server
for individual types of ContactDetails, in which
case the ContactDetailId class becomes much
less useful to the application. Is this the best I
can do?
Respectfully,
Eric Jablow
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.