mixinafIoc::ServiceBinder
afIoc::ServiceBinder
Use in your AppModule.bind(ServiceBinder binder) {...}
method. It's how you tell IoC about your services. If your service implementation is fronted by a mixin, then pass them both in:
class AppModule { static Void bind(ServiceBinder binder) { binder.bind(MyService#, MyServiceImpl#) } }
If your service is just an impl class then you can use the shorter form:
class AppModule { static Void bind(ServiceBinder binder) { binder.bind(MyServiceImpl#) } }
You can also use the shorter form, passing in the mixin, if your Impl class has the same name as your mixin + "Impl".
The default service id is the unqualified name of the service mixin (or impl if no mixin was provided).
This is an adaptation of ideas from Guice.