I wrote about the Gateway some time ago ( http://www.remotesynthesis.com/blog/index.cfm/2007/7/18/What-the-Heck-is-a-Gateway-Anyway) and based on looking into it, this is a ColdFusion-specific pattern that appears to have been introduced by the Mach-II Development Guide that Sean Corfield wrote during his days with Macromedia. I believe the pattern was probably an answer to a ColdFusion specific problem, which was that object instantiation was so expensive as to make arrays of objects generally unusable for performance reasons. Thus, the DAO dealt in objects but the Gateway dealt in queries - generally speaking anyway.
This, to me anyway, seems to explain why we in ColdFusion separated what other languages didn't separate. Creating objects has become less expensive in ColdFusion 8 but its still not anywhere near as performant as queries, so I am not sure that the pattern has entirely outlived its usefulness - plus some of us have just gotten used to separating them based on single object queries from multi-object queries. Is it necessary? No. Nonetheless, I am also of the opinion that there isn't anything wrong with it either...except when users simply create four (or five) CFCs for every object without thinking (i.e. Service, Bean, DAO, Gateway). -- Brian Rinaldi blog - http://www.remotesynthesis.com/blog ColdFusion Open Source List- http://www.remotesynthesis.com/cfopensourcelist Boston CFUG - http://www.bostoncfug.org Adobe Community Expert - http://www.adobe.com/communities/experts/members/brian_rinaldi.html On Mon, Jun 23, 2008 at 8:26 AM, Ronan Lucio <[EMAIL PROTECTED]> wrote: > @Greg, > > Greg Stevens escreveu: > > Regarding 2 - What more common approach where you thinking of? Having > a separate DAO and Gateway? Do you personally separate what goes in > what purely by if it returns or deals with more than 1 record? Perhaps > having the Gateway return objects and talk to the DAO for all the > queries is the way to go? > > > -- Brian Rinaldi blog - http://www.remotesynthesis.com/blog ColdFusion Open Source List- http://www.remotesynthesis.com/cfopensourcelist Boston CFUG - http://www.bostoncfug.org Adobe Community Expert - http://www.adobe.com/communities/experts/members/brian_rinaldi.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
