Just another general observation not directly related to the topic at
hand...you're (re)creating a instance of your DAO and Gateway each
time you call getCategoryList/getCategoryDetail. It's probably more
efficient to create those objects in your configure method and then
just reference the instance, i.e.,


<cffunction name="configure" access="public" output="false"
returntype="void">
   // ...assuming DSN is a property in your configuration file.
    <cfset variables.categoryDAO = createObject("component",
"model.categoryDAO").init(DSN = getProperty("DSN")) />
    ....same for categoryGateway
 </cffunction>


 <!--- Gets detail on a single Category --->
    <cffunction name="getCategoryDetail" access="public"
output="false" returntype="category">
       <cfargument name="event" type="MachII.framework.Event"
required="true" />
       <cfset var category = createObject("component",
"model.category").init( arguments.event.getArg("whichcategory") ) />
        <cfset variables.categoryDAO.read(Category) />
        <cfreturn category />
    </cffunction>
</cfcomponent>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to Mach-II for CFML list.
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/mach-ii-for-coldfusion?hl=en
SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/
Wiki / Documentation / Tickets: 
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/
-~----------~----~----~----~------~----~------~--~---

Reply via email to