here would be an example using the heap:

class Directory {
        public String name;
        public ArrayList<Directory> children = new ArrayList<Directory>();

        // could have any other properties or attributes here as well
        Directory(String n){
       name = n;

    public void Display() {
                System.out.println(" name: " + name);
                for(Directory d : children)
                        Display();
        }
}

You should be able to add or remove any object in the tree:

...
   directoryObject.children.Add(new Directory("new child"));
...

and you can display the node and any child nodes:

...

     directoryObject.Display();

I want to use the GAE datastore to persist these POJOs (easy enough in
JDO) but also maintain their structural relationship to each other
(hard, at least that I can see) - That is, I am trying to persist the
object instances *and* their relations to each other.

RH



On May 2, 11:37 am, Todd Vierling <[email protected]> wrote:
> 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 to and from the client via RPC.
>
> Design patterns mean pretty much zero in real-world discussions, so example
> code would be a lot more helpful. (Or in other words, "what does the class
> you're trying to persist look like?")

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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-appengine?hl=en.

Reply via email to