My best attempt at a skeleton gateway for your TrimaDAO... <cfcomponent name="TrimaGateway">
<cffunction name="init" returntype="any"> <cfset variables.trimaMachines = ArrayNew(1)> </cffunction> <cffunction name="getAllTrimaMachines" returntype="array"> <cfquery name="q_allTrimaMachines"> select all of your trima machines </cfquery> <cfscript> for ( i=1; i lte q_allTrimaMachines; i=i+1 ) { trimaBean = createobject("component", "com.bloodsource.trimaBean"); trimaBean.setID( q_allTrimaMachines['id'][i] ); trimaBean.setSerialNumber( q_allTrimaMachines['serialNumber'][i] ); trimaBean.setInService( q_allTrimaMachines['inService'][i] ); trimaBean.setOutService( q_allTrimaMachines['outService'][i] ); ArrayAppend(variables.trimaMachines, trimaBean); } <cfscript> <cfreturn variables.trimaMachines> </cffunction> </cfcomponent> Master Page --------------------------- <cfset TrimaGateway = createObject("component", "com.bloodsource.TrimaGateway").init()> <cfset allMachines = TrimaGateway.getAllTrimaMachines()> // Now loop through the array of trimaBeans and output the data you need -----Original Message----- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 17, 2006 3:32 PM To: CF-Talk Subject: RE: OOD/Design Patterns and ColdFusion. If your not going to use a gateway Object, I would put a method in your DAO to return a query for the master list. You could then create a bean and populate it though each record or just output the query. I tend to do a bit of both so I guess my apps are more OOish the straight OO. If your going to use a gateway CFC, the gateway holds all the methods the would return more than one row, as these cannot be returned to the caller in a bean. Ok, sounds good. Can someone explain a little more on what a Gateway would be; what its purpose, a basic pseudo code example of how one might be constructed and used? Or a good link to a resource that would help with this? I've heard of Gateways many times in my reading, but have yet to see a clear example of one. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240831 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54