SubCut BindingModule composition

398 views Asked by At

With SubCut I can define a BindingModule and use modifyBindings to get a new one which can overwrite some bindings and also add new bindings. Is there a utility where instead of saying

val module : BindingModule
val newModule = module.modifBindings(...)

I could instead do something like

val mergedModule = merge(module1,module2,module3,...)

The reason is I am writing an application with "pluggable" jars - each such jar will have a META-INF/bindings.properties file which will expose the class name of its BindingModule. My main entry jar will instantiate those BindingModules via reflection and then combine them.

The idea being that if the pluggable jars follow the convention of providing META-INF/bindings.properties then there is no new configuration needed to deploy the application.

1

There are 1 answers

0
Robin Green On

Yes, just use the ~ operator, as shown in this test case from the SubCut project.

For the case of interdependent modules, please expand your question with more details on how you implemented that.