Let's assume the following:
In my OnRequestStart-Handler, I'm doing the following:
<cfset var rc = Event.getCollection() />
<cfset rc.qGetSettings = instance.miscService.getSettings() />
This will store different settings in a query called rc.qGetSettings.
Now - in some methods of my models I have to get values out of this
rc.qGetSettings-Query, but I don't want to pass it as an argument
(because there can be situations where a model calls another model,
and then I have to pass and pass again).
I've started to store some values in session variables, but I'm not so
lucky with that way. What's the best practice to access the request
collection from within the model?
I did the following; my model looks like this:
<cfproperty name="cbRequestService" inject="coldbox:requestService"
<cffunction name="myMethod" access="public" returntype="void"
<cfset var modelRC =
<cfset var qMySettings = modelRC.qGetSettings />
=> Is this a good/"allowed" practice? Any performance/caching/other
issues to be expected? Any other ideas?