Journal blinder's Journal: [Programming] Child/Sibling: Possible Approach 12
well, as i said in this journal entry i think i do have a solution. and here it is, its called the nested set model.
there's a decent description of it here
the reason i am still a little hesitant is that the concept still isn't 100% clear for me. the concept of "left" and "right" is a bit fuzzy. i'm going to actually play around with it... but the nice thing is, in the above article, all of our use cases are represented. so, i'm a work with it and see if its a fit.
Two points: (Score:1)
b) The nested set model looks kind of interesting, but I wonder how resource intensive it will be when adding/deleting nodes? It looks as though every node to the right of the one being modified will need to be updated. H
Re: (Score:1)
Re: (Score:2)
Maybe I'm missing the finer nuances of the problem and the solution though.
Re: (Score:2)
in this project, the old ways of doing things and the establishment need to take the back seat. we are being asked to perform a miracle, and if we can pull it off, it will be because we were clever.
Re: (Score:2)
How many elements will realistically be on a page? 50? 100? 500? 1000?
Re: (Score:2)
It looks clever, and IMHO, that's the problem. Always remember Kernighan's comment on the relative difficulty of debugging and programming. arb is right, too. If this table has many rows and gets updated frequently, it's going to perform like a dog. I believe it could be refined to make the left and right values more local, so a change of elements doesn't touch unrelated rows.
I'll admit that I'm a bit undercaffeinated at the moment, but what's wrong with just a parent id and sequence column? That giv
heh (Score:2)
Any nested set (Score:2)
Re: (Score:2)
Re: (Score:1)
Give this boy a cookie! Maintenance is definitely going to be an issue with any radical approach - and that is something I know only too much about with the project I work on. You have to remember to factor in how much time it will take a new member of the team to get up to speed and what is the likelihood they will misconstrue something and botch the job? For example, it can take even the best candidates a go
Re: (Score:2)
Perhaps Helpful... (Score:2)