Yeah, moving a branch from one part of the tree to another is a bit of a mind bender, as I recall...
I think the big advantage of nested sets is the retrieval ease and speed. Adding, moving, and deleting are a bit diffiult. But of course you only have to write them once. > -----Original Message----- > From: Ian Lurie [mailto:[EMAIL PROTECTED]] > Sent: Friday, 24 May 2002 11:57 a.m. > To: CF-Talk > Subject: RE: Build a tree of nodes/subnodes > > > I'm thinking maybe a trigger to handle that. > > The ColdFusion code to handle updates is looking a little hairy, I'll > admit... > > -----Original Message----- > From: Matthew Walker [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 23, 2002 4:09 PM > To: CF-Talk > Subject: RE: Build a tree of nodes/subnodes > > > We have used the nested sets model for about a year here for the page > structure for a CMS. lft and rgt get out of wack if somebody goes into > the db table and adds rows directly. People aren't supposed > to do that! > Otherwise we've found it reliable. > > Regards, > Matthew Walker > /* > Easier, smarter forms: > http://www.matthewwalker.net.nz/inform2 > */ > > > > > > -----Original Message----- > > From: Ben Johnson [mailto:[EMAIL PROTECTED]] > > Sent: Friday, 24 May 2002 10:48 a.m. > > To: CF-Talk > > Subject: RE: Build a tree of nodes/subnodes > > > > > > I usually do a recursive custom tag to make my trees. I > > haven't tried using > > UDFs for it because of database calls, but with CFMX, I'm > > sure it would be > > nice. I haven't used the nested sets model before, but I > have briefly > > looked at it. My problem with it seems that it's not > > normalized at all. In > > that Intelligent Enterprise article, the lft and rgt columns > > seem like they > > could easily go out of wack if you're not careful. A single > > table with a > > recursive parent ID seems much logical. > > > > Sure, there are some more database calls, but it all depends > > on what you're > > trying to do. For example, we have an application with an advanced > > permissions system that involves cascading permissions and > some other > > tidbits. When the user logs in, their permissions are > pulled through > > recursive custom tags and set to the session scope. It's a > > one time thing > > for each login so any extra load is really not noticeable. > > > > > > > > Ben Johnson > > Hostworks, Inc. > > > > > > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

