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

Patterns and Origins: The SueetieApplication Class

This is a new Sueetie Developer Resources document on the SueetieApplication Class. SueetieApplication provides application context for the current location of the user while they’re traversing through a multi-application Sueetie Community. I realized I needed to implement SueetieApplication for the new activity logging and reporting that will be coming in Gummy Bear 1.2.

__________________

It's all about Context

When you are bringing intelligence and additional functionality to an application like Sueetie which consists of several discreet web applications that run independent of one another, it's important to know where you are at the moment—in which application, the type of application we're in, and other context-related issues, like if we're in a group. Context.

Patterns: Current Application

The Current Sueetie Application object is called with SueetieApplications.Current. Below is an example of using SueetieApplications.Current when saving a wiki document to the Sueetie data core content area for community display outside of the wiki. With Intellisense you can see many of the SueetieApplications.Current properties. (The single application object is SueetieApplication.)

Image

One of the reasons for creating the SueetieApplications model was to implement smarter caching through better context awareness. For instance, when a user updates his or her site avatar, the change in the SueetieUser object is updated in the current application, but on another application with its own cache of the SueetieUser object, no change is reflected in the user's avatar. Through comparing SueetieApplications.Current with another property of the SueetieApplications class, SueetieApplications.Prior we can flush the SueetieUser object and update object properties when changed in another Sueetie application.

Below is [a teeny-tiny screenshot, sorry, of] the data supporting the Sueetie Application object (sueetie_vw_applications.) SueetieApplications uses a Get().All object to retrieve a List for processing current and prior application context.

Image

Determining the Current Application

The current Sueetie Application object is based on location, specifically, the path of the current Url. This is obtained through URI Segments[] in SueetieApplications as shown here. One additional aspect of this logic is determining if the current application is part of a group. That is performed through comparing the second URI segment element with the site configurable groups designation. For instance, at sueetie.com the designation for groups is "groups," as in http://sueetie.com/groups/demo/blog.  Also, in our URI Segments[] definition terminology, in the example url, “demo” would serve as the “groupkey” value.

Image

Origins: SueetieApplications

We covered the structure of BlogEngine.NET objects with Get() and Load() elsewhere.  The same is used for the SueetieApplications class. Beyond that, because the structure of Sueetie communities are currently fixed as http://domain/[appkey] and http://domain/[groupdesignate]/[groupkey]/[appkey], URI Segment Elements and Linq did the rest.

Managing Application Objects and Futures

At the time of this writing there is no Administrative Application Management function where new applications and groups can be added, removed or deactivated. That is, of course, planned. Other methods will be added to the SueetieApplications class, including obtaining property information for a given application in the form of

SueetieApplications.Application(string appkey);

and a variety of overrides.

Comments (0) | Post RSS RSS comment feed

Posted on 1/9/2010 7:50:09 PM by Dave Burke
Categories: Sueetie
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke