Configuring child application thoughts

I am working on an Elixir application that I’d like to package up as a Hex dependency. As part of that, it will take some simple configuration options (module names of the parent application to be monitored, etc.). My question is - for these configuration options what would you consider when deciding how to load the configuration?

Idea 1: I am looking at passing in the options - along with my application module - as a child in the Application.start/2 callback.

Idea 2: Don’t start the application via the Application.start/2 callback and instead load the configuration options via the config/config|prod|dev.exs files.

What things would you consider when choosing between the two?

I ran into this old thread and saw there were no responses.

For posterity, there is terrific guidance in the anti-pattern guides in the Elixir documentation.

Cheers :clinking_beer_mugs:

1 Like