Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As others have stated, you can use AppSettings to store simple data. The basics are easy; going beyond them is hard (see <a href="http://devlicio.us/blogs/derik_whittaker/archive/2006/11/13/app-config-and-custom-configuration-sections.aspx" rel="nofollow noreferrer">App.Config and Custom Configuration Sections</a>). You can also serialize classes to XML or <a href="http://www.codeplex.com/Json" rel="nofollow noreferrer">JSON</a>, write custom storage formats, use databases, etc.</p> <p>Making the configuration available throughout your application is a separate issue. Static classes and Singletons are inherently difficult to <a href="http://en.wikipedia.org/wiki/Unit_testing" rel="nofollow noreferrer">test</a>, and introduce <a href="http://en.wikipedia.org/wiki/Coupling_%28computer_science%29" rel="nofollow noreferrer">coupling</a> throughout your other classes. One option is to create an interface for your configuration data class, create and load the configuration on startup, then pass the <strong>interface</strong> to any class that needs it (often as a constructor parameter). This is called <a href="http://en.wikipedia.org/wiki/Dependency_injection" rel="nofollow noreferrer">Dependency Injection</a>.</p> <p>If you're doing this a lot, there are libraries that will make it easier (after you get past the learning curve). See <a href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx" rel="nofollow noreferrer">List of .NET Dependency Injection Containers (IOC)</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload