Greetings,
I'm working on a project that involved that has need of a categorization
system. Logically speaking, the system will have elements, these elements
will belong to at least a single category, sometimes more, additionally,
categories may also be members of any number of categories.
Well -- Thats the vision at least. I'm looking for some pointers, tutorials,
white paper, napkins, whatever explaining how this can be done.
I'm working on currently having a database entry:
category
cat_id | cat_name
category_map
map_id | cat_id | child_of
Category map would have a many to 1 relationship with category, I think. 1
entry in category will point to multiple entries in category_map.
To build the category list, I would have to walk all the category elements,
search for any children, then search each of those children for child
matches. Could get ugly with all the lookups, caching the result would help,
but it would be nice if there was some way of doing this that I'm just not
seeing. ;)
If anyone has worked on something like this before, I would really really
appreciate some pointers on how to structure this.
Thanks much,
--Brian
I'm working on a project that involved that has need of a categorization
system. Logically speaking, the system will have elements, these elements
will belong to at least a single category, sometimes more, additionally,
categories may also be members of any number of categories.
Well -- Thats the vision at least. I'm looking for some pointers, tutorials,
white paper, napkins, whatever explaining how this can be done.
I'm working on currently having a database entry:
category
cat_id | cat_name
category_map
map_id | cat_id | child_of
Category map would have a many to 1 relationship with category, I think. 1
entry in category will point to multiple entries in category_map.
To build the category list, I would have to walk all the category elements,
search for any children, then search each of those children for child
matches. Could get ugly with all the lookups, caching the result would help,
but it would be nice if there was some way of doing this that I'm just not
seeing. ;)
If anyone has worked on something like this before, I would really really
appreciate some pointers on how to structure this.
Thanks much,
--Brian
Comment