Access Request Collection from model

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:

<cfcomponent ...>
  <cfproperty name="cbRequestService" inject="coldbox:requestService"

  <cffunction name="myMethod" access="public" returntype="void"

    <cfset var modelRC =
instance.cbRequestService.getContext().getCollection() />
    <cfset var qMySettings = modelRC.qGetSettings />



=> Is this a good/"allowed" practice? Any performance/caching/other
issues to be expected? Any other ideas?


If this really necessary to have request-collection in model then you
can do like this in handler
var rc = event.getCollection();
request.rc = rc;
Now RequestCollection is available every where.

Second way is that you can set property coldbox in your model then can
get anything you may like
property name="Coldbox" inject="Coldbox"

In my opinion your model layer should have very minimum dependencies
on ColdBox.