[google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-02 Thread Todd Vierling
On Saturday, April 30, 2011 9:06:45 PM UTC-4, RH wrote: > > I'm looking for a simple way to persist a set of dynamic Composite > Design Pattern objects (as described in Design Patterns by Gamma, > Helm, Johnson, and Vlissides) with either Google's native datastore, > JDO, or JPA, as well as send

[google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-03 Thread RH
In a nutshell, I'm trying to: a) persist a tree structure set of objects b) be able to recall any node and all it's children in the tree c) be able to add a child to any node on the tree in the GAE datastore. On May 2, 11:24 am, supercobra wrote: > What are you trying to achieve? > > -- superco

[google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-03 Thread RH
here would be an example using the heap: class Directory { public String name; public ArrayList children = new ArrayList(); // could have any other properties or attributes here as well Directory(String n){ name = n; public void Display() {

[google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-07 Thread RH
h, I think you're right. Any ideas on how to optimize the datastore query for a sub branch of the tree? With this approach I either need to a) bring in all items in the app (possibly filtered by owner) across the RPC boundary and then structure them in the GWT client b) continue to look for

Re: [google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-04 Thread Ravi Sharma
I will advise you to use unowned relation in this scnerio. Instead of Directory entity having childrens...i will put parent information in the Directory entity.. this way you can make sure one Directiry can have millions of Child directory...as you will not max out the maximum entity size. class D

Re: [google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-07 Thread Ravi Sharma
What do u want to optimize in Query... It will be a simple query... first time when you load you run query like select * from table where parentid==null/0/or even remove where clause then when user click on any node on UI tree then u make RPC call to bring its child.. and load them to tree

Re: [google-appengine] Re: Java GAE/GWT Composite Design Pattern example with Persistence

2011-05-07 Thread Brandon Donnelson
Good point. One way I do it is walk down the tree with individual rpc calls like Ravi said. I try not to take to much data unless its need through rpc. Brandon http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups "Google App Engine" gr