Firstly, thanks all I ended up agreeing with you all last night when I foolishly went down the originating path (ie my work email has a big delay so it takes 24 hours for me to get this email! Grr)
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 - 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... Cumbersome and as everyone has pointed out reuse is not there (ie say I want to use the comment logic for another context ie. PhotoGallery).
As Nando and few others pointed out, a Manager is the best use here (I use it 90% for concepts like this but soon as I attach the relationship parent/child I suddenly went of on a tangenet unto itself.. Clearly, I'm a newbie hehe).
I did like your analogy before Nando ie "..but i get really lost in a roomful of objects that are just standing around, socializing for the hell of it.." nice use of wording their as despite it all, sometimes breaking things down like that into real-world humour tends to chip away at the problems un-needed complexity.
At anyrate, I refactored 3am this morning and have been using the concept below... Now some zzZZzz....
Thanks heaps though! I still am learning loads from this list and better yet its 99% of the time ontopic!
(P.S)
Bill: Inco mining is huge, I've only been here a month but I'm amazed at the scope of projects that we have on the cards. Real Data is fun.
Regards,
--------------------------------------------------
Scott Barnes
System Development Engineer
Goro Nickel Project
Level 8, 201 Charlotte Street
Brisbane QLD 4000
Email: [EMAIL PROTECTED]
Personal Blog: http://www.mossyblog.com
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of Nando
> Sent: Wednesday, 12 January 2005 6:33 AM
> To: [email protected]
> Subject: RE: [CFCDev] Newbie approach to Composite Entity pattern.
>
> You mean if they are not deleted as well?
>
> As orphans, they probably suffer somewhat, wander around
> inside the database looking for another article to take them
> in. I anticipate that the repeated rejection that they
> inevitably experience gets the best of them over time, i
> suppose, and they'll probably slink into some dark corner of
> the comment table until the very end.
>
> If i wanted to ease their suffering, what i'd do today is a simple
>
> articleDAO.delete(idArticle)
> commentDAO.deleteByArticle(idArticle)
>
> As you can see, i've been working too much :). Tight
> deadlines, as always, which tend to keep my feet on the
> ground when i'm building stuff. I'm sure others might have a
> more elegant solution, but for now, i'm staying with simple
> solutions when i can, and only if i see they don't work or
> might break down, i head into something more complex. As i
> get better at this, the complex of today will become simple,
> but as is, i'm finding a lot of usefulness and power in a
> loosely coupled model that i can use fluidly. i'm getting
> great mileage spending my time thinking about how to use the
> objects i have nimbly, rather than taking too much time out
> front trying to structure their relationships.
>
> Ok, better get back to the code ... somebody's nagging me
> about spending too much time on emails today!
>
> ciao,
> Nando
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Patrick McElhaney
> Sent: Tuesday, January 11, 2005 8:22 PM
> To: [email protected]
> Subject: Re: [CFCDev] Newbie approach to Composite Entity pattern.
>
>
> Here's a question for those of you who think articles and
> comments should be dealt with separately. What happens to the
> comments when an article is deleted?
>
> --
> 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]
>
