|
|
|
|
|
by eropple
2053 days ago
|
|
And then you realize that it's 2020 and you don't want configuration files, you want environment variables. Or, now that you've hardstuck yourself on environment variables and built all this stuff around them to set and re-set them properly between tests (now running either in multi-process, which good luck in most environments, or are just running in serial), you're using k8s and the voluming of secrets rather than exposing them as environment variables requires refactoring any code, both operational and testing, that touches them. "But wait," you say. "I'll just pass in the thing that provides that data"--and you just reinvented DI, albeit likely poorly. DI is the removal of complication when it is done correctly. (I have no opinion on whether ASP.NET Core does it correctly.) |
|
I do, it was done in a really weird way and I don't care for the provided DI Abstractions nor the 'Microsoft.Extensions.Configuration' namespace.
To take the 'common' object used for configuration, the nuget package for IOptions<T> requires pulling in Microsoft's DI Abstraction..
That's the first sign of a smell. Config and DI can go hand in hand, but they should still be orthogonal.
The further you go down the DI stack, the more you can see that it's an abstraction has a lot of tradeoffs for front-line devs in the name of using the same abstraction for the underlying framework.