Inversion of Control Example
Inversion of Control How is this useful? A usecase is Inversion of Control (IoC). IoC is about injecting an object's depencies transparently. You could define an aspect that intercepted a constructor call, and on the return inject these dependencies into the object. The has operator allows you to do this and this is what the example program does. The example uses the following binding: On any constructor call where the constructor's class has a public setInjectedParameter method, call the DependencyInjectorInterceptor. The DependencyInjectorInterceptor will call the constructed object's setInjectedParameter.