I figured I'd throw in my $0.02; I see the gateway as a component that interacts with your persistence layer (or _is_ your persistence layer), and therefore do not make a distinction between gateway and dao. In my usage, the gateway is responsible for interacting with both single rows (CRUD) and multiple rows.
To me the purpose of the gateway is to encapsulate database access, so that if anything changes in your persistence layer (e.g., moving from hand-coded SQL to an ORM, switching ORMs, changes to internal database structure, etc.) the only component that will be affected is the gateway. I'll admit I came to this through the use of Transfer, which doesn't really require that you have DAOs at all as Transfer does all of that stuff for you. My code evolved from having references to Transfer (which is my persistence layer) sprinkled throughout my services, gateways and domain objects, to my current situation in which all references to Transfer are in my gateways, thereby encapsulating access to my persistence layer. Just thought that you might want to consider that point of view in addition to those already discussed. Cheers, Bob On Mon, Mar 2, 2009 at 6:06 AM, John Whish <[email protected]> wrote: > I know this is digressing and likely to start an argument, but having read > the links I don't see that DAO and Table Gateway are that different. Both > deal with multiple rows and have select, update and delete the main > difference is that DAO can also create. Row Data Gateway seems to be closer > to how CF developers think of the DAO. > Would you agree with that? > P.S. It's interesting now that I'm really starting to dig into this stuff > how much I have just accepted :) > > > > -- Bob Silverberg www.silverwareconsulting.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
