Glimpse / Glimpse.Prototype

Glimpse v2 prototype
MIT License
185 stars 44 forks source link

Configuration Settings #3

Closed avanderhoorn closed 9 years ago

avanderhoorn commented 9 years ago

Design:

Inspiration for this design is based on the supported configuration system for DNXRE and how MVC utilizes this.

Use Case

Implementation

Examples

State The Application Model is a model that might not be needed by provides a unified view of the complete discovery process.

Guidelines:

Server Web:

CGijbels commented 9 years ago

@avanderhoorn I've worked on a branch regarding the code configuration for Glimpse. It is already functional and fully backward compatible with the current glimpse configurations, it allows for configuration to be defined externally (database, server, custom config files, ...) and provides out of the box a provider based on xml configuration file as this is how users configured glimpse up until now. Adding another default to deal with json configs etc... is just a small step...

I definitely am going to take a look at what you described above, maybe things can be mapped, maybe not...

I didn't make a PR yet of that branch, as I wanted to finish it further to make sure I didn't overlook things, but then I had to take a little break on my work :-(

Have a look at the branch to get an idea about how it works, and I can always give a quick guide over Skype or so if you want too

avanderhoorn commented 9 years ago

@CGijbels more than happy to talk it over and see what we can do. My main thinking here is that the config/options in vNext is very different to what it was with classic ASP.Net. I know that we (mainly you) put a huge amount of effort into the config system in the old v2 code base, but with the advent of vNext and how different it is, I'm not sure what else we can do. For instance the next version of MVC is built solely on the base support, web.config doesn't exist, code configurations are preferred over json/environment/etc configurations (particularly when it comes to complex cases, type based black/white listing, etc), dependency injection which is at the core of vNext is a fairly fundamental part of vNext, etc, etc. When looking at this I struggled to see how what we did would natively/cleanly come across. Any ideas?

CGijbels commented 9 years ago

web.config doesn't exist, code configurations are preferred over json/environment/etc configurations (particularly when it comes to complex cases, type based black/white listing, etc)

the configuration has been built to allow any kind of source for the configuration settings to start with, after which configuration to code can be added as well. So for vNext it might be enough to implement the IConfigurationSettingsProvider although the hook for that lies in setting the provider to use, through the config, as you can see in the (ConfigurationFactory)[https://github.com/Glimpse/Glimpse/blob/glimpse-configuration-system-refactoring/source/Glimpse.Core/Configuration/ConfigurationFactory.cs] class. Now on the other hand, by specifying a IConfigurationSettingsProvider in a ConfigurationFactory.Create overload might be enough, as that Create method is called by the hosting environment (ASP.Net, OWIN Middleware (see here ,...)

So as long as the hook into the new MVC provides an IConfigurationSettingsProvider to the ConfigurationFactory all should be good to go, and that IConfigurationSettingsProvider can be quite basic as well because code configuration then happens on the resulting ConfigurationSettings

Just wondering, but even with the advent of ASP.NET vNext etc... we only need to provide the hooks into the runtime and maybe other plugins, but we still share the Glimpse Core? Or is the idea to have 2 Glimpse Core's maintained next to each other? Because the majority of users will still be using ASP.NET vCurrent for the upcoming year(s)...