[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: DefaultTreeModel doesnt user encoder to get the node
From:       Lance Java <lance.java () googlemail ! com>
Date:       2013-06-22 13:02:13
Message-ID: CAN7Z0vS3B8rBj5vkPFAHAh=3UgjfXRk62X81AQNQJgePZMKrcQ () mail ! gmail ! com
[Download RAW message or body]


FYI I've just cleaned up the demo and added a bit of documentation
http://tapestry-stitch.uklance.cloudbees.net/databasetreedemo



On 20 June 2013 18:16, Boris Horvat <horvat.z.boris@gmail.com> wrote:

> Hm...Ok I see the benefit of your implementation I will definitely give it
> a try this weekend
>
> Thanks
>
> On Thu, Jun 20, 2013 at 3:16 AM, Lance Java <lance.java@googlemail.com
> >wrote:
>
> > Yes, that's exactly why I created the LazyTreeModel.
> >
> > The DefaultTreeModel works best when the entire model is loaded into
> memory
> > and the model is stored between requests (in the session or as a
> > singleton). The first time a node is expanded, it must be found by
> > traversing from the root which has complexity O(N). Subsequent expansions
> > of the same node have complexity O(1) since a hash lookup in a cache is
> > done.
> >
> > In contrast, the LazyTreeModel has complexity of O(1) without needing to
> be
> > stored between requests. For this reason, I feel it is more scalable
> since
> > you never store the entire tree in memory.
> >
>
>
>
> --
> Sincerely
> *Boris Horvat*
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic