The options pattern uses classes to provide strongly-typed access to groups of related settings. When configuration settings are isolated by scenario into separate classes, the app adheres to two important software engineering principles:
– The Interface Segregation Principle (ISP) or Encapsulation: Scenarios (classes) that depend on configuration settings depend only on the configuration settings that they use.
– Separation of Concerns: Settings for different parts of the app aren’t dependent or coupled to one another. Options also provide a mechanism to validate configuration data. For more information, see the Options validation section.