smwikipedia
smwikipedia

Reputation: 64173

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

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?

Upvotes: 1

Views: 212

Answers (1)

Leom Burke
Leom Burke

Reputation: 8271

Because its in English. Settings implies multiple as does Configuration. A configuration can have multiple properties but a setting is one 'thing'. Configurations would imply a collection of multiple properties. Not a typo just an English language quirk

Upvotes: 10

Related Questions