If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Data Model Issues

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-07, 08:55
wowbagger wowbagger is offline
Registered User
 
Join Date: Feb 2007
Posts: 6
Data Model Issues

Hi all. I'm having problems deciding on a model I'm working on. I'm sure this is something that crops up a lot and probably has a simple solution but I haven't come across it myself before and its given me major headaches.

I have a users table.
users can be members of groups
users can subscribe for courses
users can enrol on lessons

we want to provide Forums
A Group may have one or more Forums
A lesson may have a Forums
A Course may have one or more Forums

So I came up with the attached diagram (lessons left off for clarity)
Data Model Issues-drawing1.jpg

However the problems arise when I try to create a list of all the forums a user is entitled to view.

What do you guys think is my model right and I'm just not getting the union right or is there a better way to design the model.
Reply With Quote
  #2 (permalink)  
Old 02-15-07, 10:43
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
Hmmm.... so a course can not exist without an associated forum? Which means that a user can not be associated to a course until a forum exists. And is that always a forum that the user is associated to via a usergroup?
Reply With Quote
  #3 (permalink)  
Old 02-15-07, 11:02
wowbagger wowbagger is offline
Registered User
 
Join Date: Feb 2007
Posts: 6
Sorry I knocked that diagram up in a hurry today and didn't really check if the relationships where optional or not.

conceptually I guess a course (or a group) may exist without having a forum.
Reply With Quote
  #4 (permalink)  
Old 02-15-07, 12:13
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
I think the relationship between Course and Forum is confusing. Is there a mandatory relationship between Course and Forum on Course ID? All i see is the optional one on Forum ID whis would violate your third premise. " A Course may have one or more Forums"
Reply With Quote
  #5 (permalink)  
Old 02-15-07, 12:52
wowbagger wowbagger is offline
Registered User
 
Join Date: Feb 2007
Posts: 6
your right. The Diagram is wrong.

Course_Forums Should have the same sort of relationships as Group_Forums

Diagram currently looks more like this.
Data Model Issues-drawing1.jpg

Last edited by wowbagger; 02-15-07 at 13:24.
Reply With Quote
  #6 (permalink)  
Old 02-16-07, 04:58
wowbagger wowbagger is offline
Registered User
 
Join Date: Feb 2007
Posts: 6
So now we have that sorted out.
The problems I am anticipating are when I try to list all the Forums a user has permissions to see. Also when I come to add Lesson_Forums or other types of forum.
Reply With Quote
  #7 (permalink)  
Old 02-16-07, 10:11
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
Is a permission defined as the Users association to a Group and the groups association to the forum? Or, is it defined as the Users association to a course and the courses association to the forum.... or are the permissions defined independently?
Reply With Quote
  #8 (permalink)  
Old 02-16-07, 10:53
wowbagger wowbagger is offline
Registered User
 
Join Date: Feb 2007
Posts: 6
A user would be allowed to see the forums for the groups they are in and for the courses they are enrolled on but not for the other groups or courses.
Reply With Quote
  #9 (permalink)  
Old 02-16-07, 16:09
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
So, I think you have answered your question. If you can associate users to forums through groups OR courses, then you will have to get the rows from both groups and courses (union). Then, you would find the rows in common between users, courses U groups, and forums (join).
Reply With Quote
  #10 (permalink)  
Old 02-17-07, 10:34
wowbagger wowbagger is offline
Registered User
 
Join Date: Feb 2007
Posts: 6
that's certainly one way to do it. My concerns are that it doesn't seem very scalable. Its quiet a complex query to get the list of user_Forums and will get even more complex if we bring on line other types of forum such as Lesson forums.

Can anyone see a better way of doing this?
Reply With Quote
  #11 (permalink)  
Old 02-21-07, 09:56
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
Quote:
Originally Posted by wowbagger
that's certainly one way to do it. My concerns are that it doesn't seem very scalable. Its quiet a complex query to get the list of user_Forums and will get even more complex if we bring on line other types of forum such as Lesson forums.

Can anyone see a better way of doing this?
Scalability and simplicity of queries were not in the original requirements. That will require a scope change.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On