Re: Model Question
Re: Model Question
- Subject: Re: Model Question
- From: arturo <email@hidden>
- Date: Fri, 16 Jan 2004 14:50:21 -0500
----- Original Message -----
From: "james cicenia" <email@hidden>
To: "WOdev List List" <email@hidden>
Sent: Friday, January 16, 2004 2:05 PM
Subject: Model Question
> I wish to model a simple message board.
>
> Topic -->> postings -->> replies
>
> Should this be model reflexively? Seems a little awkward to then relate
> it back to say a project. If it is modeled reflexively they will all have
the
> attribute project_id... so how would the relation know to just get the
> top
> set of topics?
>
You can model something like that reflexively. I've always discouraged
reflexive relationships
because that kind of model is very difficult to work with relationally; i.e.
difficult
to work with in pure ansi SQL.
The model you are thinking about is called an adjacency list model. This
guy
Celko advocates a model called nested set
http://www.intelligententerprise.com/001020/celko1_1.shtml
which has certain advantages and one big disadvantage. But he also claims
that the
nested set model works really well for discussion boards. FYI, almost
everyone uses adjacency list
because it's the obvious implementation. But obvious and good have really
gone together in my
experience :-) Another alternative is to just limit the number of levels of
replies you can have.
I guess in your position I would model a Topic object that has the
project_id. Then I'd model
the Posting object. Conceptually at that point you'd need a back pointer
from a Posting to its
parent Posting and to its Topic. That's when you'd have to decide between
adjacency list and
nest set models.
-arturo
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.