Hi folks,
I have a question about modules and code duplication. I'm also new to Dagger.
What are your best practices for avoiding code duplication in Dagger modules, especially when dealing with configurations that are reused across multiple modules?
I created a module for an internal CLI application used in my company. This CLI requires many configurations. To use the CLI, I pass all configurations via the arguments of a method. Most of these configurations come from environment variables or secrets defined in a Vault.
Using our CLI requires calling this method with many parameters, which leads to code duplication in modules that use this CLI. Currently, it's difficult to maintain the code. I tried using inheritance, but it doesn't work well with Dagger when we need to call an inherited class in a different module.
How do you deal with this kind of situation? Is there a way to create a base module that other modules can extend without duplicating the configuration code?