2

Is it OK to get parameters for different level of system directly from configuration?

I mean specifically coupling every layer with ConfigurationManager in .Net instead of passing parameters by the creator through a constructor or somehow else.

SerG
  • 1,251
  • 4
  • 18
  • 37

1 Answers1

1

In case you need unit tests configuration should be injected. http://www.devtrends.co.uk/blog/configuration-settings-are-a-dependency-that-should-be-injected

And to make users of your class provide all of the parameters in deterministic manner (not guessing just relying on documentation, source code and exceptions). http://www.codeproject.com/Articles/196563/Don-t-use-ConfigurationManager

SerG
  • 1,251
  • 4
  • 18
  • 37