akkadotnet / HOCON

C# implementation of Lightbend's HOCON (Human-Optimized Object Configuration Notation)
Apache License 2.0
138 stars 39 forks source link

Implement HOCON reference config loading #48

Open Aaronontheweb opened 6 years ago

Aaronontheweb commented 6 years ago

Copy of issue https://github.com/akkadotnet/akka.net/issues/3054


In order to better resolve issues like:

https://github.com/akkadotnet/akka.net/issues/3031 https://github.com/akkadotnet/akka.net/issues/3051

I propose that we do the following:

This is how the JVM does it using the reference.conf files that ship as parts of the JAR files they deliver with each module, loaded via some of the tools in the stand-alone HOCON package: https://github.com/typesafehub/config/blob/master/config/src/main/java/com/typesafe/config/ConfigFactory.java https://github.com/typesafehub/config/blob/master/config/src/main/java/com/typesafe/config/DefaultConfigLoadingStrategy.java#L25

This will avoid many of the issues we have with lots of plugins and forcing the end-user to have to manually include fallbacks for built-in libraries in their bootstrapping code.

Arkatufus commented 5 years ago

The only problem I have with this strategy is that, depending on the platform and build, there is no guarantee where Akka.dll will be located during runtime.

Aaronontheweb commented 5 years ago

yeah, it's definitely going to need to be skunked out via lots of testing.

Arkatufus commented 5 years ago

What do you mean by "topologically sorted way"?

Aaronontheweb commented 5 years ago

Following in the order of its dependencies

I.e. Akka.Cluster --> Akka.remote --> Akka

Sent from my iPhone

On Aug 11, 2019, at 9:55 AM, Gregorius Soedharmo notifications@github.com wrote:

What do you mean by "topologically sorted way"?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Arkatufus commented 5 years ago

Won't that be a problem because each plug-in would have to know all of its dependency ahead of time? And, depending on the dlls found inside the directory, the config loader would have to build the dependency tree during parsing? What about the possibility of a diamond dependency problem? What if 2 plug-ins on the same dependency level uses a common dependency and causes a config override collision?

Aaronontheweb commented 4 years ago

This should probably be an Akka.NET issue, actually. Have a better idea for how to do this with the built-in Akka.NET modules.

Aaronontheweb commented 2 years ago

Another example of where this would have been helpful: https://github.com/akkadotnet/akka.net/issues/5383