I know Scott has decided on a with a solution, but I'd like to
continue this fruitful discussion.

On Tue, 11 Jan 2005 17:38:41 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> It was last night when I realised that there is no real concrete
> relationship between Article and Comment as at the end of the day an Article
> can exist without comments 

I'm curious why everyone is asking, "Can an article exist without
comments?" I've been asking myself the opposite question: "Can a
comment exist without an article?" In a typical blog, I think the
answer is no. That's why I think comments should be tucked away under
articles.

Since you can't retrieve a comment without knowing the article to
which it belongs, doesn't it make sense just to get the comments by
traversing the article? Why burden a higher level module with the
repsonsibility of managing that relationship? And if an article knows
about its comments, why not just store the comments when you store the
article, freeing the higher level module from that burden as well?

<cf_tangent>
When I encounter a room full of unruly objects, the first thing I do
is ask each of them why they're there. Invariably, many of them will
say, "Because so and so dragged me here." I send those objects out of
the room  so I can focus on what the primary objects are doing.
</cf_tagent>



> so if I were to feed that down the uber DAO
> pipe, it would have to do some logic to firstly determine if a comment
> exists, how many and save them... 

I don't think you need an if statement to determine whether an article
has comments. An article will always have a /collection/ of comments.
That collection may be empty -- and it always is initially -- but it's
still there.

Patrick

-- 
Patrick McElhaney
704.560.9117
http://pmcelhaney.blogspot.com
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to