Hi,
I was wondering if I am making things to complicated. In my application (CMS) I am working with a lot of trees as can be expected. There is a tree for the website, one for the images, the news, files, users an more.
In the old days I used to build the trees from just one table - so that if an item had children it would become a folder. This makes perfect sense when working on the tree for the site it self - since all items (parents or children) share the same properties - all are just webpages.
But let's say that the tree represents newsletter. Each folder is a newsletter and items in the folders are issues. In that case the parent and child don't share the same properties.
What I did was that I had two tables for each "type of content" like this.
newsletters_folders
newsletters
images_folders
images
...and so on. There are good things about going this way - and there are bad things.
My question is - is this the right way? Is there a more elegant way? How do you do it?
Regards,
SamĂșel