Wirebox

WireBox is one of the most powerful entities in the ColdBox world and most of it's work is entirely invisible.

WireBox is the Dependency Injection (DI) engine which works with ColdBox. The Non-Academic description of DI is when a piece of code tells the application what it needs to run and the application handles the instantiation, initialization and other routine aspects and "hands" the needed pieces to the running code to operation.

We started using Wirebox already when we added the property to our handler.

property name="userService" inject="models.userService";

Inject is not standard CFML notation but it has meaning to Wirebox. When ColdBox starts up it scans several folders (such as the models folder) and instantiates a copy into RAM. When a piece of code has an inject notation, Wirebox returns the instantiated object already to go resulting is consistent, reliable and usually more performant operations.

For more information about Wirebox and what you can do with it, check out the documentation page at the end of this book.

Last updated