NYCPHP Meetup

NYPHP.org

[nycphp-talk] Building trees

Jim Hendricks(Biz Computing) jim at bizcomputinginc.com
Wed Oct 16 16:22:03 EDT 2002



Adam Fields wrote:

>I'd wrap a class around the whole thing. Use that class to broker
>reads and writes to the tree table. Add a "changed" timestamp to the
>tree, and have a read from the class only reload the tree from the
>database if it's changed since the last read. Stash the object in the
>session for reuse, or serialize it to another table (or file, or
>whatever) for quick retrieval.
>  
>
I don't know about the class thing since it adds a level of complexity 
to the code that I don't know
if it's waranted.  I do like the idea of caching the tree though.  I 
would cache it in the DB so that the
tree does not need to be generated at all when the request to display it 
occurs.  The tree would
be regenerated everytime a change occurs to the underlying data ( which 
is a low volume data set )
This may not be a good idea for items that have a higher change velocity.

Jim





More information about the talk mailing list