Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-1769

Refactor code generation of Config object creation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 0.13.0
    • None
    • Core Engine
    • 8
    • 2020 Week 28-30 (from Jul 6)

      The ApplicationConfig class represents a container of all the beans required to configure the Application, but, in fact, the generated version is cluttered with a lot of initialization logic.

      E.g. for every bean that can be injected in one of the subconfigurations (i.e. ProcessConfig, RuleConfig) the “default bean” is always instantiated as private field and stays there for the whole existence of the application even if the injected version is found and preferred over it.

      My suggestion is to:

      1. stop generating ApplicationConfig directly and leave it and its subconfigurations as plain POJOs,
      2. move the initialization logic in a dedicated generated ConfigProducer class that is invoked by the underlying DI framework at the beginning of the execution and doesn’t leave anything behind once they are built.

      Each ApplicationSection could still inject its piece of logic in the main ConfigProducerGenerator, like it is now with ConfigGenerator.

              evacchi Edoardo Vacchi (Inactive)
              alcosta.redhat Alessandro Costa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: