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

Patterns and Origins: SueetieContext

Below is the first of three new Sueetie Wiki documents describing the contents of the Sueetie.Core class library.  The first for you is Patterns and Origins: SueetieContext.

____________________


The SueetieContext class enhances the HttpContext.Current object to access application objects like CurrentSueetieUser.

SueetieContext - Patterns


SueetieContext is an extension of the HttpContext.Current object handling the current HTTP Request. Below is an screenshot of the SueetieContext Class essentials.


SueetieContext Class Essentials


The SueetieContext is saved to the Page or Control's base class with


return (currentPage.Items"CurrentPageContext" ??
   (currentPage.Items"CurrentPageContext" = new SueetieContext())) 
       as SueetieContext;



The Current SueetieContext with its CurrentSueetieUser and other objects can be accessed directly using SueetieContext.Current.SomeObject() or by referencing the page or control's base class with CurrentPageContext.SomeObject().


SueetieContext - Origins


YetAnotherForum.NET is a very speedy application as you can experience at Sueetie Forums. It contains an extensive number of supporting classes like Context, so this was an opportunity to learn more about YAF.NET design and to pattern the SueetieContext after an application known for its performance.

The approach to saving the context to the CurrentPageContext in the base page and control classes was the approach used in YAF.NET Context and one that makes accessing SueetieContext objects easier and with less typing.

For further reference, the YAF.NET Context class is located in the YAF.Classes.Utils library shown below.


YetAnotherForums.NET Class.Utils Class Library



Sueetie.Core Patterns and Origins Documents:

Comments (0) | Post RSS RSS comment feed

Posted on 3/19/2009 4:41:53 PM by Dave Burke
Categories: Sueetie
Tags: No tags for this post

Related posts

Comments are closed

This site was built with the Sueetie .NET Online Community Framework. Learn more about Sueetie at Sueetie.com.