Java init script instead of complex configuration templating
Jun 22, 2023
Just adopt convention that:
- if there is Start.java in workdir — load and run via Scripting language subsystem
- - if not — run the default, compiled domain.package.DefaultStart class
- - Start has single abstract method — call and implements Callable<Injector>
- - Configuration is interface that allows to instantiate various Modules and is basically a DI container interface
To prevent abuse it’s advised to run lint on Start.java files and prevent usage of reflection and any packages outside of some of java.util.* and org.domain.Injector.