Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Patterns and Origins: Sueetie SiteSettings

This was a Sueetie Documentation Saturday!  It was a gorgeous day in Vermont with fresh snow on the ground, clear blue skies and sunshine.  I probably should have gone skiing, but as a freelancer I can go any day of the week to avoid the weekend crowds. Instead I published several new documents in the Sueetie Wiki describing some of the framework classes I haven’t yet documented and new features coming in Gummy Bear 1.2. I’ll blog a couple of the new documents tonight and the remaining ones tomorrow.

Below is a new Developer Resources document describing the Sueetie SiteSettings object  Site Setting properties are items like Community Name, Site Contact Email Address, and Registration type that are set in the Administration area and stored in SQL Server as opposed to SueetieConfiguration properties and objects which are stored and described in the Sueetie.config file.

____________________

Sueetie Site Settings: Patterns

The architecture of Sueetie Site Settings is pretty straightforward: property names and their corresponding values. The pattern was largely based on BlogEngine.NET's smart and simple approach to storing application settings as we'll see in Origins below. The best way to demonstrate the use of the Sueetie SiteSettings class is how it's used on the Administrative General Site Settings page.

Image

On the back end we're retrieving the properties with SiteSettings.Instance.[propertyname].

Image

Unlike BlogEngine.NET's handling of blog application settings where all properties are rewritten to file storage or sql in bulk, Sueetie updates properties individually.

Image

There's also a cache clearing method we want to use whenever we update the site settings object.

SueetieCommon.ClearSiteSettingsCache();

Sueetie Site Settings: Origins

As I mentioned earlier, the Sueetie Site Settings model was based on BlogEngine.NET's BlogSettings object, instantiated with a Get() / Instance property.

Image

Like BlogEngine.NET, Sueetie Site Settings are loaded from a StringDictionary collection, with each dictionary key compared with the PropertyInfo elements of the SiteSetting properties: SiteName, ContactEmail, RegistrationType and so on.

Image

Below is a screenshot of how properties are stored in SQL Server

Image

Comments (0) | Post RSS RSS comment feed

Posted on 1/9/2010 7:09:30 PM by Dave Burke
Categories: Sueetie
Tags: no tags for this post

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke