I am. I was at Scotch 2007 too :-) It was actually 2007 and Mark Drew's Coldspring talk that sparked my OO juices!
Alan ________________________________________ From: [email protected] [EMAIL PROTECTED] On Behalf Of Jatin Nanda [EMAIL PROTECTED] Sent: 30 January 2008 17:26 To: [email protected] Subject: [CFCDEV] Re: myBean.save() versus myServiceObj.save(myBean) Hey guys, Not wanting to hi-jack the the thread, but here goes: - @ Alan - as you are based in the UK why not come to Scotch on the rocks 2008 (http://www.scotch-on-the-rocks.co.uk/speakers.cfm) in Edinburgh this June, we are going to have the pleasure of some CF big hitters. Having seen various threads similar to this one over the past year or so one of the objectives of the conference is to target such grey areas. Again sorry for the hard sell. Best wishes to all, Jatin On 30/01/2008, Dan Wilson <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: Good response Peter. I've actually used both ways User.save() and UserService.save(User). It really does come down to personal preference. On Jan 30, 2008 12:16 PM, Peter Bell <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: Hi Alan, Been pretty much beaten to death on cfcdev over the years. Short answer, it isn't right or wrong - more a matter of preference. I prefer syntactically User.save() to UserService.save(User), but that's a pure preference Others prefer it the other way round. Provisos: - Don't put SQL in the bean - eithr way the saving should be delegated to a DAO - For user.save() you need to inject a DAO into your transients which requires ColdSpring with singleton=false, a custom factory or lightwire. - If you need to support remote method cals, you're going to need a Userservice.save() method. I have one for remote calls ad it just delgates to a new bean it creates. Some may prefer just to have the service do the save all the time, but again it's down to preferences. Best Wishes, Peter On 1/30/08 12:03 PM, "Alan Livie" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: > > We currently use the service object to save a bean (which uses a > gateway/DAO its composed with to do the work) > > Another developer has suggested the bean should save really be > responsible for saving itself (again using a DAO its composed with). > > This looks like a good one for a discussion! :-) > > Alan > > -- "Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew." Guillaume Apollinaire quotes --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
