<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Eran Nachum's Blog</title>
    <link>http://www.eranachum.com/</link>
    <description>www.eranachum.com - Implementing &amp; executing my thoughts...</description>
    <language>en-us</language>
    <copyright>Eran Nachum</copyright>
    <lastBuildDate>Mon, 13 Oct 2008 06:57:49 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>eranachum@hotmail.com</managingEditor>
    <webMaster>eranachum@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=6a505002-7b54-4161-a1bc-c6e761dad704</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,6a505002-7b54-4161-a1bc-c6e761dad704.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Mono 2.0 is a portable and open source implementation of the .NET framework for Unix,
      Windows, MacOS and other operating systems. 
   </p>
        <p>
          <strong>What is Mono?<br /></strong>Mono is a software platform designed to allow developers to easily create
      cross platform applications. It is an open source implementation of Microsoft's .Net
      Framework based on the <a title="ECMA" href="http://mono-project.com/ECMA" target="_blank">ECMA</a> standards
      for C# and the Common Language Runtime. 
      <br />
      According to <a href="http://www.novell.com/linux/" target="_blank">Novell</a>: "We
      feel that by embracing a successful, standardized software platform, we can lower
      the barriers to producing great applications for Linux". 
   </p>
        <p>
          <u>The components that make up Mono are:<br /></u>
          <strong>C# Compiler</strong> - The C# compiler is feature complete for compiling
      C# 1.0 and 2.0 (ECMA), and also contains many of the C# 3.0 features. 
      <br /><strong>Mono Runtime</strong> - The runtime implements the ECMA Common Language Infrastructure
      (CLI). The runtime provides a Just-in-Time (JIT) compiler, an Ahead-of-Time compiler
      (AOT), a library loader, the garbage collector, a threading system and interoperability
      functionality. 
      <br /><strong>Base Class Library</strong> - The Mono platform provides a comprehensive set
      of classes that provide a solid foundation to build applications on. These classes
      are compatible with Microsoft's .Net Framework classes. 
      <br /><strong>Mono Class Library</strong> - Mono also provides many classes that go above
      and beyond the Base Class Library provided by Microsoft. These provide additional
      functionality that are useful, especially in building Linux applications. Some examples
      are classes for Gtk+, Zip files, LDAP, OpenGL, Cairo, POSIX, etc. 
   </p>
        <p>
          <u>The benefits are:<br /></u>
          <strong>Popularity</strong> - Built on the success of .Net, there are millions
      of developers that have experience building applications in C#. There are also tens
      of thousands of books, websites, tutorials, and example source code to help with any
      imaginable problem. 
      <br /><strong>Higher-Level Programming</strong> - All Mono languages benefit from many features
      of the runtime, like automatic memory management, reflection, generics, and threading.
      These features allow you to concentrate on writing your application instead of writing
      system infrastructure code. 
      <br /><strong>Base Class Library</strong> - Having a comprehensive class library provides
      thousands of built in classes to increase productivity. Need socket code or a hashtable?
      There's no need to write your own as it's built into the platform. 
      <br /><strong>Cross Platform</strong> - Mono is built to be cross platform. Mono runs on
      Linux, Microsoft Windows, Mac OS X, BSD, and Sun Solaris, Nintendo Wii, Apple iPhone.
      It also runs on x86, x86-64, IA64, PowerPC, SPARC (32), ARM, Alpha, s390, s390x (32
      and 64 bits) and more. Developing your application with Mono allows you to run on
      nearly any computer in existance (details). 
      <br /><strong>Common Language Runtime (CLR)</strong> - The CLR allows you to choose the
      programming language you like best to work with, and it can interoperate with code
      written in any other CLR language. For example, you can write a class in C#, inherit
      from it in VB.Net, and use it in Eiffel. You can choose to write code in Mono in a
      variety of programming languages. 
   </p>
        <p>
      In order to view the Mono 2.0 Release Notes click <a href="http://www.mono-project.com/Release_Notes_Mono_2.0">here</a>.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=6a505002-7b54-4161-a1bc-c6e761dad704" />
      </body>
      <title>Mono 2.0 is out!</title>
      <guid>http://www.eranachum.com/PermaLink,guid,6a505002-7b54-4161-a1bc-c6e761dad704.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,6a505002-7b54-4161-a1bc-c6e761dad704.aspx</link>
      <pubDate>Mon, 13 Oct 2008 06:57:49 GMT</pubDate>
      <description>&lt;p&gt;
   Mono 2.0 is a portable and open source implementation of the .NET framework for Unix,
   Windows, MacOS and other operating systems. 
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;What is Mono?&lt;br&gt;
   &lt;/strong&gt;Mono is a software platform designed to allow developers to easily create
   cross platform applications. It is an open source implementation of Microsoft's .Net
   Framework based on the &lt;a title=ECMA href="http://mono-project.com/ECMA" target=_blank&gt;ECMA&lt;/a&gt; standards
   for C# and the Common Language Runtime. 
   &lt;br&gt;
   According to &lt;a href="http://www.novell.com/linux/" target=_blank&gt;Novell&lt;/a&gt;: "We
   feel that by embracing a successful, standardized software platform, we can lower
   the barriers to producing great applications for Linux". 
&lt;/p&gt;
&lt;p&gt;
   &lt;u&gt;The components that make up Mono are:&lt;br&gt;
   &lt;/u&gt;&lt;strong&gt;C# Compiler&lt;/strong&gt; - The C# compiler is feature complete for compiling
   C# 1.0 and 2.0 (ECMA), and also contains many of the C# 3.0 features. 
   &lt;br&gt;
   &lt;strong&gt;Mono Runtime&lt;/strong&gt; - The runtime implements the ECMA Common Language Infrastructure
   (CLI). The runtime provides a Just-in-Time (JIT) compiler, an Ahead-of-Time compiler
   (AOT), a library loader, the garbage collector, a threading system and interoperability
   functionality. 
   &lt;br&gt;
   &lt;strong&gt;Base Class Library&lt;/strong&gt; - The Mono platform provides a comprehensive set
   of classes that provide a solid foundation to build applications on. These classes
   are compatible with Microsoft's .Net Framework classes. 
   &lt;br&gt;
   &lt;strong&gt;Mono Class Library&lt;/strong&gt; - Mono also provides many classes that go above
   and beyond the Base Class Library provided by Microsoft. These provide additional
   functionality that are useful, especially in building Linux applications. Some examples
   are classes for Gtk+, Zip files, LDAP, OpenGL, Cairo, POSIX, etc. 
&lt;/p&gt;
&lt;p&gt;
   &lt;u&gt;The benefits are:&lt;br&gt;
   &lt;/u&gt;&lt;strong&gt;Popularity&lt;/strong&gt; - Built on the success of .Net, there are millions
   of developers that have experience building applications in C#. There are also tens
   of thousands of books, websites, tutorials, and example source code to help with any
   imaginable problem. 
   &lt;br&gt;
   &lt;strong&gt;Higher-Level Programming&lt;/strong&gt; - All Mono languages benefit from many features
   of the runtime, like automatic memory management, reflection, generics, and threading.
   These features allow you to concentrate on writing your application instead of writing
   system infrastructure code. 
   &lt;br&gt;
   &lt;strong&gt;Base Class Library&lt;/strong&gt; - Having a comprehensive class library provides
   thousands of built in classes to increase productivity. Need socket code or a hashtable?
   There's no need to write your own as it's built into the platform. 
   &lt;br&gt;
   &lt;strong&gt;Cross Platform&lt;/strong&gt; - Mono is built to be cross platform. Mono runs on
   Linux, Microsoft Windows, Mac OS X, BSD, and Sun Solaris, Nintendo Wii, Apple iPhone.
   It also runs on x86, x86-64, IA64, PowerPC, SPARC (32), ARM, Alpha, s390, s390x (32
   and 64 bits) and more. Developing your application with Mono allows you to run on
   nearly any computer in existance (details). 
   &lt;br&gt;
   &lt;strong&gt;Common Language Runtime (CLR)&lt;/strong&gt; - The CLR allows you to choose the
   programming language you like best to work with, and it can interoperate with code
   written in any other CLR language. For example, you can write a class in C#, inherit
   from it in VB.Net, and use it in Eiffel. You can choose to write code in Mono in a
   variety of programming languages. 
&lt;/p&gt;
&lt;p&gt;
   In order to view the Mono 2.0 Release Notes click &lt;a href="http://www.mono-project.com/Release_Notes_Mono_2.0"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=6a505002-7b54-4161-a1bc-c6e761dad704" /&gt;</description>
      <category>C#;Code;Other</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=ca12272e-8f67-44a7-8653-7566787c38e2</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,ca12272e-8f67-44a7-8653-7566787c38e2.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hi,
   </p>
        <p>
      Great post that gathers around 100+ resources that could make the web developer life
      much more easier; code snippets, sites that automate processes, cheat sheets and more
      and more...
   </p>
        <p>
      This priceless list is listed <a href="http://blog-well.com/2008/03/04/100-resources-for-web-developers/" target="_blank">here</a>.
   </p>
        <p>
      BTW, don't become confused from the first image - I also know that this is not a common
      vision in our world of code... ;)
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=ca12272e-8f67-44a7-8653-7566787c38e2" />
      </body>
      <title>Web Developers? 100+ Resources for You!</title>
      <guid>http://www.eranachum.com/PermaLink,guid,ca12272e-8f67-44a7-8653-7566787c38e2.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,ca12272e-8f67-44a7-8653-7566787c38e2.aspx</link>
      <pubDate>Sun, 16 Mar 2008 13:35:27 GMT</pubDate>
      <description>&lt;p&gt;
   Hi,
&lt;/p&gt;
&lt;p&gt;
   Great post that gathers around 100+ resources that could make the web developer life
   much more easier; code snippets, sites that automate processes, cheat sheets and more
   and more...
&lt;/p&gt;
&lt;p&gt;
   This priceless list is listed &lt;a href="http://blog-well.com/2008/03/04/100-resources-for-web-developers/" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
   BTW, don't become confused from the first image - I also know that this is not a common
   vision in our world of code... ;)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=ca12272e-8f67-44a7-8653-7566787c38e2" /&gt;</description>
      <category>Code;Patterns;Web 2.0</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=9fafbb58-dd14-4ab4-beb8-e29999caba1d</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,9fafbb58-dd14-4ab4-beb8-e29999caba1d.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I read a great article about performance and scalability. Some of the issues there
      were helped me a lot and the rest were sharpen my knowledge.
   </p>
        <p>
      So, if you are an ASP.NET developer (beginner or senior), It is recommended for you
      to read that one by <strong>Omar Al Zabir</strong> at the codeproject site <a href="http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx" target="_blank">here</a>. 
   </p>
        <p>
      Some if the things that he talks about are: ASP.NET pipeline optimization, Things
      you must do for ASP.NET before going live, Caching AJAX calls on browse and more...
   </p>
        <p>
      Worth a reading...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=9fafbb58-dd14-4ab4-beb8-e29999caba1d" />
      </body>
      <title>Great Article about ASP.NET Performance and Scalability</title>
      <guid>http://www.eranachum.com/PermaLink,guid,9fafbb58-dd14-4ab4-beb8-e29999caba1d.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,9fafbb58-dd14-4ab4-beb8-e29999caba1d.aspx</link>
      <pubDate>Wed, 06 Feb 2008 15:08:10 GMT</pubDate>
      <description>&lt;p&gt;
   I read a great article about performance and scalability. Some of the issues there
   were helped me a lot and the rest were sharpen my knowledge.
&lt;/p&gt;
&lt;p&gt;
   So, if you are an ASP.NET developer (beginner or senior), It is recommended for you
   to read that one by &lt;strong&gt;Omar Al Zabir&lt;/strong&gt; at the codeproject site &lt;a href="http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx" target="_blank"&gt;here&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
   Some if the things that he talks about are: ASP.NET pipeline optimization, Things
   you must do for ASP.NET before going live, Caching AJAX calls on browse and more...
&lt;/p&gt;
&lt;p&gt;
   Worth a reading...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=9fafbb58-dd14-4ab4-beb8-e29999caba1d" /&gt;</description>
      <category>ASP.NET;Code;Patterns;Web scalability</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=74326fc1-3f3f-4ba8-914f-53057b3178fd</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,74326fc1-3f3f-4ba8-914f-53057b3178fd.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
      Is Google is so kind or what? One more great tool and FREE of course that leashed
      by Google is the Google Chart API. 
   </p>
        <p>
      By their introduction, The Google Chart API returns a PNG-format image in response
      to a URL. Several types of image can be generated: line, bar, and pie charts for example.
      For each image type you can specify attributes such as size, colors, and labels.
   </p>
        <p>
      If you want to generate charts, graphs, pies etc. this is a great tool for you - the
      web developer. This tool gives a good fight to all other charts generator like <a href="http://www.dotnetcharting.com/?gaw" target="_blank">.NET
      Charting</a> for example and other unwanted ActiveXs modules that need to be installed
      on the client (we always want to avoid this action - at least me), because it is FREE
      and also because it is Google.
   </p>
        <p>
      So I already generated myself: 
   </p>
        <blockquote>
          <p>
            <a href="http://www.eranachum.com/content/binary/GoogleChartAPIAnotherGreatThingfromGoogl_A605/chart.png">
              <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="100" alt="chart" src="http://www.eranachum.com/content/binary/GoogleChartAPIAnotherGreatThingfromGoogl_A605/chart_thumb.png" width="244" border="0" />
            </a>
          </p>
        </blockquote>
        <p>
      You can find it <a href="http://code.google.com/apis/chart/" target="_blank">here</a>.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=74326fc1-3f3f-4ba8-914f-53057b3178fd" />
      </body>
      <title>Google Chart API - Another Great Thing from Google</title>
      <guid>http://www.eranachum.com/PermaLink,guid,74326fc1-3f3f-4ba8-914f-53057b3178fd.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,74326fc1-3f3f-4ba8-914f-53057b3178fd.aspx</link>
      <pubDate>Thu, 10 Jan 2008 17:47:56 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
   Is Google is so kind or what? One more great tool and FREE of course that leashed
   by Google is the Google Chart API. 
&lt;/p&gt;
&lt;p&gt;
   By their introduction, The Google Chart API returns a PNG-format image in response
   to a URL. Several types of image can be generated: line, bar, and pie charts for example.
   For each image type you can specify attributes such as size, colors, and labels.
&lt;/p&gt;
&lt;p&gt;
   If you want to generate charts, graphs, pies etc. this is a great tool for you - the
   web developer. This tool gives a good fight to all other charts generator like &lt;a href="http://www.dotnetcharting.com/?gaw" target="_blank"&gt;.NET
   Charting&lt;/a&gt; for example and other unwanted ActiveXs modules that need to be installed
   on the client (we always want to avoid this action - at least me), because it is FREE
   and also because it is Google.
&lt;/p&gt;
&lt;p&gt;
   So I already generated myself: 
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
   &lt;a href="http://www.eranachum.com/content/binary/GoogleChartAPIAnotherGreatThingfromGoogl_A605/chart.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="100" alt="chart" src="http://www.eranachum.com/content/binary/GoogleChartAPIAnotherGreatThingfromGoogl_A605/chart_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
   You can find it &lt;a href="http://code.google.com/apis/chart/" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=74326fc1-3f3f-4ba8-914f-53057b3178fd" /&gt;</description>
      <category>Code;HTML;Other</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=71a18888-ca30-4a53-bbad-f1e383b144c9</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,71a18888-ca30-4a53-bbad-f1e383b144c9.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      First a small introduction to the HTML 5 introduction; If you are wondering why I
      didn't published during the last 2 weeks, the reason is a great vacation in <a href="http://en.wikipedia.org/wiki/New_York_City" target="_blank">New
      York</a> - in one simple word - <strong>Insane</strong>. (pics will be delivered on
      the following days).
   </p>
        <p>
      Now to our topic - <strong>HTML 5</strong>. We all used to (and still) work and know
      greatly HTML 4 - which actually is exists something like a decade, but HTML 5 is stands
      in front of us (but is still to come - the work is still on progress according <a href="http://www.w3.org" target="_blank">W3C</a>)
      and comes to simplify our life (as client developers - side by side to the server
      hard work of course).
   </p>
        <p>
      Indeed, HTML 5 will going to introduce a whole new set of elements that will make
      out lives to much more easier, also based on the fundamentals of HTML 4. The main
      innovations comes to replace the HTML 4 basic elements as DIV for an instance (which
      is one of the most used elements) with simplify elements that will use to represent
      the purpose of each one of them, like header, footer, section etc. - each one of then
      is a new well known element in the new language. A page rendered with HTML 5 could
      be shown like the following code snippet:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;body&gt; <br />
         &lt;header&gt;...&lt;/header&gt; <br />
         </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;nav&gt;...&lt;/nav&gt; <br />
         &lt;article&gt; <br />
            &lt;section&gt; ... &lt;/section&gt; <br />
         &lt;/article&gt; <br />
         &lt;aside&gt;...&lt;/aside&gt; <br />
         &lt;footer&gt;...&lt;/footer&gt; 
      <br />
      &lt;/body&gt;</span>
        </p>
        <p>
      One of the new innovations is the language definition. It means that HTML 5 is being
      defined in terms of the Document Object Model (DOM) as a tree representation that
      will be interpreted by the browser. This definition came from the idea of separating
      the language itself from its syntax, which can be defined independently. 
   </p>
        <p>
      As we know from previous HTML formats (HTML 4), there are 2 kinds of syntaxes: the
      HTML itself which is serialized as plain HTML or XHTML which is serialized as XML.
   </p>
        <p>
      The coin has two sides - each holds its benefits (you also aware of it right? ;)). 
   </p>
        <p>
      The benefits of using HTML 5 (which based on the familiar HTML) are the compatible
      of existing browsers and the second thing is the acquaintance of it by the authors
      (in our case - people like me and you!). 
   </p>
        <p>
      On other hand, using XHTML 5 will encourages authors to write well-formed markup,
      which some authors may find easier to maintain and Integrates directly with other
      XML vocabularies.
   </p>
        <p>
      This is still under consideration, so we have to wait to the decision...
   </p>
        <p>
      Some more tutorials and information regarding HTML 5 you can find in the W3C site <a href="http://www.w3.org/html/wg/html5/" target="_blank">here</a>.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=71a18888-ca30-4a53-bbad-f1e383b144c9" />
      </body>
      <title>An Introduction to HTML 5</title>
      <guid>http://www.eranachum.com/PermaLink,guid,71a18888-ca30-4a53-bbad-f1e383b144c9.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,71a18888-ca30-4a53-bbad-f1e383b144c9.aspx</link>
      <pubDate>Sun, 06 Jan 2008 19:46:09 GMT</pubDate>
      <description>&lt;p&gt;
   First a small introduction to the HTML 5 introduction; If you are wondering why I
   didn't published during the last 2 weeks, the reason is a great vacation in &lt;a href="http://en.wikipedia.org/wiki/New_York_City" target=_blank&gt;New
   York&lt;/a&gt; - in one simple word - &lt;strong&gt;Insane&lt;/strong&gt;. (pics will be delivered on
   the following days).
&lt;/p&gt;
&lt;p&gt;
   Now to our topic - &lt;strong&gt;HTML 5&lt;/strong&gt;. We all used to (and still) work and know
   greatly HTML 4 - which actually is exists something like a decade, but HTML 5 is stands
   in front of us (but is still to come - the work is still on progress according &lt;a href="http://www.w3.org" target=_blank&gt;W3C&lt;/a&gt;)
   and comes to simplify our life (as client developers - side by side to the server
   hard work of course).
&lt;/p&gt;
&lt;p&gt;
   Indeed, HTML 5 will going to introduce a whole new set of elements that will make
   out lives to much more easier, also based on the fundamentals of HTML 4. The main
   innovations comes to replace the HTML 4 basic elements as DIV for an instance (which
   is one of the most used elements) with simplify elements that will use to represent
   the purpose of each one of them, like header, footer, section etc. - each one of then
   is a new well known element in the new language. A page rendered with HTML 5 could
   be shown like the following code snippet:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;body&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;header&amp;gt;...&amp;lt;/header&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;nav&amp;gt;...&amp;lt;/nav&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;article&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;section&amp;gt; ... &amp;lt;/section&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/article&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;aside&amp;gt;...&amp;lt;/aside&amp;gt;&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;footer&amp;gt;...&amp;lt;/footer&amp;gt; 
   &lt;br&gt;
   &amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   One of the new innovations is the language definition. It means that HTML 5 is being
   defined in terms of the Document Object Model (DOM) as a tree representation that
   will be interpreted by the browser. This definition came from the idea of separating
   the language itself from its syntax, which can be defined independently. 
&lt;/p&gt;
&lt;p&gt;
   As we know from previous HTML formats (HTML 4), there are 2 kinds of syntaxes: the
   HTML itself which is serialized as plain HTML or XHTML which is serialized as XML.
&lt;/p&gt;
&lt;p&gt;
   The coin has two sides - each holds its benefits (you also aware of it right? ;)). 
&lt;/p&gt;
&lt;p&gt;
   The benefits of using HTML 5 (which based on the familiar HTML) are the compatible
   of existing browsers and the second thing is the acquaintance of it by the authors
   (in our case - people like me and you!). 
&lt;/p&gt;
&lt;p&gt;
   On other hand, using XHTML 5 will encourages authors to write well-formed markup,
   which some authors may find easier to maintain and Integrates directly with other
   XML vocabularies.
&lt;/p&gt;
&lt;p&gt;
   This is still under consideration, so we have to wait to the decision...
&lt;/p&gt;
&lt;p&gt;
   Some more tutorials and information regarding HTML 5 you can find in the W3C site &lt;a href="http://www.w3.org/html/wg/html5/" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=71a18888-ca30-4a53-bbad-f1e383b144c9" /&gt;</description>
      <category>Code;HTML</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=7d33d50f-e287-4cf0-83d1-696537a681cf</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,7d33d50f-e287-4cf0-83d1-696537a681cf.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Long time no written, I know.... I am quite busy these days at work and in my private
      time working on the web 2.0 startup with my colleagues.
   </p>
        <p>
      I received an email from <strong>Kevin Gao</strong>, which is the leading developer
      of a nice source control software that called SourceAnywhere Hosted of <a href="http://www.dynamsoft.com/" target="_blank">Dynamsoft</a> in
      order to check out their software tool. I decided to write about this tool, because
      this one is very suitable to me these days while working on my startup project. I
      actually needed a good source control in order to manage my code files properly.
   </p>
        <p>
      So, some conclusions regarding this tool, after working with it close to a month.
      Let start from the important thing for small developers like me - this tool is <strong>FREE </strong>to
      use for up to 3 users, which can be suitable for small to medium projects with low
      number of developers. 
   </p>
        <p>
      The second thing that was fine by me is the interface of this software, which is very
      similar to the Microsoft source control (admit it or not - I am a fan of it... ;)),
      this gave me great a familiar navigation ability between the functionality possibilities
      and indeed there are some nice possibilities and abilities, like: users and groups
      roles management and managing your code files (the usual functionality such as rollback,
      commit, check in/out etc.)
   </p>
        <p>
      The only disadvantage that I could think about here is a lack of files' state indicator.
      Dislike other source control tools that I worked with (like: <a href="http://msdn2.microsoft.com/en-us/library/3h0544kx(VS.80).aspx" target="_blank">Microsoft
      source safe control</a> which indicates a file content changes or file state directly
      in the Visual Studio environment or the <strong><a href="http://subversion.tigris.org/" target="_blank">SubVersion</a></strong> control
      system, which indicates the file's state in in the actual file system folder), this
      tool doesn't indicates it and this is kind of annoying.
   </p>
        <p>
      Generally I think this is a great tool to use it in order to manage your code version
      - again for small to  medium applications/projects.
   </p>
        <p>
      You can read about it and download it free of charge (for up to 3 users of course) <a href="http://www.dynamsoft.com/Products/SAWhosted_Overview.aspx" target="_blank">here</a>.
      Have fun!
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=7d33d50f-e287-4cf0-83d1-696537a681cf" />
      </body>
      <title>SourceAnywhere Hosted - My Proof of Concept</title>
      <guid>http://www.eranachum.com/PermaLink,guid,7d33d50f-e287-4cf0-83d1-696537a681cf.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,7d33d50f-e287-4cf0-83d1-696537a681cf.aspx</link>
      <pubDate>Sun, 02 Dec 2007 17:45:40 GMT</pubDate>
      <description>&lt;p&gt;
   Long time no written, I know.... I am quite busy these days at work and in my private
   time working on the web 2.0 startup with my colleagues.
&lt;/p&gt;
&lt;p&gt;
   I received an email from &lt;strong&gt;Kevin Gao&lt;/strong&gt;, which is the leading developer
   of a nice source control software that called SourceAnywhere Hosted of &lt;a href="http://www.dynamsoft.com/" target=_blank&gt;Dynamsoft&lt;/a&gt; in
   order to check out their software tool. I decided to write about this tool, because
   this one is very suitable to me these days while working on my startup project. I
   actually needed a good source control in order to manage my code files properly.
&lt;/p&gt;
&lt;p&gt;
   So, some conclusions regarding this tool, after working with it close to a month.
   Let start from the important thing for small developers like me - this tool is &lt;strong&gt;FREE &lt;/strong&gt;to
   use for up to 3 users, which can be suitable for small to medium projects with low
   number of developers. 
&lt;/p&gt;
&lt;p&gt;
   The second thing that was fine by me is the interface of this software, which is very
   similar to the Microsoft source control (admit it or not - I am a fan of it... ;)),
   this gave me great a familiar navigation ability between the functionality possibilities
   and indeed there are some nice possibilities and abilities, like: users and groups
   roles management and managing your code files (the usual functionality such as rollback,
   commit, check in/out etc.)
&lt;/p&gt;
&lt;p&gt;
   The only disadvantage that I could think about here is a lack of files' state indicator.
   Dislike other source control tools that I worked with (like: &lt;a href="http://msdn2.microsoft.com/en-us/library/3h0544kx(VS.80).aspx" target=_blank&gt;Microsoft
   source safe control&lt;/a&gt; which indicates a file content changes or file state directly
   in the Visual Studio environment or the &lt;strong&gt;&lt;a href="http://subversion.tigris.org/" target=_blank&gt;SubVersion&lt;/a&gt;&lt;/strong&gt; control
   system, which indicates the file's state in in the actual file system folder), this
   tool doesn't indicates it and this is kind of annoying.
&lt;/p&gt;
&lt;p&gt;
   Generally I think this is a great tool to use it in order to manage your code version
   - again for small to&amp;nbsp; medium applications/projects.
&lt;/p&gt;
&lt;p&gt;
   You can read about it and download it free of charge (for up to 3 users of course) &lt;a href="http://www.dynamsoft.com/Products/SAWhosted_Overview.aspx" target=_blank&gt;here&lt;/a&gt;.
   Have fun!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=7d33d50f-e287-4cf0-83d1-696537a681cf" /&gt;</description>
      <category>Code;Management;Security</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=3fab0caa-387d-49a3-ab1a-a3caa58401b3</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,3fab0caa-387d-49a3-ab1a-a3caa58401b3.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Firstable, before I am going to write the following words, I want to mention and admit
      that I am realy a big fan of Microsoft technologies, its innovetions and its line
      of philosophy; Most of the time they are doing good job (in some cases I would implement
      some things in other way, but this issue if for other post...).
   </p>
        <p>
      What I want to talk about in this post is the C# language's development from the first
      version of .NET until the further to come which is .NET 3.5 in Visual Studio 2008. 
      <br />
      In the beginning of .NET 2.0 there were great and major language improvement,
      like generics, anonymous methods/delegates and more nice things (that indeed, helps
      us to write more nice, agile and elegant code). <u>BUT</u> major things often
      require new keywords to support the 'enhanced' language, for an example: the &lt;TEntity&gt;
      syntax in order to use and implement generics.
   </p>
        <p>
      In the generics case, this syntax is required in order to make a usage with this great
      feature, but in most cases new keywords are BAD, just bad because developers have
      the annoying habit of using non-keywords as identifiers. An example for new keyword
      is the pair: <strong><font size="3">return yield</font><em>.</em></strong> In the
      first version of iterators, you had to use <em>yield</em> when you
      wanted to "return" an iterator value back, and as we know everything worked just fine,
      so why should they need to add the return keyword in order to return the iterator's
      value? (I'll be glad to get the answer if you got it...)
   </p>
        <p>
      I tried to figure out and see what Microsoft tried to do regarding this issue and
      found that they ment to provide a utility that you could run over your source code,
      and it would replace any identifier that had become a keyword with the escaped
      version. It should do this by putting an "@" sign in front of it. I don't
      think that tool at least was published...
   </p>
        <p>
      Today, just before .NET 3.5 is releases out (not in beta of course), we can see on
      beta versions and examples the new keywords and innovations that had been added to
      the language which demands from us to adjust ourselves to the new syntax.
   </p>
        <p>
      At the bottom line, it makes us a little bit of hard time at the begining, but
      it enhances our language and gives us a learning challenge and the ability of upgrading
      our code (maybe not easy to read on the first time but easy to implement and
      to make it more agile and generic). 
   </p>
        <p>
      ;-)I encourages these changes, but don't forget - everything could work just
      fine without these new stuff.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=3fab0caa-387d-49a3-ab1a-a3caa58401b3" />
      </body>
      <title>Keywords - The beginning (.NET 1.0/1.1) until now (.NET 3.0/3.5)</title>
      <guid>http://www.eranachum.com/PermaLink,guid,3fab0caa-387d-49a3-ab1a-a3caa58401b3.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,3fab0caa-387d-49a3-ab1a-a3caa58401b3.aspx</link>
      <pubDate>Wed, 03 Oct 2007 09:34:29 GMT</pubDate>
      <description>&lt;p&gt;
   Firstable, before I am going to write the following words, I want to mention and admit
   that I am realy a big fan of Microsoft technologies, its innovetions and its line
   of philosophy; Most of the time they are doing good job (in some cases I would implement
   some things in other way, but this issue if for other post...).
&lt;/p&gt;
&lt;p&gt;
   What I want to talk about in this post is the C# language's development from the first
   version of .NET until the further to come which is .NET 3.5 in Visual Studio 2008. 
   &lt;br&gt;
   In the beginning of .NET 2.0 there were great and&amp;nbsp;major language improvement,
   like generics, anonymous methods/delegates and more nice things (that indeed, helps
   us to write more nice, agile&amp;nbsp;and elegant code). &lt;u&gt;BUT&lt;/u&gt; major things often
   require new keywords to support the 'enhanced' language, for an example: the &amp;lt;TEntity&amp;gt;
   syntax in order to use and implement generics.
&lt;/p&gt;
&lt;p&gt;
   In the generics case, this syntax is required in order to make a usage with this great
   feature, but in most cases new keywords are BAD, just bad because developers have
   the annoying habit of using non-keywords as identifiers. An example for new keyword
   is the pair: &lt;strong&gt;&lt;font size=3&gt;return yield&lt;/font&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt; In the first
   version of iterators, you&amp;nbsp;had to&amp;nbsp;use&amp;nbsp;&lt;em&gt;yield&lt;/em&gt; when you wanted
   to "return" an iterator value back, and as we know everything worked just fine, so
   why should they need to add the return keyword in order to return the iterator's value?
   (I'll be glad to get the answer if you got it...)
&lt;/p&gt;
&lt;p&gt;
   I tried to figure out and see what Microsoft tried to do regarding this issue and
   found that they ment to provide a utility that you could run over your source code,
   and it would replace any identifier that had become&amp;nbsp;a keyword with the escaped
   version. It&amp;nbsp;should do&amp;nbsp;this by putting an "@" sign in front of it. I don't
   think&amp;nbsp;that tool at least was published...
&lt;/p&gt;
&lt;p&gt;
   Today, just before .NET 3.5 is releases out (not in beta of course), we can see&amp;nbsp;on
   beta versions and examples the new keywords and innovations that had been added to
   the language which demands from us to adjust ourselves to the new syntax.
&lt;/p&gt;
&lt;p&gt;
   At&amp;nbsp;the bottom line, it makes us a little bit of hard time at the begining, but
   it enhances our language and gives us a learning challenge and the ability of upgrading
   our code (maybe not easy to read on the first time but easy&amp;nbsp;to implement and
   to make it more agile and generic).&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
   ;-)I encourages these changes, but don't forget -&amp;nbsp;everything could work just
   fine without these new stuff.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=3fab0caa-387d-49a3-ab1a-a3caa58401b3" /&gt;</description>
      <category>C#;Code;Other</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=532c3302-dde3-4abd-a652-1864b13cf8b4</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,532c3302-dde3-4abd-a652-1864b13cf8b4.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I am working against 3rd level party assembly in my current web application. I need
      to send US address information to this assembly and to retrieve an answer whether
      this address is exist or not. This assembly requires validation against X.509 certificate
      (to ensure that only permited client could use the 3rd level's services), which is
      installed on the server that runs the application (in dev environment this is my local
      PC). 
      <br />
      More details about it <a href="http://www.codeproject.com/useritems/X509Certificate.asp" target="_blank">here</a>.
   </p>
        <p>
          <strong>The problem:</strong> In order to authenticate against this certificate, the
      process that runs the application need to 'hold' sufficient credentials in order to
      get an access to the certificate and to do the authentication. Here comes our problem;
      when trying to access this certificate through the asp.net application, we run into
      a problem - It's impossible, because the process that runs the web application is
      ASPNET and doesn't has the needed credentials in order to authenticate the certificate
      and get the info from the 3rd level.
   </p>
        <p>
          <strong>Suggested solutions:<br /></strong>
        </p>
        <ol>
          <li>
            <strong>Credentials</strong>. Read the credentials from the web.config (username,
         password and domain) and impersonate the user using these credentials. This will
         'save' the impersonated user all over the impersonation context (<font size="2">System.Security.Principal.WindowsImpersonationContext</font>)
         and the authenicate action against the certificate will be done using this credentials.
         One more important thing, to ensure this data protected, encrypt it before puting
         it into the web.config. 
      </li>
          <li>
         I thought about <strong>IIS Application Pool.</strong> This is a great feature that
         came up in IIS 6.0, which enables you the ability of creating one or more applications
         and allows us to configure a level of isolation between different Web applications.
         You can set the identity of an application pool which will be the account under which
         the application pool's worker process runs. So I thought to set it over there, but
         I had one big problem, an IIS 5 was installed on the production server and it is not
         a dedicated server. (More details about application pool <a href="http://www.developer.com/net/asp/article.php/2245511" target="_blank">here</a>). 
      </li>
          <li>
            <strong>Host .NET component in COM+</strong>. This is the third solution and the best
         for me at the current circumstances; Because I am working with a several applications
         (assemblies) I want to host the component that validates the user against the
         3rd level party, this will give me a unified behavoir for all the applications while
         doing this action (Instead of setting these properties in web.config file of
         each web application we want to use {solution 1, remember?}). In other words,
         I'll set the username and password on the COM+ component just once in order to grant
         the process that runs this component the right and sufficient credentials. .NET
         provides a way to host your .NET components inside COM+ environment. All the functionality
         you need to write a COM+ aware component in .NET can be found in System.EnterpriseServices
         namespace.</li>
        </ol>
        <p>
          <strong>So how we do it (hosting .NET assembly in COM+)?</strong>
        </p>
        <p>
      Take a look on this code:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Collections.Generic;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Text;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.EnterpriseServices;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.IO;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Reflection;<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Runtime.InteropServices;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> ComPlusTest<br />
      {<br />
          [Transaction(TransactionOption.Required), 
      <br />
              ObjectPooling(MinPoolSize=2, MaxPoolSize=5,
      CreationTimeout=20000),<br />
              ComVisible(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>)]<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> TestClass
      : ServicedComponent<br />
          {<br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">protected</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">override</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Activate()<br />
              {<br />
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">base</span>.Activate();<br />
                  DoSomeAction(Action
      activate)<br />
              }<br /><br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">protected</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">override</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Deactivate()<br />
              {<br />
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">base</span>.Deactivate();<br />
                  DoSomeAction(Action
      deactivate)<br />
              }<br /><br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">protected</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">override</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> CanBePooled()<br />
              {<br />
                  DoSomeAction(Action
      pooled)<br />
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">base</span>.CanBePooled();<br />
              }</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">        <font color="#0000ff">public
      void</font> ValidateAddress(<font color="#0000ff">string</font> address)<br />
              {<br />
                  <font color="#0000ff">try</font><br />
                  {<br />
                     //
      Do the validation against the 3rd party<br />
                     ContextUtil.SetComplete();<br />
                  }<br />
                  <font color="#0000ff">catch</font>(Exception
      ex)<br />
                  {<br />
                     //
      Handle exception<br />
                     ContextUtil.SetAbort();<br />
                  }<br />
              }<br /></span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <br />
              [AutoComplete()]<br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> JustAction()<br />
              {<br />
                  DoSomeAction(Action
      simpleAction);<br />
              }<br /><br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> DoSomeAction(Action
      act)<br />
              {<br />
                  <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Do the action</span><br />
              }<br />
          }<br />
      }<br /></span>
        </p>
        <p>
      Lets dissect it:
   </p>
        <ol>
          <li>
         Firstable you can see that the class is derived from ServicesComponent (which sits
         in the System.EnterpriseServices namespace). I marked our TestClass with some attributes.
         The first one in Transaction; The values for this attribute are same as in traditional
         VB/VC++ development i.e. Required, RequiresNew, Supported etc. MinPoolSize and MaxPoolSize
         specifies values for minimum and maximum object instances. The ComVisible attribute <strong>must </strong>be
         set to true to give the accessibility of an individual managed type or member, or
         of all types within an assembly, to COM (I spent lots of time trying to figure out
         some exceptions that I had while overriding the ServicesComponent class). 
      </li>
          <li>
         the class is marked to require a transaction each method will execute in a transaction
         (existing or new). Once the ValidateAddress has been executed we need to either commit
         or rollback the transaction. This is done via static methods of <strong>ContextUtil</strong> class.
         The method <strong>SetComplete</strong> is used to commit a transaction where as SetAbort
         is used to rollback a transaction. 
      </li>
          <li>
         Just for example, I defined a methid called JustAction. This method is marked with
         an attribute <strong>AutoComplete</strong> which means that once the method execution
         is over the transaction is automatically committed (equivalent to ContextUtil.SetComplete).
         In case of any error the transaction will be rolled back (equivalent to ContextUtil.SetAbort). 
      </li>
          <li>
         Overrided Activate, Deactivate and CanBePooled methods are just for testing (in
         order to observe the flow behavior).</li>
        </ol>
        <p>
      Now, you have to sign your assembly with a strong name and to add the following attributes
      to the AssemblyInfo class of your project:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[assembly:
      ApplicationName(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"ComPlusTest"</span>)]<br />
      [assembly: ApplicationActivation(ActivationOption.Library)]<br />
      [assembly: AssemblyKeyFileAttribute(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"ComPlusKey.pfx"</span>)]</span>
        </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=532c3302-dde3-4abd-a652-1864b13cf8b4" />
      </body>
      <title>Hosting .NET Assembly in COM+ Situation</title>
      <guid>http://www.eranachum.com/PermaLink,guid,532c3302-dde3-4abd-a652-1864b13cf8b4.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,532c3302-dde3-4abd-a652-1864b13cf8b4.aspx</link>
      <pubDate>Tue, 10 Jul 2007 14:49:24 GMT</pubDate>
      <description>&lt;p&gt;
   I am working against 3rd level party assembly in my current web application. I need
   to send US address information to this&amp;nbsp;assembly and to retrieve an answer whether
   this address is exist or not. This assembly requires validation against X.509 certificate
   (to ensure that only permited client could use the 3rd level's services), which is
   installed on the server that runs the application (in dev environment this is my local
   PC). 
   &lt;br&gt;
   More details about it &lt;a href="http://www.codeproject.com/useritems/X509Certificate.asp" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;The problem:&lt;/strong&gt; In order to authenticate against this certificate, the
   process that runs the application need to 'hold' sufficient credentials in order to
   get an access to the certificate and to do the authentication. Here comes our problem;
   when trying to access this certificate through the asp.net application, we run into
   a problem - It's impossible, because the process that runs the web application is
   ASPNET and doesn't has the needed credentials in order to authenticate the certificate
   and get the info from the 3rd level.
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;Suggested solutions:&lt;br&gt;
   &lt;/strong&gt;
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      &lt;strong&gt;Credentials&lt;/strong&gt;. Read the credentials from the web.config (username,
      password and domain) and&amp;nbsp;impersonate the user using these credentials. This will
      'save' the impersonated user all over the&amp;nbsp;impersonation context (&lt;font size=2&gt;System.Security.Principal.WindowsImpersonationContext&lt;/font&gt;)
      and the authenicate action against the certificate will be done using this credentials.
      One more important thing, to ensure this data protected, encrypt it before puting
      it into the web.config. 
   &lt;li&gt;
      I thought about &lt;strong&gt;IIS Application Pool.&lt;/strong&gt; This is a great feature that
      came up in IIS 6.0, which enables you the ability of creating one or more applications
      and allows us to configure a level of isolation between different Web applications.
      You can set the identity of an application pool which will be the account under which
      the application pool's worker process runs. So I thought to set it over there, but
      I had one big problem, an IIS 5 was installed on the production server and it is not
      a dedicated server. (More details about application pool &lt;a href="http://www.developer.com/net/asp/article.php/2245511" target=_blank&gt;here&lt;/a&gt;). 
   &lt;li&gt;
      &lt;strong&gt;Host .NET component in COM+&lt;/strong&gt;. This is the third solution and the best
      for me at the current circumstances; Because I am working with a several&amp;nbsp;applications
      (assemblies) I want to host the&amp;nbsp;component that validates the user against the
      3rd level party, this will give me a unified behavoir for all the applications while
      doing this action (Instead of setting these properties in&amp;nbsp;web.config file of
      each web application we want to use&amp;nbsp;{solution 1, remember?}). In other words,
      I'll set the username and password on the COM+ component just once&amp;nbsp;in order to&amp;nbsp;grant
      the process that runs this component the right and sufficient credentials.&amp;nbsp;.NET
      provides a way to host your .NET components inside COM+ environment. All the functionality
      you need to write a COM+ aware component in .NET can be found in System.EnterpriseServices
      namespace.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   &lt;strong&gt;So how we do it (hosting .NET assembly in COM+)?&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   Take a look on this code:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Text;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.EnterpriseServices;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.IO;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Reflection;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; ComPlusTest&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Transaction(TransactionOption.Required), 
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ObjectPooling(MinPoolSize=2, MaxPoolSize=5,
   CreationTimeout=20000),&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ComVisible(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;)]&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; TestClass
   : ServicedComponent&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Activate()&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/span&gt;.Activate();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DoSomeAction(Action
   activate)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Deactivate()&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/span&gt;.Deactivate();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DoSomeAction(Action
   deactivate)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; CanBePooled()&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DoSomeAction(Action
   pooled)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/span&gt;.CanBePooled();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;public
   void&lt;/font&gt; ValidateAddress(&lt;font color=#0000ff&gt;string&lt;/font&gt; address)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;try&lt;/font&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
   Do the validation against the 3rd party&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContextUtil.SetComplete();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;catch&lt;/font&gt;(Exception
   ex)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
   Handle exception&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContextUtil.SetAbort();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[AutoComplete()]&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; JustAction()&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DoSomeAction(Action
   simpleAction);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; DoSomeAction(Action
   act)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Do the action&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   }&lt;br&gt;
&lt;/p&gt;
&gt; 
&lt;p&gt;
   Lets dissect it:
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      Firstable you can see that the class is derived from ServicesComponent (which sits
      in the System.EnterpriseServices namespace). I marked our TestClass with some attributes.
      The first one in Transaction; The values for this attribute are same as in traditional
      VB/VC++ development i.e. Required, RequiresNew, Supported etc. MinPoolSize and MaxPoolSize
      specifies values for minimum and maximum object instances. The ComVisible attribute &lt;strong&gt;must &lt;/strong&gt;be
      set to true to give the accessibility of an individual managed type or member, or
      of all types within an assembly, to COM (I spent lots of time trying to figure out
      some exceptions that I had while overriding the ServicesComponent class). 
   &lt;li&gt;
      the class is marked to require a transaction each method will execute in a transaction
      (existing or new). Once the ValidateAddress has been executed we need to either commit
      or rollback the transaction. This is done via static methods of &lt;strong&gt;ContextUtil&lt;/strong&gt; class.
      The method &lt;strong&gt;SetComplete&lt;/strong&gt; is used to commit a transaction where as SetAbort
      is used to rollback a transaction. 
   &lt;li&gt;
      Just for example, I defined a methid called JustAction. This method is marked with
      an attribute &lt;strong&gt;AutoComplete&lt;/strong&gt; which means that once the method execution
      is over the transaction is automatically committed (equivalent to ContextUtil.SetComplete).
      In case of any error the transaction will be rolled back (equivalent to ContextUtil.SetAbort). 
   &lt;li&gt;
      Overrided&amp;nbsp;Activate, Deactivate and CanBePooled methods are just for testing (in
      order to observe the flow behavior).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   Now, you have to sign your assembly with a strong name and to add the following attributes
   to the AssemblyInfo class of your project:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[assembly:
   ApplicationName(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"ComPlusTest"&lt;/span&gt;)]&lt;br&gt;
   [assembly: ApplicationActivation(ActivationOption.Library)]&lt;br&gt;
   [assembly: AssemblyKeyFileAttribute(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"ComPlusKey.pfx"&lt;/span&gt;)]&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=532c3302-dde3-4abd-a652-1864b13cf8b4" /&gt;</description>
      <category>.NET 2005;ASP.NET;Code;System</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=87001ec1-655f-4084-8910-16d707f0680a</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,87001ec1-655f-4084-8910-16d707f0680a.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      These days I am working on a very big web application...
   </p>
        <p>
      In one of my aspx pages I had needed to save lots of data in the ViewState object in
      order to persist data between postbacks, but when I looked at the rendered HTML, I
      saw a large hidden field for carring the ViewState.
   </p>
        <p>
      ASP.NET 2.0 came up with a new feature that helps to reduce the amount of the hidden
      filed's ViewState data that called: <strong>PageStatePersister. </strong></p>
        <p>
      When we add an override the <b>PageStatePersister</b> property and use the built-in <b>SessionPageStatePersister</b>,
      the behavior of the page remains the same, but the storage used for the bulk of the
      state data is shifted from the hidden field to session state.
   </p>
        <p>
      Implamantation instance:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">protected</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">override</span> PageStatePersister
      PageStatePersister<br />
      {<br />
         get { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SessionPageStatePersister(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>);
      }<br />
      }<br /></span>
        </p>
        <p>
      In several cases you'll only want to override this property in your page and to shift
      the ViewState data into the Sesson object, but if you'll want to use it (wisely of
      course) on your entire web application? You should implement this property in a particular
      custom base page and to inherit it to all of your application pages.
   </p>
        <p>
      The only disadventage that I could think about here is the data existent, session
      can lose its data and information if its timeout has ended, but ViewState can hold
      the data forever on the page, because it's hard coded.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=87001ec1-655f-4084-8910-16d707f0680a" />
      </body>
      <title>How to reduce the ViewState weight on a aspx page? or ASP.NET 2.0 Page State Persister</title>
      <guid>http://www.eranachum.com/PermaLink,guid,87001ec1-655f-4084-8910-16d707f0680a.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,87001ec1-655f-4084-8910-16d707f0680a.aspx</link>
      <pubDate>Sun, 10 Jun 2007 13:08:17 GMT</pubDate>
      <description>&lt;p&gt;
   These days I am working on a very big web application...
&lt;/p&gt;
&lt;p&gt;
   In one of my aspx pages I had needed to save lots of data in the&amp;nbsp;ViewState object&amp;nbsp;in
   order to persist data between postbacks, but when I looked at the rendered HTML, I
   saw a large hidden field for carring the ViewState.
&lt;/p&gt;
&lt;p&gt;
   ASP.NET 2.0 came up with a new feature that helps to reduce the amount of the hidden
   filed's ViewState data that called: &lt;strong&gt;PageStatePersister. &lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   When we add an override the &lt;b&gt;PageStatePersister&lt;/b&gt; property and use the built-in &lt;b&gt;SessionPageStatePersister&lt;/b&gt;,
   the behavior of the page remains the same, but the storage used for the bulk of the
   state data is shifted from the hidden field to session state.
&lt;/p&gt;
&lt;p&gt;
   Implamantation&amp;nbsp;instance:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/span&gt; PageStatePersister
   PageStatePersister&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;get { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SessionPageStatePersister(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;);
   }&lt;br&gt;
   }&lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   In several cases you'll only want to override this property in your page and to shift
   the ViewState data into the Sesson object, but if you'll want to use it (wisely of
   course) on your entire web application? You should implement this property in a particular
   custom base page and to inherit it to all of your application pages.
&lt;/p&gt;
&lt;p&gt;
   The only disadventage that I could think about here is the data existent, session
   can lose its data and information if its timeout has ended, but ViewState can hold
   the data forever on the page, because it's hard coded.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=87001ec1-655f-4084-8910-16d707f0680a" /&gt;</description>
      <category>.NET 2005;Code</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=7d509ea5-bf93-41c7-a07c-0d265753fa5f</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,7d509ea5-bf93-41c7-a07c-0d265753fa5f.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I am working now on a large web application, that need to be used by more than one
      websites (at least 5 of them, websites and web services), therefore I have needed
      to do some isolating here with my main core projects.
   </p>
        <p>
      Some background...<br />
      I have a common assembly (web application) that holds only the user controls,
      server controls and custom controls, which need to serve the all other web applications
      that are using them. This assembly has a reference to the other web application in
      order to have some information about some properties, session variables and global
      members, by this information, it knows to gereate some actions on runtime (or even
      in design). BUT, in the other hand, this web application need to use the controls
      that the first assembly has published, here we have a <strong>problem</strong>, we
      got a circular references, which is now allowed in .NET framework, also it isn't allowed
      anywhere I think...
   </p>
        <p>
      So, how we gonna solve this problem?
   </p>
        <p>
      The solution is quite simple and is known as <strong>Seperate Interface Pattern</strong>.
      (Click <a href="http://www.martinfowler.com/eaaCatalog/separatedInterface.html" target="_blank">here</a> to
      get some more info).
   </p>
        <p>
      The main steps to implement it are:<br />
      Let define a project that called <strong>ProjectA</strong> and holds the
      user controls (etc...) implementations along with <strong>InterfaceB</strong>. <strong>ProjectA</strong> would
      maintain a reference to <strong>InterfaceB</strong>, which will hold any properties
      such as members, methods, events etc...
   </p>
        <p>
      Now, lets define <strong>ProjectB</strong> which will implement <strong>InterfaceA</strong>.
      Now, <strong>ProjectB</strong> would reference <strong>ProjectA</strong> and (BUT) <strong>ProjectA</strong> would
      not reference <strong>ProjectB</strong> of course.
   </p>
        <p>
      The result, ProjectA can access to ProjectB's specific exposed members and ProjectB
      can use the controls of ProjectA.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=7d509ea5-bf93-41c7-a07c-0d265753fa5f" />
      </body>
      <title>Circular References or How to solve this problem?</title>
      <guid>http://www.eranachum.com/PermaLink,guid,7d509ea5-bf93-41c7-a07c-0d265753fa5f.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,7d509ea5-bf93-41c7-a07c-0d265753fa5f.aspx</link>
      <pubDate>Thu, 31 May 2007 12:26:25 GMT</pubDate>
      <description>&lt;p&gt;
   I am working now on a large web application, that need to be used by more than one
   websites (at least 5 of them, websites and web services), therefore I have needed
   to do some isolating here with my main core projects.
&lt;/p&gt;
&lt;p&gt;
   Some background...&lt;br&gt;
   I have a common&amp;nbsp;assembly (web application) that holds only the user controls,
   server controls and custom controls, which need to serve the all other web applications
   that are using them. This assembly has a reference to the other web application in
   order to have some information about some properties, session variables&amp;nbsp;and global
   members, by this information, it knows to gereate some actions on runtime (or even
   in design). BUT, in the other hand, this web application need to use the controls
   that the first assembly has published, here we have a &lt;strong&gt;problem&lt;/strong&gt;, we
   got a circular references, which is now allowed in .NET framework, also it isn't allowed
   anywhere I think...
&lt;/p&gt;
&lt;p&gt;
   So, how we gonna solve this problem?
&lt;/p&gt;
&lt;p&gt;
   The solution is quite simple and is known as &lt;strong&gt;Seperate Interface Pattern&lt;/strong&gt;.
   (Click &lt;a href="http://www.martinfowler.com/eaaCatalog/separatedInterface.html" target=_blank&gt;here&lt;/a&gt; to
   get some more info).
&lt;/p&gt;
&lt;p&gt;
   The main steps to implement it are:&lt;br&gt;
   Let&amp;nbsp;define a project that called &lt;strong&gt;ProjectA&lt;/strong&gt;&amp;nbsp;and holds the
   user controls (etc...) implementations along with &lt;strong&gt;InterfaceB&lt;/strong&gt;. &lt;strong&gt;ProjectA&lt;/strong&gt; would
   maintain a reference to &lt;strong&gt;InterfaceB&lt;/strong&gt;, which will hold any properties
   such as members, methods, events etc...
&lt;/p&gt;
&lt;p&gt;
   Now, lets define &lt;strong&gt;ProjectB&lt;/strong&gt; which will implement &lt;strong&gt;InterfaceA&lt;/strong&gt;.
   Now, &lt;strong&gt;ProjectB&lt;/strong&gt; would reference &lt;strong&gt;ProjectA&lt;/strong&gt; and (BUT) &lt;strong&gt;ProjectA&lt;/strong&gt; would
   not reference &lt;strong&gt;ProjectB&lt;/strong&gt; of course.
&lt;/p&gt;
&lt;p&gt;
   The result, ProjectA can access to ProjectB's specific exposed&amp;nbsp;members and ProjectB
   can use the controls of ProjectA.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=7d509ea5-bf93-41c7-a07c-0d265753fa5f" /&gt;</description>
      <category>.NET 2005;Bugs;Code;Patterns</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=23d7f48a-2af9-4350-a0d3-25d4f08a3d67</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,23d7f48a-2af9-4350-a0d3-25d4f08a3d67.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hi fellows, how are you?
   </p>
        <p>
      I read a nice article regarding editing and encrypting/decrypting web.config
      sections. The nicest thing in that feature is the ability to access to the web.config
      content via the actual code behind (and) in run-time. (Could be a lot of reasons
      to access the file from the code itself, and the API is very 'friendly').
   </p>
        <p>
      Click <a href="http://www.c-sharpcorner.com/UploadFile/neo_matrix/EditWebConfig05042007091116AM/EditWebConfig.aspx" target="_blank">here</a> to
      get the directive to this article.
   </p>
        <p>
      Bye bye...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=23d7f48a-2af9-4350-a0d3-25d4f08a3d67" />
      </body>
      <title>Edit and encrypt Web.Config sections using C# 2.0</title>
      <guid>http://www.eranachum.com/PermaLink,guid,23d7f48a-2af9-4350-a0d3-25d4f08a3d67.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,23d7f48a-2af9-4350-a0d3-25d4f08a3d67.aspx</link>
      <pubDate>Thu, 17 May 2007 08:23:55 GMT</pubDate>
      <description>&lt;p&gt;
   Hi fellows, how are you?
&lt;/p&gt;
&lt;p&gt;
   I read&amp;nbsp;a nice article regarding editing and encrypting/decrypting web.config
   sections. The nicest thing in that feature is the ability to access to the web.config
   content via the actual code behind (and) in run-time. (Could be&amp;nbsp;a lot of reasons
   to access the file from the code itself, and the API is very 'friendly').
&lt;/p&gt;
&lt;p&gt;
   Click&amp;nbsp;&lt;a href="http://www.c-sharpcorner.com/UploadFile/neo_matrix/EditWebConfig05042007091116AM/EditWebConfig.aspx" target=_blank&gt;here&lt;/a&gt;&amp;nbsp;to
   get the directive to this article.
&lt;/p&gt;
&lt;p&gt;
   Bye bye...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=23d7f48a-2af9-4350-a0d3-25d4f08a3d67" /&gt;</description>
      <category>.NET 2005;Code;Security</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=f82907c5-5740-4bd3-9b0c-2d844c28a027</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,f82907c5-5740-4bd3-9b0c-2d844c28a027.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hi again..
   </p>
        <p>
      I am here again with the same issue, and this is because a long conversation that
      I had with <a href="http://www.eranachum.com/www.lnbogen.com" target="_blank">Oren
      Ellenbogen</a> (ex. co-worker) about some extending and refactoring of the former
      post solution (you can see it <a href="http://www.eranachum.com/PermaLink,guid,60b3bb92-311d-4f6d-8bd8-f76677e20ea5.aspx">here</a> if
      you missed it).
   </p>
        <p>
      The main goal in the Session/Application objects encapsulation was the ability of
      avoiding casting each time that we would use these objects, this is annoying especially
      we uses the specific object in most of the flows of the application.<br />
      The other goal is getting the ability of managing these objects in one centered place.
   </p>
        <p>
      NOW, some extesibility...<br />
      This object need to be maintened everytime that we want to add a new session/application
      object. Good usage of generics will solve this problem -&gt; this will bring up the
      ability of adding new objects everywhere that we'll want (example in the continuance...).
   </p>
        <p>
      So, look at the following implemetation:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> SessionRepository<br />
      {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> IsExist(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> objectKey)<br />
         {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">      return</span> HttpContext.Current.Session[objectKey]
      !<span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>;<br />
         }<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> TObject
      GetInstance&lt;TObject&gt;(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> objectKey)<br />
         {<br />
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> (TObject)HttpContext.Current.Session[objectKey];<br />
         }<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Add&lt;TObject&gt;(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> objectKey,
      TObject obj)<br />
         {<br />
            HttpContext.Current.Session.Add(objectKey, obj);<br />
         }<br />
      }</span>
        </p>
        <p>
      Some usage:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (SessionRepository.IsExist(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObjectKey"</span>))<br />
      {<br />
         SomeObject obj <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> SessionRepository.GetInstance&lt;SomeObject&gt;(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObjectKey"</span>);<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
      Do your things...</span><br />
      }<br /><br />
      SessionRepository.Add&lt;SomeObject&gt;(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObjectKey"</span>,
      SomeObject);</span>
        </p>
        <p>
      This way of implementation comes to help us with the <strong>casting</strong> issue
      and it gives up extensibilty options. I think that there is a small disadventage here
      - we also need to remeber the keys of the objects in the session object - but there
      is nothing perfect.
   </p>
        <p>
          <strong>
            <u>Summary:</u>
          </strong>
        </p>
        <ol>
          <li>
         Both of the solutions are good and each has each advantages/disadventages, you can
         prefer the best way of using.</li>
          <li>
         The first way (shown in the former post) enables you a direct access to the object
         stays in the session/application, but need to be managed for each time we want to
         add new object into the session/application.</li>
          <li>
         The way shown here holds a different approach, enables you extensibility, but you
         don't have the explicit access to these objects.</li>
          <li>
         In both ways, the casting issue is covered!</li>
        </ol>
        <p>
      That's it for today.
   </p>
        <p>
      Commets will be appriciated...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=f82907c5-5740-4bd3-9b0c-2d844c28a027" />
      </body>
      <title>Some Encapsulation (A repository for Session/Application members)  - Part 2</title>
      <guid>http://www.eranachum.com/PermaLink,guid,f82907c5-5740-4bd3-9b0c-2d844c28a027.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,f82907c5-5740-4bd3-9b0c-2d844c28a027.aspx</link>
      <pubDate>Sun, 29 Apr 2007 12:41:05 GMT</pubDate>
      <description>&lt;p&gt;
   Hi again..
&lt;/p&gt;
&lt;p&gt;
   I am here again with the same issue, and this is because a long conversation that
   I had with &lt;a href="http://www.eranachum.com/www.lnbogen.com" target=_blank&gt;Oren Ellenbogen&lt;/a&gt; (ex.
   co-worker) about some extending and refactoring of the former post solution (you can
   see it &lt;a href="http://www.eranachum.com/PermaLink,guid,60b3bb92-311d-4f6d-8bd8-f76677e20ea5.aspx"&gt;here&lt;/a&gt; if
   you missed it).
&lt;/p&gt;
&lt;p&gt;
   The main goal in the Session/Application objects encapsulation was the ability of
   avoiding casting each time that we would use these objects, this is annoying especially
   we uses the specific object in most of the flows of the application.&lt;br&gt;
   The other goal is getting the ability of managing these objects in one centered place.
&lt;/p&gt;
&lt;p&gt;
   NOW, some extesibility...&lt;br&gt;
   This object need to be maintened everytime that we want to add a new session/application
   object. Good usage of generics will solve this problem -&amp;gt; this will bring up the
   ability of adding new objects everywhere that we'll want (example in the continuance...).
&lt;/p&gt;
&lt;p&gt;
   So, look at the following implemetation:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; SessionRepository&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; IsExist(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; objectKey)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; HttpContext.Current.Session[objectKey]
   !&lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; TObject
   GetInstance&amp;lt;TObject&amp;gt;(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; objectKey)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; (TObject)HttpContext.Current.Session[objectKey];&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Add&amp;lt;TObject&amp;gt;(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; objectKey,
   TObject obj)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpContext.Current.Session.Add(objectKey, obj);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   Some usage:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (SessionRepository.IsExist(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObjectKey"&lt;/span&gt;))&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;SomeObject obj &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; SessionRepository.GetInstance&amp;lt;SomeObject&amp;gt;(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObjectKey"&lt;/span&gt;);&lt;br&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
   Do your things...&lt;/span&gt;
   &lt;br&gt;
   }&lt;br&gt;
   &lt;br&gt;
   SessionRepository.Add&amp;lt;SomeObject&amp;gt;(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObjectKey"&lt;/span&gt;,
   SomeObject);&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   This way of implementation comes to help us with the &lt;strong&gt;casting&lt;/strong&gt; issue
   and it gives up extensibilty options. I think that there is a small disadventage here
   - we also need to remeber the keys of the objects in the session object - but there
   is nothing perfect.
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;&lt;u&gt;Summary:&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      Both of the solutions are good and each has each advantages/disadventages, you can
      prefer the best way of using.&lt;/li&gt;
   &lt;li&gt;
      The first way (shown in the former post) enables you&amp;nbsp;a direct access to the object
      stays in the session/application, but need to be managed for each time we want to
      add new object into the session/application.&lt;/li&gt;
   &lt;li&gt;
      The way shown here holds a different approach, enables you extensibility, but you
      don't have the explicit access to these objects.&lt;/li&gt;
   &lt;li&gt;
      In both ways, the casting issue is covered!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   That's it for today.
&lt;/p&gt;
&lt;p&gt;
   Commets will be appriciated...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=f82907c5-5740-4bd3-9b0c-2d844c28a027" /&gt;</description>
      <category>.NET 2005;Code</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=60b3bb92-311d-4f6d-8bd8-f76677e20ea5</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,60b3bb92-311d-4f6d-8bd8-f76677e20ea5.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hi!
   </p>
        <p>
      In most of ourweb applications, we (must) use the session object, which gives us better
      way of data storing (session object lives over the HTTP protocol and exists all over
      the user's session lives {except of expiration etc...}).
   </p>
        <p>
      The access to the session objects and variables is quite easy and simple, <strong>BUT</strong>,
      what happens when you want to store your complex struct or object in the session (even
      some other system object)? <strong>THEN</strong>, you must cast this session variable,
      and check if it alives before you can access its properties etc...
   </p>
        <p>
      I have a good suggestion that also will encapsulate the sesison's variables and
      will be easy to manage, pay attention:
   </p>
        <p>
      Firstable, I created a static class, called: <strong>Repository</strong>, which will
      expose the session variables as properties, and the access to these objects will be
      much more easy and explicit.
   </p>
        <p>
      The repository static class:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Repository<br />
      {<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> SomeObject
      SessionSomeObject<br />
          {<br />
              get 
      <br />
              {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">           return</span> HttpContext.Current.Session[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObject"</span>] <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span> SomeObject;<br />
              }<br />
              set 
      <br />
              { 
      <br />
                  HttpContext.Current.Session[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObject"</span>] <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> value; 
      <br />
              }<br />
          }<br /><br />
          <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Some more properties declarations</span><br />
      }</span>
        </p>
        <p>
      (This class gathers all the session/application members = good and convenient code
      management).
   </p>
        <p>
          <strong>NOW,</strong> look at the 'old fashioned' and regular way that the sytax
      suggests us (if we don't use the Repository static class):
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (Session[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObject"</span>]
      !<span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)<br /></span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">{<br />
         myObject <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> ((SomeObject)Session[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SomeObject"</span>]).MyProperty;<br />
      }<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">else</span><br />
      {<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
      bla bla bla...</span><br />
      }</span>
        </p>
        <p>
      In the above example, we must check if the object is alive in the session firstly
      if we want to access its properties (unless we do it, it will throw us a runtime error).
      In the bottom example we cover this case with one sentense of code:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">myObject <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Repository.SessionSomeObject.MyProperty;</span>
        </p>
        <p>
      Here, even if the object is null, it will we create an instance of it and will return
      us some default value of the object's property.
   </p>
        <p>
      Have a good day...
   </p>
        <p>
      p.s.<br />
      This code relates also to the Application object!
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=60b3bb92-311d-4f6d-8bd8-f76677e20ea5" />
      </body>
      <title>Some Encapsulation (A repository for Session/Application members)</title>
      <guid>http://www.eranachum.com/PermaLink,guid,60b3bb92-311d-4f6d-8bd8-f76677e20ea5.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,60b3bb92-311d-4f6d-8bd8-f76677e20ea5.aspx</link>
      <pubDate>Thu, 19 Apr 2007 10:19:24 GMT</pubDate>
      <description>&lt;p&gt;
   Hi!
&lt;/p&gt;
&lt;p&gt;
   In most of ourweb applications, we (must) use the session object, which gives us better
   way of data storing (session object lives over the HTTP protocol and exists all over
   the user's session lives {except of expiration etc...}).
&lt;/p&gt;
&lt;p&gt;
   The access to the session objects and variables is quite easy and simple, &lt;strong&gt;BUT&lt;/strong&gt;,
   what happens when you want to store your complex struct or object in the session (even
   some other system object)? &lt;strong&gt;THEN&lt;/strong&gt;, you must cast this session variable,
   and check if it alives before you can access its properties etc...
&lt;/p&gt;
&lt;p&gt;
   I have a good suggestion that also will&amp;nbsp;encapsulate the sesison's variables and
   will be easy to manage, pay attention:
&lt;/p&gt;
&lt;p&gt;
   Firstable, I created a static class, called: &lt;strong&gt;Repository&lt;/strong&gt;, which will
   expose the session variables as properties, and the access to these objects will be
   much more easy and explicit.
&lt;/p&gt;
&lt;p&gt;
   The repository static class:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Repository&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; SomeObject
   SessionSomeObject&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get 
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; HttpContext.Current.Session[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObject"&lt;/span&gt;] &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; SomeObject;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set 
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ 
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpContext.Current.Session[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObject"&lt;/span&gt;] &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; value; 
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Some more properties declarations&lt;/span&gt;
   &lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   (This class gathers all the session/application members = good and convenient code
   management).
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;NOW,&lt;/strong&gt; look at the 'old fashioned'&amp;nbsp;and regular way that the sytax
   suggests us (if we don't use the Repository static class):
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (Session[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObject"&lt;/span&gt;]
   !&lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)&lt;br&gt;
   &lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;myObject &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; ((SomeObject)Session[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SomeObject"&lt;/span&gt;]).MyProperty;&lt;br&gt;
   }&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;else&lt;/span&gt;
   &lt;br&gt;
   {&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
   bla bla bla...&lt;/span&gt;
   &lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   In the above example, we must check if the object is alive in the session firstly
   if we want to access its properties (unless we do it, it will throw us a runtime error).
   In the bottom example we cover this case with one sentense of code:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;myObject &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Repository.SessionSomeObject.MyProperty;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   Here, even if the object is null, it will we create an instance of it and will return
   us some default value of the object's property.
&lt;/p&gt;
&lt;p&gt;
   Have a good day...
&lt;/p&gt;
&lt;p&gt;
   p.s.&lt;br&gt;
   This code relates also to the Application object!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=60b3bb92-311d-4f6d-8bd8-f76677e20ea5" /&gt;</description>
      <category>.NET 2005;Code</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=39dc1566-d318-4f47-b30c-9be4716d9087</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,39dc1566-d318-4f47-b30c-9be4716d9087.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      You can download it, it is ready, right from the oven...
   </p>
        <p>
      The best thing that I found there is the <strong>Validation Application Blocks</strong>,
      which is new and wasn't in the earlier versions.<br />
      "Developers can use this application block to create validation rules for business
      objects that can be used across different layers of their applications." (quoted form
      the msdn site).
   </p>
        <p>
      You can find it here: <a href="http://msdn2.microsoft.com/en-us/library/aa480453.aspx">http://msdn2.microsoft.com/en-us/library/aa480453.aspx</a></p>
        <p>
      Enjoy...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=39dc1566-d318-4f47-b30c-9be4716d9087" />
      </body>
      <title>Enterprise Library 3.0 is ready to download</title>
      <guid>http://www.eranachum.com/PermaLink,guid,39dc1566-d318-4f47-b30c-9be4716d9087.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,39dc1566-d318-4f47-b30c-9be4716d9087.aspx</link>
      <pubDate>Wed, 11 Apr 2007 08:40:47 GMT</pubDate>
      <description>&lt;p&gt;
   You can download it, it is ready, right from the oven...
&lt;/p&gt;
&lt;p&gt;
   The best thing that I found there is the &lt;strong&gt;Validation Application Blocks&lt;/strong&gt;,
   which is new and wasn't in the earlier versions.&lt;br&gt;
   "Developers can use this application block to create validation rules for business
   objects that can be used across different layers of their applications." (quoted form
   the msdn site).
&lt;/p&gt;
&lt;p&gt;
   You can find it here: &lt;a href="http://msdn2.microsoft.com/en-us/library/aa480453.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa480453.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
   Enjoy...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=39dc1566-d318-4f47-b30c-9be4716d9087" /&gt;</description>
      <category>.NET 2005;Code</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=8faf9f85-580f-4ea7-be84-401f3230ea47</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,8faf9f85-580f-4ea7-be84-401f3230ea47.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hey guys how are you?
   </p>
        <p>
      I wanted to share you with nice dillema that was raised by one of our team leaders,
      called: <strong>Boaz Davidoff.<br /></strong>He encountered with a situation that he wanted to create new instance of
      an object that inherits from a parent object (which is no problem right...?), <u>BUT</u> firstly
      he wanted to initiate some members in the child object before of creating the parent
      object and just after it to call the parent object constructor.
   </p>
        <p>
      It turns out that this situation is quite impossible in .NET, because by default,
      you must call the base ctor firstly and just after it to do your stuff, for an example:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> A<br />
      {<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> a1,
      a2;<br /><br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span> A(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> a1, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> a2)<br />
          {<br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.a1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> a1;<br />
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.a2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> a2;<br /><br />
              <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Do your stuff</span><br />
          }<br />
      }<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> B
      : A<br />
      {<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span> B(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> b1, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> b2)
      : <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">base</span>(b1,
      b2)<br />
          {<br />
              <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Do your stuff</span><br />
          }<br />
      }</span>
        </p>
        <p>
      I wanted here, by calling B ctor, to make some manipulations over b1 and b2 (before
      calling the base ctor), but encountered with a <strong>PROBLEM.</strong></p>
        <p>
      So, take a look on this solution:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> B
      CreateBObject(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> c1, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> c2)<br />
      {<br />
          <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Do some manipulation over c1 and c2</span><br /><br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> B(c1,
      c2);<br />
      }<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span> B(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> b1, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> b2)
      : <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">base</span>(b1,
      b2) 
      <br />
      { 
      <br />
          <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Do the rest of your stuff</span><br />
      }</span>
        </p>
        <p>
          <u>Some explanations:<br /></u>I created again B ctor, which the only different from the other B ctor is by that
      it is <strong>private </strong>(in other words: this object cannot be initialize from
      outside this class). 
      <br />
      Now, the addition... I added a static method called <font face="Courier New">CreateBObject, </font><font face="Verdana">which
      receives the same params, does some manipulation over them, after it calls the B's
      private ctor and returns B object like we wanted in the first time.</font></p>
        <p>
      Nice, huhh? I would like to have some comments
   </p>
        <p>
      p.s.<br />
      Thanks Boaz
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=8faf9f85-580f-4ea7-be84-401f3230ea47" />
      </body>
      <title>Parent &amp; Child Constructors Initiation Flow</title>
      <guid>http://www.eranachum.com/PermaLink,guid,8faf9f85-580f-4ea7-be84-401f3230ea47.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,8faf9f85-580f-4ea7-be84-401f3230ea47.aspx</link>
      <pubDate>Sun, 25 Mar 2007 15:33:02 GMT</pubDate>
      <description>&lt;p&gt;
   Hey guys how are you?
&lt;/p&gt;
&lt;p&gt;
   I wanted to share you with nice dillema that was raised by one of our team leaders,
   called: &lt;strong&gt;Boaz Davidoff.&lt;br&gt;
   &lt;/strong&gt;He encountered with a situation that he wanted to create new instance of
   an object that inherits from a parent object (which is no problem right...?), &lt;u&gt;BUT&lt;/u&gt; firstly
   he wanted to initiate some members in the child object before of creating the parent
   object and just after it to call the parent object constructor.
&lt;/p&gt;
&lt;p&gt;
   It turns out that this situation is quite impossible in .NET, because by default,
   you must call the base ctor firstly and just after it to do your stuff, for an example:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; A&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; a1,
   a2;&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; A(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; a1, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; a2)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.a1 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; a1;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.a2 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; a2;&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Do your stuff&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; B
   : A&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; B(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; b1, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; b2)
   : &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/span&gt;(b1,
   b2)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Do your stuff&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   I wanted here, by calling B ctor, to make some manipulations over b1 and b2 (before
   calling the base ctor), but encountered with a &lt;strong&gt;PROBLEM.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   So, take a look&amp;nbsp;on this solution:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; B
   CreateBObject(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; c1, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; c2)&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Do some manipulation over c1 and c2&lt;/span&gt;
   &lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; B(c1,
   c2);&lt;br&gt;
   }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; B(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; b1, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; b2)
   : &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/span&gt;(b1,
   b2) 
   &lt;br&gt;
   { 
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Do the rest of your stuff&lt;/span&gt;
   &lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;u&gt;Some explanations:&lt;br&gt;
   &lt;/u&gt;I created again B ctor, which the only different from the other B ctor is by that
   it is &lt;strong&gt;private &lt;/strong&gt;(in other words:&amp;nbsp;this object cannot be initialize&amp;nbsp;from
   outside this class). 
   &lt;br&gt;
   Now, the addition... I added a static method called &lt;font face="Courier New"&gt;CreateBObject, &lt;/font&gt;&lt;font face=Verdana&gt;which
   receives the same params, does some manipulation over them, after it calls the B's
   private ctor and returns B object like we wanted in the first time.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   Nice, huhh? I would like to have some comments
&lt;/p&gt;
&lt;p&gt;
   p.s.&lt;br&gt;
   Thanks Boaz
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=8faf9f85-580f-4ea7-be84-401f3230ea47" /&gt;</description>
      <category>Code</category>
    </item>
  </channel>
</rss>