Skip to content

faq 100171809

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

I have the RunXxxExample class, but how I create my own variant with this guice stuff?

by Kai Nagel on 2016-12-11 09:45:12




Comments: 1


Re: I have the RunXxxExample class, but how I create my own variant with this guice stuff?

by Kai Nagel on 2016-12-11 09:51:56

Typically, there is some syntax of type

controler.addOverridingModule(new XxxModule()) ;

Then what you can do is

  1. make a local copy of RunXxxExample.java, say to MyRunXxxExample.java
  2. make a local copy of XxxModule.java, say to MyXxxModule.java
  3. replace, in MyRunXxxExample, the above overridingModule line to

    controler.addOverridingModule(new MyXxxModule());
    
  4. And finally adapt MyXxxModule to your needs.

In that sense, the pre-existing {{XxxModule}} classes are default versions that typically allow configuration from the config file.  And the RunXxxExample classes are default executables around those default modules.

The most extreme case is ControlerDefaultsModule, made executable by the Controler class.

Clone this wiki locally