Hi Jamie,
Default settings are updated from the feature definition file every time you visit the setup page, so if you add new settings they also get created with their defaults when you visit the setup page. Once an instance of a feature is created the instance settings are used, the default settings are only for when creating new instances or when a new setting is added, then the next time you visit the module settings page for the instance it will get the default setting.
Most features now have a FeatureConfiguration class that encapsulates the settings, so typically the defaults are hard coded both in the feature definition and in the FeatureConfiguration so that if the setting has not yet been created for the instance it uses the default value.
For example the Image Gallery has the class GalleryConfiguration.cs
default values are setup like this:
private bool useSlideShow = false;
public bool UseSlideShow
{
get { return useSlideShow; }
}
then in the constructor for the GalleryConfiguration, the hashtable of settings are passed in and if the instance setting exists it replaces the default value
useSlideShow = WebUtils.ParseBoolFromHashtable(settings, "UseSilverlightSlideshow", useSlideShow);
So for most features if we add a new setting then we also update the FeatureConfiguration class
Once a feature has more than a couple of settings this FeatureConfiguration class helps keep things simple and helps us keep the code for parsing the settings out of the hashtable in one location.
So for example in the Gallery.ascx.cs we pass the settings hash table into the constructor of the FeatureConfiguration like this:
config = new GalleryConfiguration(Settings);
then we can just use config.PropertyName to get at the settings and it will always either have the default or the value saved for the instance if the instance has been saved since the new setting was added.
Hope it helps,
Joe