[m6] Best practices & Autowire/DI Confusion

I’m still very unclear about how to properly use DI within Coldbox.

I have a need to connect to an external http service to get data for use in my app. Where is the best place to create the interface for this? I have currently created a cfc /model/services/GoogleService.cfc. Does this seem like the best approach?

Now that I have this service? How do I autowire it into a handler for use?

Is there a way to indicate the type so that I can use CFBuilder’s autocomplete?


You may want to look at many of the sample apps. As they work and use DI properly, they may be good example to learn from.

  • Gabriel