RE: [coldbox:13397] Re: Sub-domains and Coldbox?

If you think about it, the methods in Application.cfc ARE interceptors basically. They are points in the life cycle of a ColdFusion applicaion, session, or request that you can tie into with a simple CF method.

ColdBox interception points are the same thing, but on steriods. There are CB interception points that mimic several of the built-in methods of Application.cfc, and then there are loads more that are specific to the life cycle of a ColdBox application or request. I don’t tend to put any “application” code in my Application.cfc file when I’m using the ColdBox framework. Interceptors are far more powerful, since they can be injected into via WireBox, they have access to the internals of ColdBox automatically such as a logger and plugins, and the request collection. You can also implement custom interception points for a given app such as “orderCreated”. ColdBox interceptors can be easier turned on/off or configured per environment through the ColdBox config. Interceptors can also be chained together in an order you specify if there are multiple things that need to happen at a specific point in an application and have features such as a shared stringBuffer object they can append to if you have multiple interception points in a single interceptor that are related.

So, will onRequestStart and preProcess both give you the ability to run some code at the start of an page request? Yes, but a preProcess interceptor is far more tightly integrated to your application and much more flexible.


That helps a lot. Thanks for taking the time to chime in…