I have a Hierarchical structure, similar to Folders/Directories.
I am going to use CellTreeWidget for data presentation.
and planning to use RequestFactory/JDO/Google Data Store /GAE for
persistence/data access.
What is the best way to deal with this situation?
two approaches for the model that I could think of:
Approach #1:
class Folder {
String id;
String name;
Folder parent;
}
or
Approach #2:
class Folder {
String id;
String name;
Folder parent;
List<Folder> children; // here we are keeping/references to the
children
}
with Approach #1:
Query #1: we Select Folders whose parent is null --> this gives us
the list of top level folders
now that we have top level folders, every time user selects an item,
we can fetch child folders from the server
Query #2:
user selects a folder --> selects folders whose parent is the selected
folder
my concern is this approach could be slow, as upon each slection, user
has to wait for children (if any) to be fetched.
the alternative is to use Approach #2:
with this, since we are having references to children folders,when
user selects an item,
we already have its children. somehow like being one step ahead from
the user.
or better yet,
is is possible to issue Hierarchical Queries on App Engine datastore ?
so that with one single query, we can get multiple levels deep into
the tree structure ?
--
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.