Dependency injection is the art of making work come home to you. Dhanji R. Prasanna
injectwhich can contain a value, this value is called the Injection DSL. This basically tells WireBox what alias to inject into the component. The value of the injection DSL can mean different things to WireBox depending on the environment, registered custom dsl's and so much more. However, at the end of the day, it means, inject something here!!
inject="UserService"will look for an object with that alias if it doesn't find it with the alias, it treats is like a CFC path and tries to create, inject and return that object.
@myservice.injectannotation for the constructor argument tells WireBox to look for the
MyAwesomeServiceand pass it as the argument. Again, the colon is the separator of choice for DSLs.
NOSCOPE: Transient objects
PROTOTYPE: Transient objects
SINGLETON: Objects constructed only once and stored in the injector
SESSION: ColdFusion session scoped based objects
APPLICATION: ColdFusion application scope based objects
REQUEST: ColdFusion request scope based objects
SERVER: ColdFusion server scope based objects
CACHEBOX: CacheBox scoped objects
getInstance()and you can see the signature below: