1

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.

Robin Green
  • 32,079
  • 16
  • 104
  • 187
Ustaman Sangat
  • 1,505
  • 1
  • 14
  • 26
  • We found a way to declare modules as traits and then merge them whereby they would resolve any interdependencies by mixing in. However I can't mix in traits using reflection, can I? – Ustaman Sangat Feb 16 '12 at 16:03
  • By the way, the "can I?" part above is rhetorical. – Ustaman Sangat Mar 07 '12 at 23:14
  • You might want to try Sindi instead of SubCut. It can handle dependencies between binding modules; whether it would work with reflection I'm not sure, though. – Robin Green May 12 '12 at 14:51

1 Answers1

0

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.

Robin Green
  • 32,079
  • 16
  • 104
  • 187