Applying Interface Segregation to Configuration Files
In .NET, it’s very easy to set up custom configuration section handlers to handle your application or component’s configuration needs. As my previous post shows, it’s also very easy to configure these with attributes that enforce required fields and other validation. However, over time it’s very easy to create fairly large configuration sections that violate the Interface Segregation Principle, which states that classes shouldn’t be forced to depend on things they don’t need. Consider this relatively simple configuration section: <configSections> <section name="ConfigurationSettings" type="InterfaceSegregation.Configuration1.ConfigurationSettings, … more