<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rakeshkv&#039;s Blog</title>
	<atom:link href="http://rakeshkv.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rakeshkv.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 07 Nov 2011 06:15:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rakeshkv.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rakeshkv&#039;s Blog</title>
		<link>http://rakeshkv.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rakeshkv.wordpress.com/osd.xml" title="Rakeshkv&#039;s Blog" />
	<atom:link rel='hub' href='http://rakeshkv.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Singleton in C#</title>
		<link>http://rakeshkv.wordpress.com/2011/11/06/singleton/</link>
		<comments>http://rakeshkv.wordpress.com/2011/11/06/singleton/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 18:40:12 +0000</pubDate>
		<dc:creator>rakeshkv</dc:creator>
				<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://rakeshkv.wordpress.com/?p=46</guid>
		<description><![CDATA[Singleton Pattern, as Defined in , http://www.oodesign.com/singleton-pattern.html, is to maintain only instance of the class. It means that the state of the object should be the same across the application you are using. Object&#8217;s state is maintained in their instance members. Let me explain this by an example: class Singleton {  public int count { get; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=46&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Singleton Pattern</strong>, as Defined in , <a href="http://www.oodesign.com/singleton-pattern.html">http://www.oodesign.com/singleton-pattern.html</a>, is to maintain only instance of the class.</p>
<p>It means that the state of the object should be the same across the application you are using. Object&#8217;s state is maintained in their instance members.</p>
<p>Let me explain this by an example:</p>
<pre>  <strong>class Singleton</strong>
<strong> {  public int count { get; set; }</strong>
<strong> } </strong>
<strong> Let me create two references of this class.   </strong>
<strong>class Program</strong>
<strong> {</strong>
<strong> static void Main(string[] args)</strong>
<strong> {</strong>
<strong> Singleton firstSingleton = new Singleton();</strong>
<strong> Singleton secondSingleton = new Singleton(); </strong>
<strong> firstSingleton.count = 1;</strong>
<strong> if (firstSingleton.count == secondSingleton.count)</strong>
<strong> {</strong>
<strong> Console.WriteLine("Singleton Implemented");</strong>
<strong> }</strong>
<strong> else Console.WriteLine("Singleton Not Implemented");</strong>

<strong> Console.ReadLine();</strong>

<strong> }</strong>

When you run the above code, you will see this :
"<strong><em>Singleton Not Implemented</em></strong>"

When i do this, firstSingleton.count = 1, i am setting the instance member of the class to 1. To maintain the same state of
instance of this class, the value for this member should be the same for all the references.
But in the above code, it is not.
Reason being, the references are referring to two different objects. In order to restrict and have the same object
referred by these references, the use of new() operator on this class should be restricted outside of this class.
We do this by making the constructor private. private , access modifier, on the constructor will break the above code
as you will not be able to create instance of this class outside.

 Modified code:
 <strong>class Program</strong>
<strong> {</strong>
<strong> static void Main(string[] args)</strong>
<strong> {</strong>
<strong> Singleton firstSingleton = Singleton.SameSingleton;</strong>
<strong> Singleton secondSingleton = Singleton.SameSingleton;</strong>

<strong> firstSingleton.count = 1;</strong>
<strong> if (firstSingleton.count == secondSingleton.count)</strong>
<strong> {</strong>
<strong> Console.WriteLine("Singleton Implemented");</strong>
<strong> }</strong>
<strong> else Console.WriteLine("Singleton Not Implemented");</strong>

<strong> Console.ReadLine();</strong>

<strong> }</strong>

<strong> } class Singleton</strong>
<strong> {</strong>
<strong> public int count { get; set; }</strong>
<strong> /* In order to maintain the same state for any reference to instance of this , you need to return the same instance</strong>
<strong> The use of new operator on this class should be restricted in outside class.</strong>
<strong> So Create one instance in the same class and return it.</strong>
<strong> */</strong>
<strong> public static readonly Singleton SameSingleton = new Singleton();</strong>

<strong> private Singleton()</strong>
<strong> {</strong>

<strong> }</strong>

<strong> }</strong>
In the above modified code, an instance of this class is created and is made static for it to be accessed outside
as the constructor is now made private.
With this code, only one instance of this object is used across the whole application and state of this object
will be the same. So when you do,
firstSingleton.count = 1;
the count variable value will be the same for secondSingleton reference. 

You will see this message when you run above code:
"<strong><em>Singleton Implemented</em></strong>".
<strong>Things to remember</strong>:</pre>
<ul>
<li>Restrict the use of new() on this class outside this class.</li>
<li>Create the instance of the class inside this class</li>
<li>Make the constructor private to not allow to creation of instance outside.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshkv.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshkv.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshkv.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshkv.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshkv.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshkv.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshkv.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshkv.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=46&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshkv.wordpress.com/2011/11/06/singleton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/697676b2aaf60544dd016a7d86082b61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakeshkv</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Ado.Net Entity framework</title>
		<link>http://rakeshkv.wordpress.com/2010/08/10/using-ado-net-entity-framework/</link>
		<comments>http://rakeshkv.wordpress.com/2010/08/10/using-ado-net-entity-framework/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 17:08:00 +0000</pubDate>
		<dc:creator>rakeshkv</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rakeshkv.wordpress.com/?p=43</guid>
		<description><![CDATA[In layered applications, we separate applications as Data Access, Business and UI Layers. Generally, having different class library projects for Data Access and Business. In order to leverage this, we place so created Entity Framework model off from a database in Data Access Project. For the Business layer in order to have access to Entity [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=43&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In layered applications, we separate applications as Data Access, Business and UI Layers. Generally, having different class library projects for Data Access and Business. In order to leverage this, we place so created Entity Framework model off from a database in Data Access Project.</p>
<p>For the Business layer in order to have access to Entity classes we need to do three things in the Business layer.</p>
<ul>
<li>Add Reference of Data Access Project to your Business Layer</li>
<li>Add System.Data.Entity reference to your Business Layer</li>
<li>Copy the config section of the app.config from the data access to your app.config of your Business layer.</li>
</ul>
<p>With these three things in place, you should be good to go.</p>
<p>Reference :  http://msdn.microsoft.com/en-us/data/ff628208.aspx</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshkv.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshkv.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshkv.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshkv.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshkv.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshkv.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshkv.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshkv.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=43&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshkv.wordpress.com/2010/08/10/using-ado-net-entity-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/697676b2aaf60544dd016a7d86082b61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakeshkv</media:title>
		</media:content>
	</item>
		<item>
		<title>Web Deployment on IIS 7.0</title>
		<link>http://rakeshkv.wordpress.com/2009/11/03/web-deployment-on-iis-7-0/</link>
		<comments>http://rakeshkv.wordpress.com/2009/11/03/web-deployment-on-iis-7-0/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 22:04:09 +0000</pubDate>
		<dc:creator>rakeshkv</dc:creator>
				<category><![CDATA[Asp.Net MVC]]></category>
		<category><![CDATA[Web Setup]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://rakeshkv.wordpress.com/?p=31</guid>
		<description><![CDATA[I tried to install a ASP.NET MVC 2 application on IIS 7.0/Windows Server 2008.  I created a web set up project for it. Whenever i try to run the installer, it fails as it just exits the installation. &#160; I check the Eventviewer&#62;WindowsLogs&#62;Application, installer gives me this following error: Windows Installer installed the product. Product [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=31&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried to install a ASP.NET MVC 2 application on IIS 7.0/Windows Server 2008.  I created a web set up project for it. Whenever i try to run the installer, it fails as it just exits the installation.</p>
<p>&nbsp;</p>
<p>I check the Eventviewer&gt;WindowsLogs&gt;Application, installer gives me this following error:</p>
<p><strong>Windows Installer installed the product. Product Name:&lt;<em>mysetupname</em>&gt;. Product Version: 1.0.0. Product Language: 1033. Installation success or error status: 1602.</strong></p>
<p>So i googled this error and found in <a href="http://www.nitiative.com/portal/Home/tabid/36/EntryId/15/IIS7-Web-Setup-Install-Error-Status-1603.aspx">here</a> that IIS 7.0 requires a IIS 6.0 metabase backward compatibility role service features added to run a web setup.</p>
<p>The major reason is IIS 6.0 configures all the information in a metabase whereas IIS 7.0 configures it in form of XML.  The web setup requires the metabase feature. The web set up is created using Web Setup Deployment template from Visual Studio 2008.</p>
<p>The  web setup worked fine on IIS 6.0/Windows Server 2003.</p>
<p>To add IIS 6 Metabase Compatibility components on IIS 7. </p>
<p>    *  Click Start, click Administrative Tools and then Server Manager.<br />
    * In the left navigation pane, expand Roles, and then right-click Web Server (IIS) and select Add Role Services.<br />
    * On the Select Role Services pane, scroll down to IIS 6 Management Compatibility.<br />
    * Select the check boxes for IIS 6 Metabase Compatibility and IIS 6 Management Console.<br />
    * Click Next from the Select Role Services pane, and then click Install at the Confirm Installations Selections pane.<br />
    * Click Close to leave the Add Role Services wizard.</p>
<p>Source : <a href="http://www.activexperts.com/support/activmonitor/online/ii6metabase/">http://www.activexperts.com/support/activmonitor/online/ii6metabase</a></p>
<p>More information on this can be found on <a href="http://learn.iis.net/page.aspx/125/metabase-compatibility-with-iis-7/">http://learn.iis.net/page.aspx/125/metabase-compatibility-with-iis-7/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshkv.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshkv.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshkv.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshkv.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshkv.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshkv.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshkv.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshkv.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=31&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshkv.wordpress.com/2009/11/03/web-deployment-on-iis-7-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/697676b2aaf60544dd016a7d86082b61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakeshkv</media:title>
		</media:content>
	</item>
		<item>
		<title>Coalesce in T-Sql</title>
		<link>http://rakeshkv.wordpress.com/2009/10/01/coalesce-in-t-sql/</link>
		<comments>http://rakeshkv.wordpress.com/2009/10/01/coalesce-in-t-sql/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 14:41:01 +0000</pubDate>
		<dc:creator>rakeshkv</dc:creator>
				<category><![CDATA[Sql]]></category>

		<guid isPermaLink="false">http://rakeshkv.wordpress.com/?p=20</guid>
		<description><![CDATA[Colaesce(expression,.) function in T-Sql is cool.. It helps to compare for null values and return not null.  I used it check for a column value to  null or not For example Coalesce(column1, &#8216;  &#8216;) gives you empty string if column1 is null, if column1 is not null it returns column 1 value<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=20&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Colaesce(expression,.) function in T-Sql is cool..</p>
<p>It helps to compare for null values and return not null.  I used it check for a column value to  null or not</p>
<p>For example</p>
<p>Coalesce(column1, &#8216;  &#8216;) gives you empty string if column1 is null, if column1 is not null it returns column 1 value</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshkv.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshkv.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshkv.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshkv.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshkv.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshkv.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshkv.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshkv.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshkv.wordpress.com&amp;blog=9113965&amp;post=20&amp;subd=rakeshkv&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshkv.wordpress.com/2009/10/01/coalesce-in-t-sql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/697676b2aaf60544dd016a7d86082b61?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakeshkv</media:title>
		</media:content>
	</item>
	</channel>
</rss>
