Mis-spelling in the .NET configuration system, a design flaw?

Posted by smwikipedia on Stack Overflow See other posts from Stack Overflow or by smwikipedia
Published on 2010-06-11T10:24:25Z Indexed on 2010/06/11 10:32 UTC
Read the original article Hit count: 180

Filed under:
|
|

I just wrote some .NET code to get connection string from the config file. The config file is as below:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <appSettings>
    <add key="key1" value="hello,world!"/>
  </appSettings>

  <connectionStrings>
    <add name="conn1" connectionString="abcd"/>
  </connectionStrings>

</configuration>

.NET Framework provide the following types to get the connection string:

1- ConnectionStringsSection : stands for the config section containing several connection strings

2- ConnectionStringSettingsCollection : stands for the connection string collection

3- ConnectionStringSettings : stands for a certain connection string.

.NET Framework also provide the following types to get the App Settings:

4- AppSettingsSection

5- KeyValueConfigurationCollection

6- KeyValueConfigurationElement

Compare 2 to 5, 3 to 6, why are there extra "s" in ConnectionStringSetting[s]Collection and ConnectionStringSetting[s]?

This mis-spelling is really mis-leading. I think it's a design flaw.

Has anyone noticed that?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET