BoxLang 🚀 A New JVM Dynamic Language Learn More...

ColdBox IOC Integration

v1.1.0 Modules
The ColdBox IOC module allows you to integrate third-party dependency injection
and inversion of control frameworks into your ColdBox Applications.
#INSTRUCTIONS
Just drop into your **modules** folder or use the box-cli to install

`box install cbioc`

The module registers the following mapping in WireBox: `factory@cbioc`
Which abstracts any IoC engine with typical methods like `getBean(), containsBean()`

## Framework support
This module supports out of the box the following DI Engines:

- ColdSpring
- ColdSpring2
- DI/1
- WireBox

## Settings
You will configure the ioc integration via your `Coldbox.cfc` configuration file with an `ioc` structure.

```js
ioc = {
    // The registered name of the IoC engine to use or a class path to the IoC Adapter to use.
    framework         = "",
    // Auto reload the configuration file and engine on each request
    reload             = false,
    // The framework definition file
    definitionFile     = "",
    // If the framework in use supports parent factories, you can register them here.
    parentFactory = {
        framework         = "",
        definitionFile = ""
    }

};
```

## WireBox DSL: IOC
This module registers a WireBox DSL Namespace: `ioc`, so you can leverage autowiring via this namespace in your handlers:

```js
property name="myBean" inject="ioc:beanID";
```

## Mixins
This module also registers a new method: `getBean( beanName )` on all
handlers, interceptors, views/layouts so you can easily retrieve objects from your favorite IoC engine.

$ box install cbioc

No collaborators yet.
 
  • {{ getFullDate("2014-04-30T21:38:59Z") }}
  • {{ getFullDate("2016-06-08T21:59:29Z") }}
  • 4,682
  • 5,230