Convention over Configuration
Our programs need to be configured. Some of these configurations are things such as connection strings to a database or a URL for a REST API we are calling. These might change depending on the different environments our code is running in (e.g. development, testing, or production). On top of this, we often have to configure our code to be able to run as we expect. The type of configuration we do is often dictated by some third-party library or framework we’re using. In growing solutions, this type of configuration tends to also grow, and since configuration is often done at a specific point during the startup of the program, it’s not uncommon to end up with large files acting as dumping grounds for this type of thing.
In this chapter, we will look into how we can leverage the power of the metadata we already have in running code to make code automatically configure itself and become more consistent as a result.
We will cover the following...