If you take the idea that articles and comments are actually very similar
things, why not simply look at them from a parent/child standpoint.

You have a BlogBO that allows a user to create the initial comment
(article or what have you) and allows child comments that are connected to
it. Maybe I'm looking at this more from a DB perspective. You can add
restrictions (no html, images, etc.) to the child comments within the
BlogBO's methods based on whether it's a parent or child comment.

This even works with XML as the storage medium. Quick XML structure
without bells and whistles:

<comment>
   <guid></guid>
   <parentguid></parentguid>
   <datetimestamp></datetimestamp>
   <title></title>
   <content></content>
   <author></author>
</comment>

parentguid would be 0 for new content or the guid of the comment being
replied to (in a messageboard style). datetimestamp allows you to order
the comments chronologically.


benjamin


> 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]
>

----------------------------------------------------------
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