<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
  <channel>
    <title>RiskFactor</title>
    <description>My.Brain.Dump()</description>
    <link>http://blogs.riskotech.com/riskfactor/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.5.0.7</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://blogs.riskotech.com/riskfactor/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://blogs.riskotech.com/riskfactor/syndication.axd</blogChannel:blink>
    <dc:creator>David Risko</dc:creator>
    <dc:title>RiskFactor</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Riskfactor" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Growing as a Developer</title>
      <description>&lt;p&gt;I was reflecting recently on my own growth as a developer over the last several years.&amp;nbsp; There are two factors in my own development that I identified as playing a significant and indispensible role.&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #008080; font-size: small;"&gt;&lt;strong&gt;Partners-In-Crime&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I have been privileged over the last couple of years to work with other developers that have spurred me on to new heights in software development.&amp;nbsp; There has been a mutual give and take of discoveries and lessons learned.&amp;nbsp; There has even been a friendly sense of competition in challenging one another to keep learning and growing.&amp;nbsp; Unfortunately two of the most influential developers during this time aren&amp;rsquo;t as big a part of my professional carrier as they once were.&amp;nbsp; One has moved on to a new company and &lt;a href="http://christopherdeweese.com/"&gt;the other&lt;/a&gt; is in the process of transitioning to another company.&lt;/p&gt;
&lt;p&gt;I can&amp;rsquo;t emphasize enough the importance of having these types of peers.&amp;nbsp; More over, it is highly important that you and they see the process of learning and growing as something to be shared.&amp;nbsp; We all know, or have known, those types of developers that, for one reason or another, lock themselves into a citadel of their own knowledge and refuse to help others grow and thereby restrict their own growth.&amp;nbsp; I am opposed to this type of mentality and believe that we should all strive to challenge each other to grow &lt;span style="text-decoration: underline;"&gt;and to help each other do so&lt;/span&gt;.&amp;nbsp; It is one thing to tell another developer where she needs to grow, it is another to play an active role in helping them to grow.&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #008080; font-size: small;"&gt;&lt;strong&gt;Pages that Turned Me&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In addition to my friends, there have been several books that opened whole new concepts and areas of growth for me.&amp;nbsp; Below are four books that have enlightened, taught and challenged me.&amp;nbsp; There have been others, but these were among the first that pointed me in a new direction and helped me to &amp;ldquo;turn over a new leaf&amp;rdquo; as a developer.&amp;nbsp; I would encourage anyone that hasn&amp;rsquo;t discovered these books to seriously consider making them a part of your library.&lt;/p&gt;
&lt;p&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" src="http://www.microsoft.com/Learning/Images/Books/Imgt/9780735619678F.gif" alt="Code Complete, Second Edition" align="left" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1254333728&amp;amp;sr=1-1" target="_blank"&gt;Code Complete: A Practical Handbook of Software Construction&lt;/a&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: Steve McConnell&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img style="display: inline; margin-left: 0px; margin-right: 0px" src="http://www.microsoft.com/MSPress/books/imgt/770.gif" border="0" alt="" width="130" height="130" align="left" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.amazon.com/Rapid-Development-Taming-Software-Schedules/dp/1556159005/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1254334008&amp;amp;sr=1-1" target="_blank"&gt;Rapid Development: Taming Wild Software Schedules&lt;/a&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: Steve McConnell&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" src="http://martinfowler.com/refactoringBook.gif" alt="Cover Picture" align="left" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1254334605&amp;amp;sr=1-1" target="_blank"&gt;Refactoring: Improving the Design of Existing Code&lt;/a&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: Martin Fowler&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" src="http://www.informit.com/ShowCover.aspx?isbn=0201633612" alt="" width="109" height="136" align="left" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1254334688&amp;amp;sr=1-1" target="_blank"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authors: Gamma, Helm, Johnson and Vlissides&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Growing-as-a-Developer.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Growing-as-a-Developer.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=b67be226-09ba-4f48-8f9e-993b03780054</guid>
      <pubDate>Thu, 01 Oct 2009 08:00:00 -0600</pubDate>
      <category>Leadership</category>
      <category>Personal Growth</category>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=b67be226-09ba-4f48-8f9e-993b03780054</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=b67be226-09ba-4f48-8f9e-993b03780054</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Growing-as-a-Developer.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=b67be226-09ba-4f48-8f9e-993b03780054</wfw:commentRss>
    </item>
    <item>
      <title>Expression Encoder 3 Screen Capture Application</title>
      <description>&lt;p&gt;Lately I have been involved in a couple of projects that have kept me busy and not given me much time to work with Silverlight and WPF so I haven’t been keeping up on the progress of the Expression 3 products release.&amp;#160; Yesterday I was browsing my MSDN subscription for a download and noticed that Expression Studio 3 RTM was on the site for download.&amp;#160; What was even more interesting was that the full studio was available under my VS 2008 Professional MSDN subscription.&amp;#160; Previously only Expression Blend and Expression Web were available.&amp;#160; So, I immediately started the 252 MB download to check it out.&lt;/p&gt;  &lt;p&gt;I haven’t had the opportunity to go through the whole Studio but one of the cool things I noticed right away is the new Expression Encoder 3 Screen Capture application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.riskotech.com/riskfactor/image.axd?picture=image.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://blogs.riskotech.com/riskfactor/image.axd?picture=image_thumb.png" width="244" height="50" /&gt;&lt;/a&gt;Most of us have used screen capture tools and this particular application is very similar to others.&amp;#160; It can capture the standard screen and mouse movements as well as web cam video and audio.&amp;#160; What is unique is that you can then take the captured footage and directly import it into Expression Encoder with a single click.&amp;#160; From inside Encoder you can then encode the video into a number of previously supported formats such as WMV, or into new formats such as H.264 including both Standard Def. and High Def. qualities.&amp;#160; It also has preset encoding options that allow you to target: Silverlight (IIS Smooth Streaming, etc.), devices (Windows Mobile, Zune, Zune HD, XBOX 360, iPhone, etc.), and online services (YouTube HD/SD, Facebook, Vimeo HD). This is a cool little application and compliments the full Encoder 3 application very well.&lt;/p&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Expression-Encoder-3-Screen-Capture-Application.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Expression-Encoder-3-Screen-Capture-Application.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=307e3d17-914b-4653-8e14-7c1f0fce8f42</guid>
      <pubDate>Tue, 22 Sep 2009 10:25:29 -0600</pubDate>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=307e3d17-914b-4653-8e14-7c1f0fce8f42</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=307e3d17-914b-4653-8e14-7c1f0fce8f42</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Expression-Encoder-3-Screen-Capture-Application.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=307e3d17-914b-4653-8e14-7c1f0fce8f42</wfw:commentRss>
    </item>
    <item>
      <title>Know Thyself; Know Thy Team</title>
      <description>&lt;p&gt;One of the most enjoyable aspects of being a Project Architect/Lead, and one which can sometimes be the source of frustration, is being part of a development team.&amp;nbsp; Any developer that has been part of a team knows that the production of a quality piece of software is affected by numerous factors, not the least of which is team dynamics. Part of being a leader in a team is not only understanding yourself, but also understanding the people on your team and the overall personality and dynamics of the team given the current members.&lt;/p&gt;
&lt;p&gt;One of the tools that has been significant in helping me to understand myself, my strengths and weaknesses, has been the Jung/Myers-Briggs personality assessment.&amp;nbsp; (For those who have never heard of this before you can check it out &lt;a href="http://en.wikipedia.org/wiki/Myers-Briggs_Type_Indicator" target="_blank"&gt;here&lt;/a&gt; and take a quick online assessment &lt;a href="http://www.humanmetrics.com/cgi-win/JTypes2.asp" target="_blank"&gt;here&lt;/a&gt;to find out what your personality type is.)&amp;nbsp; It has shed light on some of my own behaviors as well as helped me to identify those areas that I struggle with and why I struggle to change in those areas.&amp;nbsp; As an INFP I have never felt a high level of excitement over administrative tasks.&amp;nbsp; That does not mean that I can&amp;rsquo;t develop adequate administrative skills, it just means that I am not going to develop a sense of fulfillment for that type of work nor will it be something that energizes me.&amp;nbsp; However, as an INFP I am a die hard idealist.&amp;nbsp; I love to discuss, expound and implement best practices in my software, but have also had to learn to inject myself with a good dose of realism on certain projects.&lt;/p&gt;
&lt;p&gt;Understanding the personality types is beneficial in team dynamics and is two fold.&amp;nbsp; First you need to understand the personalities of each individual on your team. This is necessary so that you can better help them to develop in those areas where they are weak and also, to ensure that the majority of their time is spent on areas that are in alignment with their personality. This helps to ensure that they are energized by their work instead of drained by it.&amp;nbsp; As a general rule you want to make sure that the members of your team are working about 60-70% of the time in positions or on tasks that line up with their personality type.&lt;/p&gt;
&lt;p&gt;For example, you will find that there are some personality types that are less likely to deviate from previously used practices and tend to work within those practices with great satisfaction, efficiency and high productivity.&amp;nbsp; This type of team member is a great &amp;ldquo;work horse&amp;rdquo; that can get a lot of work done as long as the parameters are defined for them and the direction is clear.&amp;nbsp; On the other hand, this is generally not the type of personality that you want to put on a task that requires a high level of creativity and thinking outside of the box.&amp;nbsp; Not that they can&amp;rsquo;t ever do that, but they will tend to not be as satisfied and energized by that work if it takes up the majority of their time.&lt;/p&gt;
&lt;p&gt;Secondly, you not only need to understand the individual personalities on your team, but you also need to understand the overall personality of you team.&amp;nbsp; If you have a large number of Introverts on your team then you may need to focus more explicitly on communication within your team and with the other stake holders on your project.&amp;nbsp; If you have a high level of personality types with Judging as a strength you may find your team struggles to improvise under certain circumstances.&amp;nbsp; Ideally the analysis of your team should help you to adjust the makeup of your team (if possible) so that it is well balanced.&lt;/p&gt;
&lt;p&gt;With this in mind here are a couple of questions to think about:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Does a persons personality type affect their predisposition to a particular methodology for the Software Development Lifecycle? &lt;/li&gt;
&lt;li&gt;How does the overall personality of your team affect your teams success with a given SDL methodology? &lt;/li&gt;
&lt;/ol&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Know-Thyself3b-Know-Thy-Team.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Know-Thyself3b-Know-Thy-Team.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=9be8032d-807b-47af-8339-23208dca3e71</guid>
      <pubDate>Thu, 06 Aug 2009 14:10:00 -0600</pubDate>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=9be8032d-807b-47af-8339-23208dca3e71</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=9be8032d-807b-47af-8339-23208dca3e71</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Know-Thyself3b-Know-Thy-Team.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=9be8032d-807b-47af-8339-23208dca3e71</wfw:commentRss>
    </item>
    <item>
      <title>Managing Session Variables in ASP.NET using a Proxy – Part 2</title>
      <description>&lt;p&gt;In my &lt;a href="http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy.aspx"&gt;last post&lt;/a&gt;&amp;nbsp;I gave an example of using the Proxy Design Pattern to manage your ASP.NET Session.&amp;nbsp; In this post I wanted to refine that proxy class through some refactoring and add some additional functionality to it that remove Session variables and also allow us to use the proxy to clear or abandon the Session as a whole.&amp;nbsp;We will&amp;nbsp;also create a mechanism for grouping Session variables into related objects in the SessionProxy.&lt;/p&gt;
&lt;p&gt;First I want to add a private property that will allow me to eliminate some of the verbosity in my code.&amp;nbsp; I&amp;rsquo;ll add a private static property that encapsulates the current HTTPSessionState object.&amp;nbsp; We can then use that property to refactor our other properties so they are more readable.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; HttpSessionState Session { get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; HttpContext.Current.Session; } }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Next we&amp;rsquo;ll add some code into our properties that will check for the value being set and remove the Session variable from the Session object if necessary.&amp;nbsp; As an example I&amp;rsquo;ll use a new Property of type String.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; String CategoryName&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;    get &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;    {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Session[CATEGORYNAME] == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; String.Empty; }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (String)Session[CATEGORYNAME];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;    }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;    set &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;    {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (String.IsNullOrEmpty(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)) { Session.Remove(CATEGORYNAME); }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; { Session[CATEGORYNAME] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;; }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;    }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now I want to add a few methods to allow me to use the SessionProxy to Clear the current Session or Abandon it.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Methods&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Clear() { Session.Clear(); }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;      &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Abandon() { Session.Abandon(); }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;      &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;At this point I feel that I have a pretty good proxy class that allows me to leverage my ASP.NET Session in a strongly type manner and to easily see what I am storing in the Session and what their types are.&lt;/p&gt;
&lt;p&gt;However, in using this solution in a production application I have found that my list of properties has grown longer than I would like. There were close to two dozen at last count and all the Session variables have not been migrated to use the proxy.&amp;nbsp; I found myself increasingly tired of seeing all those properties each time I accessed the class.&amp;nbsp; On top of that some of the names were getting rather long in an effort to give them meaningful names.&amp;nbsp; To resolve this I implemented several properties on the SessionProxy that were child proxy objects.&amp;nbsp; To make things a bit easier I created a base class called SessionProxyChildProxyBase.&amp;nbsp; Here&amp;rsquo;s the code in full for that base class.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.SessionState;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;abstract&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SessionProxyChildProxyBase&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Properties&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; HttpSessionState Session { get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; HttpContext.Current.Session; } }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You will note a few points on this class.&amp;nbsp; Unlike the SessionProxy class the SessionProxyChildProxyBase class is an abstract class.&amp;nbsp; We don&amp;rsquo;t want to allow others to implement this base class outside of our library so that the SessionProxy class now becomes a proxy for this class as well as for the ASP.NET Session.&amp;nbsp; It also contains a protected Session property that will facilitate a decrease in code verbosity.&lt;/p&gt;
&lt;p&gt;Now we will leverage this base class and create derived classes that will contain related properties.&amp;nbsp; In your application you may provide a central location for entering search criteria but you pass those criteria via the Session to a page that actually displays the search results.&amp;nbsp; Let&amp;rsquo;s create a child proxy class to organize the various values being passed.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SearchSessionProxy: SessionProxyChildProxyBase&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Fields&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; String SEARCHTEXT = &lt;span style="color: #006080"&gt;"SearchText"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; String SEARCHTYPENAME = &lt;span style="color: #006080"&gt;"SearchTypeName"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;   &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Properties &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; String Text&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;   {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;      get&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;      {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Session[SEARCHTEXT] == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; String.Empty; }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (String)Session[SEARCHTEXT];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;      }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;      set&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;      {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (String.IsNullOrEmpty(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)) { Session.Remove(SEARCHTEXT); }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; { Session[SEARCHTEXT] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;; }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;      }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;   }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; String TypeName&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;   {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;      get&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;      {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Session[SEARCHTYPENAME] == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; String.Empty; }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (String)Session[SEARCHTYPENAME];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;      }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;      set&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;      {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (String.IsNullOrEmpty(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)) { Session.Remove(SEARCHTYPENAME); }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; { Session[SEARCHTYPENAME] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;; }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  45:&lt;/span&gt;      }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  46:&lt;/span&gt;   }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  47:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  48:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  49:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  50:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Constructors&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  51:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  52:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; SearchSessionProxy() { }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  53:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  54:&lt;/span&gt;   &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  55:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  56:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now we need to add some code to our SessionProxy class to leverage this new class.&amp;nbsp; The first task is to add a private static field of type SearchSessionProxy.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Fields&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; SearchSessionProxy _searchProxy = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SearchSessionProxy();&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Next we will create the property to access the field.&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; SearchSessionProxy Search { get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; _searchProxy; } }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And that&amp;rsquo;s it!&amp;nbsp; Now we call utilize our SessionProxy with our new child proxy classes for organization and grouping so that we can doing something like this in our web app code&amp;hellip;&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DoSomething() &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;  SessionProxy.Search.Text = &lt;span style="color: #006080"&gt;"Search Text entered by user"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;  SessionProxy.Search.TypeName = &lt;span style="color: #006080"&gt;"Product Search"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;  SessionProxy.ProductID = 0;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;  Response.Redirect(&lt;span style="color: #006080"&gt;"SearchResults.aspx"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy-e28093-Part-2.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy-e28093-Part-2.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=753bc45a-f7a9-4f94-955d-10e663c471ca</guid>
      <pubDate>Wed, 05 Aug 2009 15:54:00 -0600</pubDate>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=753bc45a-f7a9-4f94-955d-10e663c471ca</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=753bc45a-f7a9-4f94-955d-10e663c471ca</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy-e28093-Part-2.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=753bc45a-f7a9-4f94-955d-10e663c471ca</wfw:commentRss>
    </item>
    <item>
      <title>Managing Session Variables in ASP.NET using a Proxy</title>
      <description>&lt;p&gt;Every developer who has ever worked with ASP.NET in a large solution knows how quickly Session variables can get out of control.&amp;nbsp; From the lack of strongly typed references to the potential misspellings of the variable names, the problems are always with us.&amp;nbsp; The good news is that there is a better way to handle objects in the Session.&amp;nbsp; The key is to develop a proxy class that will provide a set of strongly typed properties to store and retrieve objects in the HTTPSessionState object.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1248205766&amp;amp;sr=1-1" target="_blank"&gt;Gang of Four&lt;/a&gt; defines the Proxy Structural Pattern as an object that serves to &amp;ldquo;Provide a surrogate or placeholder for another object to control access to it.&amp;rdquo;&amp;nbsp; A proxy is a fantastic way to provide abstraction in any application and will allow us to create a method for leveraging an ASP.NET Session object in a powerful way.&lt;/p&gt;
&lt;p&gt;To begin with let&amp;rsquo;s create a static class (or NotInheritable in VB.NET) called SessionProxy.&amp;nbsp; The code will look something like this:&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SessionProxy&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;    {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;       &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Properties&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; OrderID { &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;          get&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)HttpContext.Current.Session[&lt;span style="color: #006080"&gt;"OrderID"&lt;/span&gt;];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;          set&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;             HttpContext.Current.Session[&lt;span style="color: #006080"&gt;"OrderID"&lt;/span&gt;] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;       }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;public static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ProductID &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;       {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;          get &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)HttpContext.Current.Session[&lt;span style="color: #006080"&gt;"ProductID"&lt;/span&gt;];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;          set&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;             HttpContext.Current.Session[&lt;span style="color: #006080"&gt;"ProductID"&lt;/span&gt;] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;       }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;       &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You will notice in this initial code that we are typing the Session variable keys multiple times in each property definition.&amp;nbsp; Although this is a workable solution we still open ourselves up to the possibility of mis-spelling the two instances of the key.&amp;nbsp; So, let&amp;rsquo;s refactor our class a bit&amp;hellip;&lt;/p&gt;
&lt;div&gt;
&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SessionProxy&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;    {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;       &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Constants&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ORDERID = &lt;span style="color: #006080"&gt;"OrderID"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; PRODUCTID = &lt;span style="color: #006080"&gt;"ProductID"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;       &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;       &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Properties&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; OrderID { &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;          get&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)HttpContext.Current.Session[ORDERID];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;          set&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;             HttpContext.Current.Session[ORDERID] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;       }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ProductID &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;       {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;          get &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)HttpContext.Current.Session[PRODUCTID];&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;          set&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;          {&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;             HttpContext.Current.Session[PRODUCTID] = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;          }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;       }&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;       &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;To utilize this in your code simply add a reference to the namespace where&amp;nbsp;the SessionProxy exists and get or set the property through the&amp;nbsp;class (ie. SessionProxy.ProductID = 123;).&lt;/p&gt;
&lt;p&gt;Now we have a method for accessing our Session in a strongly typed manner and we are also able to see exactly what variable we have defined in our ASP.NET application by simply looking at the class definition of our SessionProxy.&lt;/p&gt;
&lt;p&gt;Another advantage of using a proxy class like this is that it allows you to abstract your storage method as well.&amp;nbsp; If you want to use SQL Server Session or use a shared Session technology across multiple servers, all you need to do is change the property getter and setter logic and the rest of your application remains completely unchanged.&lt;/p&gt;
&lt;p&gt;In &lt;a href="http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy-e28093-Part-2.aspx"&gt;Part 2&lt;/a&gt; we will explore some enhancements to the SessionProxy.&lt;/p&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=5c0f66f7-216b-49e1-bbbc-ce5e0c59e1ed</guid>
      <pubDate>Tue, 21 Jul 2009 14:51:00 -0600</pubDate>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=5c0f66f7-216b-49e1-bbbc-ce5e0c59e1ed</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=5c0f66f7-216b-49e1-bbbc-ce5e0c59e1ed</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Managing-Session-Variables-in-ASPNET-using-a-Proxy.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=5c0f66f7-216b-49e1-bbbc-ce5e0c59e1ed</wfw:commentRss>
    </item>
    <item>
      <title>New Collaboration Tool</title>
      <description>&lt;p&gt;I have worked at several companies now that have used a number of different tools for online demos and collaboration such as &lt;a href="http://try.webex.com/meet/sem/web_conferencing2.htm" target="_blank"&gt;WebEx&lt;/a&gt; and &lt;a href="http://www.gotomeeting.com" target="_blank"&gt;GoToMeeting&lt;/a&gt;.&amp;nbsp; Microsoft has now introduced a new product that provides the same functionality but is completely free!&amp;nbsp; The new product is called &lt;a href="http://connect.microsoft.com/site/sitehome.aspx?SiteID=94" target="_blank"&gt;Microsoft SharedView&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;SharedView, like the other brand collaboration tools, requires a small download and installation. When you open the program it places a menu bar at the top of the desktop that provides access to the application features. This new tools allows up to 15 members in a given session and provides for application specific sharing or full screen sharing.&amp;nbsp; The session host must have a valid Windows Live Account (Hotmail and Microsoft Passport accounts work as well) to start a session.&amp;nbsp; However, the other participants do not need to have an account.&amp;nbsp; Once the session is started the other participants simply enter the user id of the session host and the password for the session that is generated when the session is initiated.&lt;/p&gt; &lt;p&gt;One of the more interesting features the SharedView provides is the presence of multiple mouse cursors on the screen labeled with the name of the participant that is represents.&amp;nbsp; This is a great feature that allows the other users to be able to point to areas on the screen without having full control of the shared application.&lt;/p&gt; &lt;p&gt;If your looking for a great free product for real-time collaboration I really encourage you to check out Microsoft SharedView.&lt;/p&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/New-Collaboration-Tool.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/New-Collaboration-Tool.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=a1eb7e46-b483-41d0-94a8-950ddda5e6e8</guid>
      <pubDate>Fri, 29 May 2009 17:47:00 -0600</pubDate>
      <category>Collaboration</category>
      <category>Tips &amp; Tricks</category>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=a1eb7e46-b483-41d0-94a8-950ddda5e6e8</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=a1eb7e46-b483-41d0-94a8-950ddda5e6e8</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/New-Collaboration-Tool.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=a1eb7e46-b483-41d0-94a8-950ddda5e6e8</wfw:commentRss>
    </item>
    <item>
      <title>Accidental Singletons in Collection-Type Dependency Property</title>
      <description>&lt;P&gt;Dependency Properties are a unique and powerful feature of WPF/Silverlight though they are normally transparent to you and you will, for the most part, not worry about them.&amp;nbsp; However, there are times when creating a Custom Dependency property will be the precise solution to your problem.&amp;nbsp; Sometimes you will need to create a dependency property that is a collection-type.&amp;nbsp; Now there is a very important point that you need to watch when creating a dependency property of this type, and that is the unintended creation of a singleton value.&lt;/P&gt;
&lt;P&gt;Let’s see how this works and how you can resolve the issue.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(Insert here the obligatory creation of a temporary Silverlight application.)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;After creating my temp application I created two classes.&amp;nbsp; The first is a person class.&amp;nbsp; The second is a Family classes that exposes a Members property that is backed by a dependency property and is of the type List&amp;lt;Person&amp;gt;.&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Net;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Controls;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Documents;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Ink;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Input;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Media;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Media.Animation;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows.Shapes;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Collections.ObjectModel;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Collections.Generic;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;namespace&lt;/SPAN&gt; SilverlightApplication1&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;class&lt;/SPAN&gt; Family    : DependencyObject&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  17:  &lt;/SPAN&gt;    {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  18:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;static&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;readonly&lt;/SPAN&gt; DependencyProperty MembersProperty = DependencyProperty.Register(&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  19:  &lt;/SPAN&gt;            &lt;SPAN class=str&gt;"Bars"&lt;/SPAN&gt;,&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  20:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;typeof&lt;/SPAN&gt;(List&amp;lt;Person&amp;gt;),&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  21:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;typeof&lt;/SPAN&gt;(Family),&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  22:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; PropertyMetadata(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; List&amp;lt;Person&amp;gt;()));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  23:  &lt;/SPAN&gt;        &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  24:  &lt;/SPAN&gt;        &lt;SPAN class=preproc&gt;#region&lt;/SPAN&gt; Properties&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  25:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  26:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; List&amp;lt;Person&amp;gt; Members&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  27:  &lt;/SPAN&gt;        {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  28:  &lt;/SPAN&gt;            get { &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; (List&amp;lt;Person&amp;gt;)GetValue(MembersProperty); }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  29:  &lt;/SPAN&gt;            set { SetValue(MembersProperty, &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;); }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  30:  &lt;/SPAN&gt;        }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  31:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  32:  &lt;/SPAN&gt;        &lt;SPAN class=preproc&gt;#endregion&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  33:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  34:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  35:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  36:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;class&lt;/SPAN&gt; Person&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  37:  &lt;/SPAN&gt;    {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  38:  &lt;/SPAN&gt;        &lt;SPAN class=preproc&gt;#region&lt;/SPAN&gt; Properties&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  39:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  40:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; FirstName { get; set; }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  41:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; LastName { get; set; }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  42:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  43:  &lt;/SPAN&gt;        &lt;SPAN class=preproc&gt;#endregion&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  44:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  45:  &lt;/SPAN&gt;        &lt;SPAN class=preproc&gt;#region&lt;/SPAN&gt; Constructors&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  46:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  47:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; Person(&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; firstName, &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; lastName) &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  48:  &lt;/SPAN&gt;        {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  49:  &lt;/SPAN&gt;            FirstName = firstName;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  50:  &lt;/SPAN&gt;            LastName = lastName;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  51:  &lt;/SPAN&gt;        }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  52:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  53:  &lt;/SPAN&gt;        &lt;SPAN class=preproc&gt;#endregion&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  54:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  55:  &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;/DIV&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the application I created a simple method that creates two family objects and adds 3 members to the first and 2 members to the second.&amp;nbsp; I then populate two variables with the corresponding Count from each of the Member property lists like so.&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;private&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; Button_Click(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; sender, RoutedEventArgs e)&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;    Family fam1 = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Family();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;    fam1.Members.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Person(&lt;SPAN class=str&gt;"David"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Risko"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;    fam1.Members.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Person(&lt;SPAN class=str&gt;"Wife"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Risko"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;    fam1.Members.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Person(&lt;SPAN class=str&gt;"Kid1"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Risko"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;    Family fam2 = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Family();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;    fam2.Members.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Person(&lt;SPAN class=str&gt;"John"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Doe"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;    fam2.Members.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Person(&lt;SPAN class=str&gt;"Jane"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Doe"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;int&lt;/SPAN&gt; fam1Count = fam1.Members.Count();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;int&lt;/SPAN&gt; fam2Count = fam2.Members.Count();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;
&lt;/P&gt;
&lt;P&gt;After placing a breakpoint at line 16 I investigated our two count variables.&amp;nbsp; As you can see from the screenshot below we get an unexpected result where both Family objects show that they have 5 members each.&amp;nbsp; Our code clearly adds 3 members to the first family and 2 to the second, so how is this happening?&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.riskotech.com/riskfactor/content/binary/WindowsLiveWriter/DependencyPropertiesareStaticandIdontmea_EEC5/AccidentalSingleton1_2.jpg"&gt;&lt;IMG title=AccidentalSingleton1 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=218 alt=AccidentalSingleton1 src="http://blogs.riskotech.com/riskfactor/content/binary/WindowsLiveWriter/DependencyPropertiesareStaticandIdontmea_EEC5/AccidentalSingleton1_thumb.jpg" width=717 border=0&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The key to this is that we have defined a default value for our dependency property in the PropertyMetadata object when we called the Register method (line 22 in first code block).&amp;nbsp; Our Member list is a reference type and so therefore the default value set in the PropertyMetadata is not a default value per Family instance but rather is is the default value for all instances of our Family.&amp;nbsp; This is not the functionality that we are going to want in the vast majority of situations.&amp;nbsp; We need an instance specific list backing our Members property and fortunately there is a straight forward solution.&amp;nbsp; The key is to set your property to a new instance of its type in your constructor.&amp;nbsp; Here is the new code for my Family class constructor that accomplishes this.&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=preproc&gt;#region&lt;/SPAN&gt; Constructors&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; Family() : &lt;SPAN class=kwrd&gt;base&lt;/SPAN&gt;()&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;    Members = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; List&amp;lt;Person&amp;gt;();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;&lt;SPAN class=preproc&gt;#endregion&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;
&lt;/P&gt;
&lt;P&gt;Now when we run our application we get the following values in our count variables:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.riskotech.com/riskfactor/content/binary/WindowsLiveWriter/DependencyPropertiesareStaticandIdontmea_EEC5/AccidentalSingleton2_2.jpg"&gt;&lt;IMG title=AccidentalSingleton2 style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=218 alt=AccidentalSingleton2 src="http://blogs.riskotech.com/riskfactor/content/binary/WindowsLiveWriter/DependencyPropertiesareStaticandIdontmea_EEC5/AccidentalSingleton2_thumb.jpg" width=716 border=0&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;As you can see by simply re-initializing our dependency property value in our constructor we get the per instance functionality that we want and need.&lt;/P&gt;
&lt;P&gt;Now when your out creating those custom dependency properties for collection-typed values you won’t get caught off guard.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;NOTE: After typing this post I found the &lt;/EM&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/aa970563.aspx" target=_blank&gt;&lt;EM&gt;reference documentation on MSDN&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt; that actually covers this from a WPF perspective.&amp;nbsp; The resolution in WPF is slightly different but still applicable.&lt;/EM&gt;&lt;/P&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Accidental-Singletons-in-Collection-Type-Dependency-Property.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Accidental-Singletons-in-Collection-Type-Dependency-Property.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=687df900-99b5-4836-aa88-8af013a21efd</guid>
      <pubDate>Thu, 26 Mar 2009 12:00:00 -0600</pubDate>
      <category>.NET</category>
      <category>Dependency Property</category>
      <category>Silverlight</category>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=687df900-99b5-4836-aa88-8af013a21efd</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=687df900-99b5-4836-aa88-8af013a21efd</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Accidental-Singletons-in-Collection-Type-Dependency-Property.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=687df900-99b5-4836-aa88-8af013a21efd</wfw:commentRss>
    </item>
    <item>
      <title>The Shadow Knows! – The finer Nuisances of the VisualBasic.NET Shadows Keyword</title>
      <description>&lt;p&gt;I suspect that most people don&amp;rsquo;t often use the Shadows keyword.&amp;nbsp; I happened to be using it to develop a custom control because the base class I was inheriting from does not declare one of its properties as Overridable.&amp;nbsp; My control was inheriting from a StackPanel in Silverlight.&amp;nbsp; I wanted to limit the type of controls that could be placed inside of my control so I shadowed the StackPanel.Children property, which is of type List(Of UIElement), with a Children property of type List(Of &lt;em&gt;CustomType&lt;/em&gt;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Initially that seemed to work.&amp;nbsp; It compiled without error or warning so I thought I was good to go.&amp;nbsp; Then the UI came up and I realized that things were not what they seemed to be.&amp;nbsp; The objects that I defined in my XAML for test were showing up, but none of the objects I added programmatically were.&amp;nbsp; Further more, the collection that was behind my custom property only contained the objects I added programmatically while the property on my StackPanel base contained the items I had defined in XAML.&amp;nbsp; WHAT?!&amp;nbsp; How is that?&lt;/p&gt;
&lt;p&gt;The difference is in how Shadows works and how the Silverlight runtime was viewing my custom type.&amp;nbsp; When you shadow a property/method, the original property/method is hidden when your object is viewed as your custom type.&amp;nbsp; However, if your object, which is of your custom type, is cast to the type of the base class then the base class property becomes visible and is the one that gets accessed.&amp;nbsp; Let me explain with an example.&lt;/p&gt;
&lt;p&gt;I have created three classes. Class A is the base class which B derives from A, and class C derives from class B. Like so&amp;hellip;&lt;/p&gt;
&lt;div&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="COLOR: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Class&lt;/span&gt; A
    &lt;span style="COLOR: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt; FirstName() &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;String&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #006080"&gt;"A"&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt;

    &lt;span style="COLOR: #0000ff"&gt;Overridable&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt; Lastname() &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;String&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #006080"&gt;"1"&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt;
&lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; Class&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="COLOR: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Class&lt;/span&gt; B
    &lt;span style="COLOR: #0000ff"&gt;Inherits&lt;/span&gt; A

    &lt;span style="COLOR: #0000ff"&gt;Shadows&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt; FirstName() &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;String&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #006080"&gt;"B"&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt;

    &lt;span style="COLOR: #0000ff"&gt;Overrides&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt; Lastname() &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;String&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #006080"&gt;"2"&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt;
&lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; Class&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="COLOR: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Class&lt;/span&gt; C
    &lt;span style="COLOR: #0000ff"&gt;Inherits&lt;/span&gt; B

    &lt;span style="COLOR: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt; FirstName() &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;String&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #006080"&gt;"C"&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt;

    &lt;span style="COLOR: #0000ff"&gt;Overrides&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt; Lastname() &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;String&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;Return&lt;/span&gt; &lt;span style="COLOR: #006080"&gt;"3"&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Get&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;Property&lt;/span&gt;
&lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; Class&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;You will notice that the Firstname property on Class A is not declared as Overridable.&amp;nbsp; This means that to replace it&amp;rsquo;s functionality I must declare it as Shadows in my derived class B.&amp;nbsp; I have purposefully left out the Shadows keyword in Class C to show that VisualBasic.NET implicitly Shadows any properties/methods in the derived class if the name matches the name of a property/method in the base class.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Now, here is a quick code snippet for a console app that will demonstrate this nuisance of Shadowing.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;p&gt;&lt;span style="COLOR: #0000ff"&gt;Sub&lt;/span&gt; Main()
    &lt;span style="COLOR: #0000ff"&gt;Dim&lt;/span&gt; cClass &lt;span style="COLOR: #0000ff"&gt;As&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;New&lt;/span&gt; C

    Console.WriteLine(&lt;span style="COLOR: #006080"&gt;"Typed as C: FirstName {0}, Lastname {1}"&lt;/span&gt;, cClass.FirstName, cClass.Lastname)
    &lt;span style="COLOR: #008000"&gt;'Typed as C: FirstName C, Lastname 3&lt;/span&gt;

    Console.WriteLine(&lt;span style="COLOR: #006080"&gt;"Typed as B: FirstName {0}, Lastname {1}"&lt;/span&gt;, &lt;span style="COLOR: #0000ff"&gt;CType&lt;/span&gt;(cClass, B).FirstName, _&lt;br /&gt;&amp;nbsp;                     &lt;span style="COLOR: #0000ff"&gt;CType&lt;/span&gt;(cClass, B).Lastname)
    &lt;span style="COLOR: #008000"&gt;'Typed as B: FirstName B, Lastname 3&lt;/span&gt;

    Console.WriteLine(&lt;span style="COLOR: #006080"&gt;"Typed as A: FirstName {0}, Lastname {1}"&lt;/span&gt;, &lt;span style="COLOR: #0000ff"&gt;CType&lt;/span&gt;(cClass, A).FirstName, _&lt;br /&gt;                      &lt;span style="COLOR: #0000ff"&gt;CType&lt;/span&gt;(cClass, A).Lastname)
    &lt;span style="COLOR: #008000"&gt;'Typed as A: FirstName A, Lastname 3&lt;/span&gt;

    Console.ReadKey()

&lt;span style="COLOR: #0000ff"&gt;End&lt;/span&gt; Sub&lt;/p&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Notice how the value that is returned for Firstname is the value corresponding to the type by which my object is being accessed.&amp;nbsp; This correlates to my Silverlight example.&amp;nbsp; When I was adding items to my custom object programatically&amp;nbsp;I was referencing it as the same type of which it is.&amp;nbsp; However, when the Silverlight run time was building the UIElement tree it was accessing my item as its base type so the items were added to the base type property, not my custom Shadows property.&lt;/p&gt;
&lt;p&gt;So, when it comes to Shadowing, you will want to be aware that referencing your classes as the base type will expose the base types functionality and not the Shadowed functionality.&lt;/p&gt;
&lt;p&gt;Fortunately Overrides works differently so that the functionality declared as Overrides on the most derived class will always be run and not the functionality of the base class(es). To verify this try removing the Overrides keyword from Class C.&amp;nbsp; Now the functionality that is declared as Overrides in Class B will always be accessed for the Lastname property.&amp;nbsp; You should get the following output to your console.&lt;/p&gt;
&lt;div&gt;
&lt;pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;Typed as C: FirstName C, Lastname 3
Typed as B: FirstName B, Lastname 2
Typed as A: FirstName A, Lastname 2&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hopefully you have found this quick excursion into the finer points of Shadowing helpful and the next time you use Shadows you&amp;rsquo;ll know what to expect from your derived classes.&lt;/p&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/The-Shadow-Knows!-e28093-The-finer-Nuisances-of-the-VisualBasicNET-Shadows-Keyword.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/The-Shadow-Knows!-e28093-The-finer-Nuisances-of-the-VisualBasicNET-Shadows-Keyword.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=df1cb771-f0b9-4ef2-8d08-7139711eb231</guid>
      <pubDate>Mon, 16 Mar 2009 15:22:00 -0600</pubDate>
      <category>.NET</category>
      <category>VisualBasic.NET</category>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=df1cb771-f0b9-4ef2-8d08-7139711eb231</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=df1cb771-f0b9-4ef2-8d08-7139711eb231</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/The-Shadow-Knows!-e28093-The-finer-Nuisances-of-the-VisualBasicNET-Shadows-Keyword.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=df1cb771-f0b9-4ef2-8d08-7139711eb231</wfw:commentRss>
    </item>
    <item>
      <title>Focus on LOB’s in Silverlight 3</title>
      <description>&lt;P&gt;I know there are developers out there looking at Silverlight thinking that it’s just another media delivery platform and that Microsoft is just trying to gain market share over Adobe in this area. However, the truth, I am convinced, is much different.&amp;nbsp; The overlooked aspect of Silverlight that will make the biggest impact in the Rich Internet Application space is the support for Line-of-Business applications to be developed in Silverlight.&lt;/P&gt;
&lt;P&gt;This past Monday &lt;A href="http://channel9.msdn.com/shows/The+Knowledge+Chamber/" target=_blank&gt;The Knowledge Chamber&lt;/A&gt; posted an &lt;A href="http://channel9.msdn.com/shows/The+Knowledge+Chamber/Brad-Abrams-Silverlight-30-for-Great-Business-Apps/" target=_blank&gt;interview&lt;/A&gt; with &lt;A href="http://blogs.msdn.com/brada/default.aspx" target=_blank&gt;Brad Abrams&lt;/A&gt; on Channel 9 in which Brad gives us a few teasers about the LOB support being added to Silverlight 3.0.&amp;nbsp; In the interview Brad shows us the new project template for a Silverlight project that gives a default design to your Silverlight application and that design will apparently be swappable for other default designs. There is also a short preview of new datagrid features and a new details view control.&amp;nbsp; He also highlights the new “Deep Link” feature that allows you to access specific places in your Silverlight application via a URI.&amp;nbsp; The only down part is that we have to wait until &lt;A href="http://2009.visitmix.com/" target=_blank&gt;MIX09&lt;/A&gt; to see the full feature set, but luckily that’s only another week!&lt;/P&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/Focus-on-LOBe28099s-in-Silverlight-3.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/Focus-on-LOBe28099s-in-Silverlight-3.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=69f6ed4a-e48d-42d0-ba7c-b76398758182</guid>
      <pubDate>Thu, 12 Mar 2009 10:07:00 -0600</pubDate>
      <category>.NET</category>
      <category>Silverlight</category>
      <category>Silverlight 3</category>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=69f6ed4a-e48d-42d0-ba7c-b76398758182</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=69f6ed4a-e48d-42d0-ba7c-b76398758182</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/Focus-on-LOBe28099s-in-Silverlight-3.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=69f6ed4a-e48d-42d0-ba7c-b76398758182</wfw:commentRss>
    </item>
    <item>
      <title>No Custom Dependency Property Value Inheritance in Silverlight 2</title>
      <description>&lt;P&gt;So I have this cool custom control I am working on in SL2. I was hoping to utilize a custom dependency property that could inherit it’s value from a property on a parent object.&amp;nbsp; But alas, Microsoft has not provided an easy way to implement custom dependency property value inheritance per this &lt;A href="http://silverlight.net/forums/t/35358.aspx" target=_blank&gt;post&lt;/A&gt;.&amp;nbsp; It appears that they created a select few dependency properties that would do &lt;A href="http://martinkruszynski.blogspot.com/2008/11/silverlight-value-inheritance.html" target=_blank&gt;this&lt;/A&gt;, but due to performance issues they haven’t opened this up to the rest of us yet.&lt;/P&gt;</description>
      <link>http://blogs.riskotech.com/riskfactor/post/No-Custom-Dependency-Property-Value-Inheritance-in-Silverlight-2.aspx</link>
      <author>David</author>
      <comments>http://blogs.riskotech.com/riskfactor/post/No-Custom-Dependency-Property-Value-Inheritance-in-Silverlight-2.aspx#comment</comments>
      <guid>http://blogs.riskotech.com/riskfactor/post.aspx?id=34153810-8051-47d3-8e24-d7a4e3050bde</guid>
      <pubDate>Thu, 05 Mar 2009 11:43:00 -0600</pubDate>
      <category>Dependency Property</category>
      <category>Silverlight</category>
      <category>Silverlight 2</category>
      <dc:publisher>David</dc:publisher>
      <pingback:server>http://blogs.riskotech.com/riskfactor/pingback.axd</pingback:server>
      <pingback:target>http://blogs.riskotech.com/riskfactor/post.aspx?id=34153810-8051-47d3-8e24-d7a4e3050bde</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.riskotech.com/riskfactor/trackback.axd?id=34153810-8051-47d3-8e24-d7a4e3050bde</trackback:ping>
      <wfw:comment>http://blogs.riskotech.com/riskfactor/post/No-Custom-Dependency-Property-Value-Inheritance-in-Silverlight-2.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.riskotech.com/riskfactor/syndication.axd?post=34153810-8051-47d3-8e24-d7a4e3050bde</wfw:commentRss>
    </item>
  </channel>
</rss>
