S
sklett
* i posted this in the SQLserver group, but it has some ado.net issues, so
maybe here is good too *
I have a schema in place and I'm starting to think that it must be a bad
design because I'm having the hardest time organized my results so that I
can present them the way I want. Here is the situation.
Our website has a support section that is organized by product, so each
product has support data(office documents, faqs, etc) that correlates to a
product. I want to present the data hierarchically like this:
PRODUCT
SUPPORT CATEGORY(s) (IE: faq category "usage")
SUPPORT ITEM(s) (IE: faq)
My DB schema looks like this:
[ Products_Main ]
ProdId
ProdTitle
Etc..
[ Prod_Faqs ] (many to many)
ProdId
FaqId
[ Faq_Main ]
FaqId
CategoryId
Question
Etc...
[ Faq_Categories ]
CatId
Title
So let's say the user wants to see the FAQs for product "A". I need to get
all the records from [ Prod_Faqs ], then JOIN [ Faq_Main ], [
Products_Main ], and finally [ Faq_Categories ]
This already presents a problem because I want to group the FAQs by
category. It feels like I should instead link products to FAQ categories,
then get the FAQ items from the category.
one more thing, the reason this is a problem is that I have no relationship
between a PRODUCT and a FAQ_CATEGORY.
If I did, then I could easily join everything in a way that was logical, but
it seems backwards and incorrect to have tie a category to a product when
the FAQ itself is what has a logical relationship to the product.
I may be shooting myself in the foot by "over abstracting". Does it seem
like good design to have a many-to-many table linking FAQ_CATEGORIES to
PRODUCTS?
I see the category as an orginizational object, not a data object, that is
why I am reluctant to integrate it too heavily into the schema.
As it is right now, I am getting 1 big table back, then looping through the
results and populating a series of arrays of classes to gather everything
the way that I want so that I can populate nested web controls.
IE:
class CSupportCategory
{
ArrayList mFaqList; // array of CSupportFaq
}
class CSupportFaq
{
string Title;
// etc...
}
A bit lost. I just want to stop question my DB design and get on with
things, but I fear it's a bad design and I don't want to work off a bad
design.
Any help or guidance, suggestions would be so greatly appreciated.
Thanks for reading,
Steve
maybe here is good too *
I have a schema in place and I'm starting to think that it must be a bad
design because I'm having the hardest time organized my results so that I
can present them the way I want. Here is the situation.
Our website has a support section that is organized by product, so each
product has support data(office documents, faqs, etc) that correlates to a
product. I want to present the data hierarchically like this:
PRODUCT
SUPPORT CATEGORY(s) (IE: faq category "usage")
SUPPORT ITEM(s) (IE: faq)
My DB schema looks like this:
[ Products_Main ]
ProdId
ProdTitle
Etc..
[ Prod_Faqs ] (many to many)
ProdId
FaqId
[ Faq_Main ]
FaqId
CategoryId
Question
Etc...
[ Faq_Categories ]
CatId
Title
So let's say the user wants to see the FAQs for product "A". I need to get
all the records from [ Prod_Faqs ], then JOIN [ Faq_Main ], [
Products_Main ], and finally [ Faq_Categories ]
This already presents a problem because I want to group the FAQs by
category. It feels like I should instead link products to FAQ categories,
then get the FAQ items from the category.
one more thing, the reason this is a problem is that I have no relationship
between a PRODUCT and a FAQ_CATEGORY.
If I did, then I could easily join everything in a way that was logical, but
it seems backwards and incorrect to have tie a category to a product when
the FAQ itself is what has a logical relationship to the product.
I may be shooting myself in the foot by "over abstracting". Does it seem
like good design to have a many-to-many table linking FAQ_CATEGORIES to
PRODUCTS?
I see the category as an orginizational object, not a data object, that is
why I am reluctant to integrate it too heavily into the schema.
As it is right now, I am getting 1 big table back, then looping through the
results and populating a series of arrays of classes to gather everything
the way that I want so that I can populate nested web controls.
IE:
class CSupportCategory
{
ArrayList mFaqList; // array of CSupportFaq
}
class CSupportFaq
{
string Title;
// etc...
}
A bit lost. I just want to stop question my DB design and get on with
things, but I fear it's a bad design and I don't want to work off a bad
design.
Any help or guidance, suggestions would be so greatly appreciated.
Thanks for reading,
Steve