Please tell me an analog (at least approximately performing the same functions) JNDI in C #.

  • I am pleased to join the question - Barmaley
  • four
    And is it possible in a nutshell for what it is all about? - VladD
  • four
    @VladD configurable services container, from which these services can be obtained through a special type of Uri. Used by JavaEE developers as a way to completely confuse their code, making it inoperable without a special magic config that cannot be changed. - Pavel Mayorov
  • @PavelMayorov: Interpraise? Never encountered this, never knew. Thank! - VladD
  • @PavelMayorov, analog Pimple? Or no? - vp_arth

2 answers 2

There is no direct equivalent to JNDI in C #. An indirect analogue can be considered any IoC container supporting the configuration as an external file, for example, Castle Windsor

Also, many libraries have their own configuration methods, especially system ones.

    I think that System.Uri plays this role in .NET. It includes, in addition to the http and file URIs, a pseudo-URI like ws:// (websocket), ldap:// and others.

    Dynamic addition of new schemes is carried out through UriParser.Register . For example, WPF registers its pack:// scheme, which refers to WPF resources.

    • Can I get a data source object pre-configured by the server administrator from System.Uri from an application server? Or is it otherwise done in .NET? - Sergey Gornostaev
    • one
      @SergeyGornostaev: And what is the application server? - VladD
    • @VladD JNDI is not a particular Uri format, but a configurable object container - Pavel Mayorov
    • @PavelMayorov: Well, I meant rather universal extensible addressing of objects. The “Configurable Container” was in no way clear from the original question (as well as from the text by reference from the question). - VladD
    • @VladD how - incomprehensible? According to the link provided by the author, the item "Search for resources in JNDI, lookup". It clearly shows what JNDI is actually used for. - Pavel Mayorov