Liquid-Application-Framework-1.0-deprecated icon indicating copy to clipboard operation
Liquid-Application-Framework-1.0-deprecated copied to clipboard

Use ASP.NET configuration patterns

Open bruno-brant opened this issue 4 years ago • 1 comments

Liquid has a custom way of obtaining configurations. It has many issues:

It's accessed statically by client classes

This means tight coupling between configuration and the client class, which makes it hard to test those classes or use it on different scenarios.

It depends on storing IConfiguration that is read during Startup

Liquid uses a call during startup to store the IConfiguration in the Workbench class, instead of relying on configuration providers. Also, this means that while the configuration is accessed by a static class called LiquidConfiguration, it's data resides elsewhere, so potentially clients could access it directly (bad).

It doesn't provide a way to react to value change

IOptionsMonitor help us to react to configurations change. LiquidConfiguration doesn't.


I do agree that the options pattern from ASP.NET isn't the best solution out there, maybe we could make a more approachable solution, like automatically registering options parameters.

bruno-brant avatar Nov 21 '19 22:11 bruno-brant

I just realized that this may be a bit untrue - there are typed configurations, but they aren't leveraging .NET configuration classes.

bruno-brant avatar Dec 11 '19 00:12 bruno-brant