Wednesday, August 24, 2005

fishhook lists

how do you represent hierarchial data in a flat list? The answer is a fishhook list. A fishhook list is a flat list of items that all have parent element in them. The parent elements point to other items in the list that are their parents. Thus creating hierarchial structures.

why do I bother to mention this? becuase today I got to look at a major enterprise application from a major application vendor where some einstien created about 50 hierarchial tables to represent the maximum number of levels he thought his program would need. This was an insane hack that was completely unnecessary. A fishhook list is all you need.

No comments: