Object Scopes
You can very easily add persistence to your model+ objects via our annotations or binder configuration. The available scopes are:
  • transient or no scope : The default scope. Meaning objects have no scope, they are recreated every single time you request them.
  • singleton : Objects are created once and live until your Application expires
  • cachebox : You can store your objects in any CacheBox provider and even provide timeouts for them
  • session : Store them in the ColdFusion session scope
  • server : Store them in the ColdFusion server scope
  • request : Store them in the ColdFusion request scope
  • application : Store them in the ColdFusion application scope
  • CUSTOM : You can build your own scopes as well.
1
// transient
2
component name="MyService"{}
3
4
// singleton
5
component name="MyService" singleton{}
6
7
// cache in default provider
8
component name="MyService" cache="true" cacheTimeout="45" cacheLastAccessTimeout="15"{}
9
10
// cache in another provider
11
component name="MyService" cachebox="MyProvider" cacheTimeout="45"{}
12
13
// request scope
14
component name="MyService" scope="request"{}
15
16
// session
17
component name="MyService" scope="session"{}
Copied!
Hint Pease note that using annotations is optional, you can configure every object in our configuration binder as well.
Copy link
Edit on GitHub