Martin Fowler's book Patterns Of Enterprise Application Architecture covers these issues but his naming conventions differ from our cf terms sometimes.
He talks about Service Layer, Row Data Gateway/Table Data Gateway (similairish to DAO's and Gateway's), Active Record (Reactor), Data Mapper (Transfer - I think) I like a service layer as it means controller code doesn't have to know about other domain objects. I can ask a service for a bean, I can ask it to get me a query, I can tell it to insert/update/delete etc. Some of my services have associations to 10+ DAO's, Gateways and other services. I like this thin API approach but others don't. It's not essential but another preference. In the same way Fowlers book offers several ways to encapsulate a db. You just have to look at your domain and make a decision. Alan ________________________________________ From: [email protected] [EMAIL PROTECTED] On Behalf Of wkolcz [EMAIL PROTECTED] Sent: 28 April 2008 12:20 To: [email protected] Subject: [CFCDEV] Re: Noobie Question Thanks. I guess then it might be better to ask when is it most appropriate to interact the controller with a Service Object and when to interact with a bean to utilize the DOA and Gateway objects? I need to learn what is the strong point and weakness of both so I can know when a situation warrants one over the other. Wish there was a real one-stop-resource out there to cover OOD for CF and all the design patterns. :-) ________________________________ From: "Brian Kotek" <[EMAIL PROTECTED]> Sent: Sunday, April 27, 2008 9:07 PM To: [email protected] Subject: [CFCDEV] Re: Noobie Question Wally, you're basically asking the question "what is the best way to build my object model?", which is essentially an unanswerable question because the answer it "it depends". When using Reactor and ColdSpring and Model-Glue, how do you know that "this way is the better way of doing things"? And what answer do you expect to the question "is it right to assume one should use the Service Object to interact with the bean, the DAO, and the Gateway?" The questions that you're asking are so dependent on what your application actually needs to do, and the forces at play in your specific environment, that they are nearly meaningless without far more context. In some cases the answer will be yes and in some, the answer will be no. On Sun, Apr 27, 2008 at 9:37 PM, Wally Kolcz <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: Another thing. Using Illudium PU-36, it creates a Service Object. After reading more up on it, is it right to assume one should use the Service Object to interact with the bean, the DAO, and the Gateway? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
