At least in my architecture, gateways are accessible in a lot of places where DAOs aren't. Both types are singletons, but the gateways are retrieved from a globally accessible factory, while DAOs are instantiated and kept within the corresponding bean factory/manager.
Gateways are needed by the service objects, at the very least, and I almost always allow gateways to be accessible from the UI as well, so they're part of the app's API, along with the service objects. It makes the API use more components, but it makes a nice separation between business actions and simple retrieval of recordsets, so I'd say the API ends up easier to use. So two very different types of objects that both happen to have the same purpose (encapsulating data access), with with very different reasons for doing so. And to answer your question, yes, it is worth it, because it keeps the architecture intact, no matter the size of the app. cheers, barneyb On 8/23/05, Peter Hardy <[EMAIL PROTECTED]> wrote: > If you're Gateway only includes a GetById() and a GetAll() method is it > really worth seperating this out into a seperate Gateway component? I > generally just shove it in my Dao and forget about the distinction. I know > it probably comes down to personal preference but do you think this is a bad > habit to get into? > > Cheers, Pete (aka lad4bear) > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
