I am creating a CFC called "core_appdata". This CFC will hold the core stored procedures for an application. Example....
<cfcomponent displayname="core_appdata" hint="I Return Core App Data" output="no">
<cffunction name="getprogram_list">
<cfargument name="getstoredproc_input_campaignid" type="string" required="false">
<cfargument name="getstoredproc_input_filtertestrecs" type="string" required="false">
<cfargument name="getstoredproc_input_startdate" type="date" required="false">
<cfargument name="getstoredproc_input_enddate" type="date" required="false">
<cfargument name="getstoredproc_input_listtypeid" type="string" required="false">
<cfargument name="getstoredproc_input_listid" type="string" required="false">
<cfargument name="getstoredproc_input_appenvr" type="string" required="false">
<cfset var rst_getprogram_list ="">
--- stored proc ---
<cfstoredproc procedure = "p_adb_getprogram_list">
</cfstoredproc>
<cfreturn rst_getprogram_list />
</cffunction>
</cfcomponent>
I would also like to create a CFC called "core_appdata_grids". This CFC would be used to bind to cfgrids and allow paging etc. In a perfect world, this CFC would get its data from the method/function "getprogram_list" in the CFC "core_appdata" above. Example...
<cfcomponent displayname="core_appdata_grids" hint="I Return Core App Data For CFGrids " output="no">
<cffunction name="getprogram_list_grid">
<cfargument name="page" required="no" />
<cfargument name="pageSize" required="no" />
<cfargument name="gridsortcolumn" required="no" />
<cfargument name="gridsortdirection" required="no" />
<cfargument name="getstoredproc_input_campaignid" type="string" required="false">
<cfargument name="getstoredproc_input_filtertestrecs" type="string" required="false">
<cfargument name="getstoredproc_input_startdate" type="date" required="false">
<cfargument name="getstoredproc_input_enddate" type="date" required="false">
<cfargument name="getstoredproc_input_listtypeid" type="string" required="false">
<cfargument name="getstoredproc_input_listid" type="string" required="false">
<cfargument name="getstoredproc_input_appenvr" type="string" required="false">
<cfset var rst_getprogram_list_grid ="">
--- get data ---
<cfreturn queryconvertforgrid(rst_getprogram_list_grid, page, pagesize) />
</cffunction>
</cfcomponent>
Questions:
- Is this possible? If so, how is it done?
- If so, is this best practice when working with CFCs?
- If not, what is the best way to share data between CFCs
Thank you in advance for your time in helping me with this question.
OC