Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 17th, 2008, 03:43 AM
Authorized User
 
Join Date: Jun 2006
Location: Lahore, , Pakistan.
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sub Categories for Forum-

Hi,

I was wondering how the forum's DB schema would be if I go for the sub categories for the forum as its very common in advance forums where you have major categories of forums and then sub categories as we see in ASP.NET's official forum site.

Will one more table suffice?

Did anyone of you have added this extension to TBH forum. Also what do you think about this extension in TBH forum?

Any ideas/comments ?

Thanks-
  #2 (permalink)  
Old May 20th, 2008, 12:48 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

I don't even think you'd need to add a table.

You could add a ParentCategoryID field to the Category table. If this field is null, then it is a Main (top-level) Category. If the field has a value, then it is a SubCategory of the category indicated by that value.

  #3 (permalink)  
Old May 20th, 2008, 02:30 AM
Authorized User
 
Join Date: Jun 2006
Location: Lahore, , Pakistan.
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Lee Dumond for your response.

  #4 (permalink)  
Old May 20th, 2008, 03:48 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

yes,

as lee aluded to, the parentID property (much like on the tbh_posts table) will allow you to have as much 'depth' in your object as you require. you'd then simply use the repeater control (as an example) and have some UI logic to show the nesting as required (or you could obviously had a recursive method in the BLL that output a linear collection that represented your nested structure). this may of course be some way later in the mix as your 1st objective is obviously to record the category parent when setting up new categories, a (nullable) parentID column will cater perfectly for this.

jimi

http://www.originaltalent.com
  #5 (permalink)  
Old May 20th, 2008, 03:56 AM
Authorized User
 
Join Date: Jun 2006
Location: Lahore, , Pakistan.
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your response jimi.
Okay what could be the cons of having another table say "Group" which will act like what "Forum" is doing currently ? What you guys are suggesting no doubt is a more efficient way of doing it. But what if I go about this way? I won't have to change/add more things if I add a "Group" table-

I'll wait to hear from both of you :)



  #6 (permalink)  
Old May 20th, 2008, 04:05 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

i presume this 'group' table would have three columns (groupID, categoryID, parentCategoryID)?? the upside would be that it certainly wouldn't break anything (thus meaning fewer regression tests etc..) and would be an alternative approach to the issue. the only potential downside to this would be the fact that you'd have an additional query to run (minimal).

to use an old scot's saying, 'its six of one, half a dozen of the other' (i.e. both will work, both have their pros and cons)

jimi

http://www.originaltalent.com
  #7 (permalink)  
Old May 20th, 2008, 05:26 AM
Authorized User
 
Join Date: Jun 2006
Location: Lahore, , Pakistan.
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi jimi,
The "Group" table would have the same fields as the "Forum" table has except for "Moderated" field.

Why you are considering CategoryID in Group table?

  #8 (permalink)  
Old May 20th, 2008, 05:59 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Quote:
quote:Originally posted by tectrix
 Hi jimi,
The "Group" table would have the same fields as the "Forum" table has except for "Moderated" field.

Why you are considering CategoryID in Group table?

tectrix - i'd imagined that you wanted a way to organise category parent relationships, so this definition (of group as per above), would allow you to define a grouping that accomodated the gategory table parent without requiring any amendments to the category table. now that i see where your coming from, the requirement is slightly different. i think you'll need to flesh out what you want to achieve in a more defined way, then i'll be able to get a handle on how it could be structured to best fit it's purpose.

jimi

http://www.originaltalent.com
  #9 (permalink)  
Old May 20th, 2008, 06:06 AM
Authorized User
 
Join Date: Jun 2006
Location: Lahore, , Pakistan.
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, I've started working on what I was thinking of, and will let you know about the details later and will hope to get your feed back on that !

Thanks for your help.

  #10 (permalink)  
Old May 21st, 2008, 05:25 PM
Authorized User
 
Join Date: Jun 2006
Location: Lahore, , Pakistan.
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay guys, I'm back !

Guess what I didn't take a look at the "Forum Extension" post.
Why I couldn't make my point because you guys might be considering as if I alreday have that Category Table above my Forum table.

I was starting from scratch. The table you guys were calling "Category", I was referring it to by "Group". I got your point when I came back to your replies after reading some posts of that "Forum Extensions" thread.

So, I was going to reinvent the wheel!

Now, I don't know how much you guys have extended the TBH Forums. But please do let me know a few things by considering me a beginner who wants to add some enhancements to the TBH Forums.

What I've done-
I've added a Group Table and added a GroupID to the Forum table. So I have a Group, there are forums which belong to some speficific Group. The rest is same, except for some tweeks in GetForums methods & stored procedures (and obviously added methods for Group).

Now on the main page I have a nested Repeater controls, the outer Repeater displays the Group Title and the inner Repeater displays the Forums' Data ( managed to display the Forum's details in a grid form somehow, one option you guys were using was having a GridView within the Repeater, I dont know was doing something wrong and I couldn't make it work). So everything was going fine uptill now.... but when I get to display the Last Post's title in a way forum's usually display, I found that there is design issue, I might need something more in my Forum table !

How you guys solved this issue, what are other things I need to change or add to atleast make some important enhancements to the TBH Forum?

I'm sorry if I've missed if you guys have already discussed that somewhere in this forum!

I would really appreciate any guidence you guys can give me!











Similar Threads
Thread Thread Starter Forum Replies Last Post
New and reorganized categories and forum topics jminatel Forum and Wrox.com Feedback 5 July 15th, 2010 06:05 AM
How to sort categories using checkbox melvados Visual Basic 2005 Basics 2 August 5th, 2008 08:45 PM
Unlimited categories golden_drifter Access 2 August 31st, 2006 07:21 AM
Deleting Categories spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 July 19th, 2006 03:07 AM
Need help : how to query multiple categories will2kready SQL Language 0 January 10th, 2006 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.