Results 1 to 11 of 11
  1. #1
    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)
    Click image for larger version. 

Name:	Drawing1.jpg 
Views:	50 
Size:	120.0 KB 
ID:	6803

    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.

  2. #2
    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?

  3. #3
    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.

  4. #4
    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"

  5. #5
    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.
    Click image for larger version. 

Name:	Drawing1.jpg 
Views:	42 
Size:	54.8 KB 
ID:	6804
    Last edited by wowbagger; 02-15-07 at 14:24.

  6. #6
    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.

  7. #7
    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?

  8. #8
    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.

  9. #9
    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).

  10. #10
    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?

  11. #11
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •