mendoz Posted May 15, 2008 Share Posted May 15, 2008 Hey freaks. I'm working on a products catalog application. Every product has a parent category. The categories are organized nicely in a tree, Only the leaves have products associated with them. I hope you understood because now comes the questions: 1. What to do with the products associated with a leaf after it has been deleted? Should I delete the products as well? Put them in a trash bin? 2. What happens with the children of a node after it's deletion? Do they become the children of the node's parent? 3. Why do I like this site? Because the people are nice and answer fast and accurate ! Quote Link to comment https://forums.phpfreaks.com/topic/105705-tree-design-question-really-simple/ Share on other sites More sharing options...
phpzone Posted May 15, 2008 Share Posted May 15, 2008 1. What to do with the products associated with a leaf after it has been deleted? Should I delete the products as well? Put them in a trash bin? This is entirely up to yourself (or your client), I would ask them what they want to happen. Personally we usually have a separate products manager, a category manager, and a products to category manager. If a category was deleted it would orphan the products in it, but we would leave the products available in the products table, but perhaps use an icon to show they are not assigned to a category. 2. What happens with the children of a node after it's deletion? Do they become the children of the node's parent? Again, down to how you want it to work and up to you to code. Typically we would warn the user that deleting a parent node will remove all children. 3. Why do I like this site? Because the people are nice and answer fast and accurate ! Hope it was quick enough ;-) Quote Link to comment https://forums.phpfreaks.com/topic/105705-tree-design-question-really-simple/#findComment-542280 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.