I'm playing around with nested sets too. The one thing I learned from the
past few days is that it's actually not at all a bad idea to denormalize
that tree table a bit.

So whatever method I'll end up with, I'm probably going to have a table that
contains all the necessary information for either
nested-set-all-in-one-query display *and* plain-vanilla-recursive-type
querying.

So probably something like the following fields in my table: category_ID /
category_name / category_parent / leftboundary/rightboundary (don't see why
I shouldn't put them in one table instead of in a separate "boundary" table
like in the tutorial). Once I come up with a good method of editing that
tree (cfr. another message I posted here a while ago), I can add
numberofchildren, siblingitems, lastsibling etc. without any problems.

Michel Vuijlsteke
Netpoint NV

-----Original Message-----
From: Roger B. [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 05, 2001 5:45 AM
To: Fusebox
Subject: RE: Animated tutorial


> I think the nested set model would still work great in a threaded
> message board.

Steve,

I've been playing around a bit with the idea, and I'm not so sure. Nested
sets seem to work quite nicely for simplistic trees, but my (admittedly
premature) conclusion is that they just make things difficult if you're
shooting for more complex presentation.

For example, I need to be able to render some fairly complex trees, and
#RepeatString# indentation isn't sufficient. Currently I'm walking a nested
structure with a recursive custom tag that generates a tree that's visually
similar to the ones created with CFTREE. In order to draw all the lines
connecting the various children to their parents, I need to be able to "look
ahead" and see how many sibling items there are, which of them have
children, and which is the last sibling. That's fairly easy to do with
structures, even if CF's current method of recursion is sub-optimal.

Meanwhile, nested sets make the whole process considerably more difficult,
and the workarounds I've explored all lead me back to thinking that I'm
trying to use a wrench to do a hammer's job. The real overhead isn't in the
SQL, after all... it's in the struct-walking. If I'm going to have to take
that hit either way, it probably wouldn't make sense to take on the extra
complexity of nested sets.

Thoughts?


--
Roger
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to