<?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>Sunil&#039;s Playground</title>
	<atom:link href="http://sunild79.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunild79.wordpress.com</link>
	<description>Simple solutions for complex problems</description>
	<lastBuildDate>Mon, 21 Sep 2009 04:42:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sunild79.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sunil&#039;s Playground</title>
		<link>http://sunild79.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sunild79.wordpress.com/osd.xml" title="Sunil&#039;s Playground" />
	<atom:link rel='hub' href='http://sunild79.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Xbox style Tab Controls in WPF</title>
		<link>http://sunild79.wordpress.com/2009/09/11/xbox-style-tab-controls-in-wpf/</link>
		<comments>http://sunild79.wordpress.com/2009/09/11/xbox-style-tab-controls-in-wpf/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 06:02:44 +0000</pubDate>
		<dc:creator>sunild79</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Elastic animation]]></category>
		<category><![CDATA[Tab Controls]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Xbox style Tab Controls in WPF]]></category>

		<guid isPermaLink="false">http://sunild79.wordpress.com/?p=21</guid>
		<description><![CDATA[Hi, It has been long since i was thinking of putting these controls on net. I&#8217;ve named it as Funky Tab Control. The control renders the Tab Header section on the left. The Header of the selected Tab Item moves upwards using Elastic In Out animation. The color also changes to red. The content on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=21&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>It has been long since i was thinking of putting these controls on net. I&#8217;ve named it as Funky Tab Control. The control renders the Tab Header section on the left. The Header of the selected Tab Item moves upwards using Elastic In Out animation. The color also changes to red.</p>
<p>The content on the right also changes using a similar animation horizontally. The screen looks like:</p>
<div class="mceTemp"><img class="alignnone size-large wp-image-25" title="Funky Tab Control" src="http://sunild79.files.wordpress.com/2009/09/funky-tab-control1.jpg?w=748&#038;h=650" alt="Funky Tab Control" width="748" height="650" /></div>
<p> </p>
<p>The controls can be used that same way as tab controls.<br />
1. Add the reference to the Funky Controls assembly.<br />
2. Add reference to your window/Page/User Controls lile<br />
<code>xmlns:ft="clr-namespace:FunkyTabs;assembly=FunkyTabs"<br />
</code><br />
3. Create control like a tab control<br />
 <br />
&lt;Grid x:Name=&#8221;LayoutRoot&#8221;&gt;<br />
        &lt;ft:FunkyTabControl&gt;<br />
            &lt;ft:FunkyTabItem x:Name=&#8221;T1&#8243; IsSelected=&#8221;True&#8221; Header=&#8221;T1&#8243; &gt;<br />
                &lt;TextBlock FontFamily=&#8221;Arial&#8221; FontSize=&#8221;48&#8243; VerticalAlignment=&#8221;Center&#8221;<br />
                           HorizontalAlignment=&#8221;Center&#8221;&gt;Tab 1&lt;/TextBlock&gt;<br />
            &lt;/ft:FunkyTabItem&gt;<br />
            &lt;ft:FunkyTabItem x:Name=&#8221;T2&#8243; Header=&#8221;T2&#8243; &gt;<br />
                &#8230;.<br />
            &lt;/ft:FunkyTabItem&gt;<br />
            &lt;ft:FunkyTabItem x:Name=&#8221;T3&#8243; Header=&#8221;T3&#8243; &gt;<br />
                &#8230;.<br />
            &lt;/ft:FunkyTabItem&gt;<br />
        &lt;/ft:FunkyTabControl&gt;<br />
    &lt;/Grid&gt; </p>
<p>The link below allows you to download the sample:</p>
<p><a href="http://cid-b3dbeec391c45395.skydrive.live.com/self.aspx/Public/Source%20Code/FunkyTabs.zip">http://cid-b3dbeec391c45395.skydrive.live.com/self.aspx/Public/Source%20Code/FunkyTabs.zip</a></p>
<p>Next in line should be Mac Style Dock skins for Menu controls in WPF&#8230;.<br />
Please feel free to share your thoughts on the blog.</p>
<p>Enjoy!!!</p>
<p>Sunil</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunild79.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunild79.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunild79.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunild79.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunild79.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunild79.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunild79.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunild79.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=21&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunild79.wordpress.com/2009/09/11/xbox-style-tab-controls-in-wpf/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/159169c177ac3bb8917725abde1f5af0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunild79</media:title>
		</media:content>

		<media:content url="http://sunild79.files.wordpress.com/2009/09/funky-tab-control1.jpg?w=1024" medium="image">
			<media:title type="html">Funky Tab Control</media:title>
		</media:content>
	</item>
		<item>
		<title>Multi-touch photoboard in WPF</title>
		<link>http://sunild79.wordpress.com/2009/05/31/multi-touch-photoboard-in-wpf/</link>
		<comments>http://sunild79.wordpress.com/2009/05/31/multi-touch-photoboard-in-wpf/#comments</comments>
		<pubDate>Sun, 31 May 2009 05:06:34 +0000</pubDate>
		<dc:creator>sunild79</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Multi-touch]]></category>
		<category><![CDATA[Muti-touch in windows]]></category>
		<category><![CDATA[NUI]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Multi-touch in Windows]]></category>
		<category><![CDATA[Multi-touch using WPF]]></category>
		<category><![CDATA[Multitouch]]></category>

		<guid isPermaLink="false">http://sunild79.wordpress.com/?p=13</guid>
		<description><![CDATA[I found this cool multi touch library for WPF(http://www.codeplex.com/MultiTouchVista). Check out how simple is it to create a photoboard. Download code from here - Attach two mice to your computer - Copy some pictures to your &#8220;My Pictures&#8221; folder - Execute WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.exe - Please close the multi-touch service(opens as console app) after this. Note: You [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=13&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found this cool multi touch library for WPF(http://www.codeplex.com/MultiTouchVista). Check out how simple is it to create a photoboard.</p>
<p>Download code from <a href="http://cid-b3dbeec391c45395.skydrive.live.com/self.aspx/Public/Source%20Code/WpfApplication1.zip">here</a></p>
<p>- Attach two mice to your computer<br />
- Copy some pictures to your &#8220;My Pictures&#8221; folder<br />
- Execute WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.exe<br />
- Please close the multi-touch service(opens as console app) after this.</p>
<p>Note: You need .NET framework 3.5 installed.</p>
<p>Enjoy!</p>
<p>Sunil</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunild79.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunild79.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunild79.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunild79.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunild79.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunild79.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunild79.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunild79.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=13&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunild79.wordpress.com/2009/05/31/multi-touch-photoboard-in-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/159169c177ac3bb8917725abde1f5af0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunild79</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple designs to solve enterprise problems &#8211; design and code to support multiple databases</title>
		<link>http://sunild79.wordpress.com/2008/07/05/simple-designs-to-solve-enterprise-problems-design-and-code-to-support-multiple-databases/</link>
		<comments>http://sunild79.wordpress.com/2008/07/05/simple-designs-to-solve-enterprise-problems-design-and-code-to-support-multiple-databases/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 15:19:57 +0000</pubDate>
		<dc:creator>sunild79</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Enterprise Applications]]></category>
		<category><![CDATA[queries in resource files]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[design to support multiple databases]]></category>
		<category><![CDATA[enterprise app design]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[queries]]></category>
		<category><![CDATA[resource files]]></category>
		<category><![CDATA[store queries in resource files]]></category>
		<category><![CDATA[supporting multiple databases through code]]></category>

		<guid isPermaLink="false">http://sunild79.wordpress.com/?p=7</guid>
		<description><![CDATA[The design intends to solve the following problems:   1. SQL Queries written in data access code is generally full with string concatenation which makes it difficult to read and un-maintainable as it grows   2. It gets even more difficult when your code supports multiple database server products and the queries are written in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=7&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;">The design intends to solve the following problems:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;">1. SQL Queries written in data access code is generally full with string concatenation which makes it difficult to read and un-maintainable as it grows</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;">2. It gets even more difficult when your code supports multiple database server products and the queries are written in your data access code.</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;">To solve these problems we need to do the following</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#000000;">1. Add a class called SQLHelper:</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;">Imports</span><span style="font-size:10pt;"> System</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;">Imports</span><span style="font-size:10pt;"> System.Collections</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;">Imports</span><span style="font-size:10pt;"> System.Reflection</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;">Imports</span><span style="font-size:10pt;"> System.Configuration</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;">Friend</span><span style="font-size:10pt;"> <span style="color:#0000ff;">Class</span> SQLHelper</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Private</span> <span style="color:#0000ff;">Shared</span> htQueries <span style="color:#0000ff;">As</span> Hashtable = <span style="color:#0000ff;">New</span> Hashtable</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Private</span> <span style="color:#0000ff;">Shared</span> mExtension <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Private</span> <span style="color:#0000ff;">Const</span> CURRENT_EXTENSION <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span> = &#8220;CURRENT_EXTENSION&#8221;</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Private</span> <span style="color:#0000ff;">Const</span> DEFAULT_EXTENSION <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span> = &#8220;.sql.qry&#8221;</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Sub</span> <span style="color:#0000ff;">New</span>()</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">If</span> <span style="color:#0000ff;">Not</span> ConfigurationSettings.AppSettings.Item(CURRENT_EXTENSION) <span style="color:#0000ff;">Is</span> <span style="color:#0000ff;">Nothing</span> <span style="color:#0000ff;">Then</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span>mExtension = ConfigurationSettings.AppSettings.Item(CURRENT_EXTENSION)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Return</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">If</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span>mExtension = DEFAULT_EXTENSION</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Sub</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">ReadOnly</span> <span style="color:#0000ff;">Property</span> Extension() <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Get</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Return</span> mExtension</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Get</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Property</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetQueryString(<span style="color:#0000ff;">ByVal</span> CurrentAssembly <span style="color:#0000ff;">As</span> [Assembly], <span style="color:#0000ff;">ByVal</span> FileName <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Dim</span> key <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span> = GetKey(CurrentAssembly, FileName)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Return</span> GetEmbeddedQuery(key)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetQueryString(<span style="color:#0000ff;">ByVal</span> FileName <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Dim</span> CurrentlyAssembly <span style="color:#0000ff;">As</span> [Assembly] = Reflection.Assembly.GetExecutingAssembly()</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Return</span> GetQueryString(CurrentlyAssembly, FileName)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetQueryString(<span style="color:#0000ff;">ByVal</span> FileName <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>, <span style="color:#0000ff;">ByVal</span> args() <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Dim</span> SQL <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span> = GetQueryString(FileName)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Return</span> <span style="color:#0000ff;">String</span>.Format(SQL, args)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Private</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetKey(<span style="color:#0000ff;">ByVal</span> CurrentAssembly <span style="color:#0000ff;">As</span> [Assembly], <span style="color:#0000ff;">ByVal</span> FileName <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Dim</span> TheNamespace <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span> = <span style="color:#0000ff;">GetType</span>(SQLHelper).Namespace</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">If</span> TheNamespace <span style="color:#0000ff;">Is</span> <span style="color:#0000ff;">Nothing</span> <span style="color:#0000ff;">OrElse</span> Trim(TheNamespace) = &#8220;&#8221; <span style="color:#0000ff;">Then</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Return</span> FileName</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Else</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Return</span> TheNamespace &amp; &#8220;.&#8221; &amp; FileName</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">If</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetEmbeddedQuery(<span style="color:#0000ff;">ByVal</span> FullPath <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Dim</span> CurrentlyAssembly <span style="color:#0000ff;">As</span> [Assembly] = Reflection.Assembly.GetExecutingAssembly()</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Return</span> GetEmbeddedFileAsString(CurrentlyAssembly, FullPath)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Private</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetEmbeddedFileAsString(<span style="color:#0000ff;">ByVal</span> CurrentAssembly <span style="color:#0000ff;">As</span> [Assembly], <span style="color:#0000ff;">ByVal</span> key <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">SyncLock</span> (htQueries)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Dim</span> SQL <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">If</span> htQueries.Item(key) <span style="color:#0000ff;">Is</span> <span style="color:#0000ff;">Nothing</span> <span style="color:#0000ff;">Then</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">Dim</span> FullPath <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span> = key &amp; mExtension</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span>SQL = GetEmbeddedResourceAsString(CurrentAssembly, FullPath)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span>htQueries.Add(key, SQL)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">If</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">SyncLock</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Return</span> <span style="color:#0000ff;">CType</span>(htQueries.Item(key), <span style="color:#0000ff;">String</span>)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Shared</span> <span style="color:#0000ff;">Function</span> GetEmbeddedResourceAsString(<span style="color:#0000ff;">ByVal</span> CurrentAssembly <span style="color:#0000ff;">As</span> [Assembly], <span style="color:#0000ff;">ByVal</span> FullPath <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span>) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Dim</span> ResultStream <span style="color:#0000ff;">As</span> System.IO.Stream = CurrentAssembly.GetManifestResourceStream(FullPath)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">If</span> <span style="color:#0000ff;">Not</span> ResultStream <span style="color:#0000ff;">Is</span> <span style="color:#0000ff;">Nothing</span> <span style="color:#0000ff;">Then</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Try</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">Dim</span> intStreamLen <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">Integer</span> = <span style="color:#0000ff;">CType</span>(ResultStream.Length, <span style="color:#0000ff;">Integer</span>)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">Dim</span> ByteArray(intStreamLen &#8211; 1) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">Byte</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span>ResultStream.Read(ByteArray, 0, intStreamLen)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">Return</span> System.Text.Encoding.UTF8.GetString(ByteArray)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Catch</span> e <span style="color:#0000ff;">As</span> Exception</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">Throw</span> <span style="color:#0000ff;">New</span> Exception(&#8220;Error reading resource&#8221;, e)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Finally</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">If</span> <span style="color:#0000ff;">Not</span> ResultStream <span style="color:#0000ff;">Is</span> <span style="color:#0000ff;">Nothing</span> <span style="color:#0000ff;">Then</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                    </span>ResultStream.Close()</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>                </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">If</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Try</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">Else</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>            </span><span style="color:#0000ff;">Throw</span> <span style="color:#0000ff;">New</span> Exception(&#8220;Resource not found&#8221;)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>        </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">If</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;"><span>    </span><span style="color:#0000ff;">End</span> <span style="color:#0000ff;">Function</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;"> </span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0;"><span style="font-size:10pt;color:#0000ff;">End</span><span style="font-size:10pt;"> <span style="color:#0000ff;">Class</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;"> </span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:10pt;line-height:115%;"> </span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:10pt;line-height:115%;">The code written above contains the following:</span></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span style="font-size:10pt;line-height:115%;"><span>1.<span style="font:7pt;">     </span></span></span></p>
<div class="MsoListParagraphCxSpFirst" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span style="font-size:10pt;line-height:115%;">mExtension: This member stores the default extension for the query files. The query files need to be stored in your data access project as embedded resources. You can keep multiple extensions for supporting multiple database products.<br />
For ex. you have an extension “.sql.qry” for SQL Server/T-SQL “.ora.qry” for Oracle/PL-SQL</span></div>
<p><span style="font-size:10pt;line-height:115%;"> </p>
<p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span style="font-size:10pt;line-height:115%;"><span>2.<span style="font:7pt;">     </span></span></span></p>
<div class="MsoListParagraphCxSpMiddle" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span style="font-size:10pt;line-height:115%;">htQueries: This member is used to cache string from a query file once it is retrieved. This will prevent your code from calling expensive reflection code for retrieving each and every query.</span></div>
<p><span style="font-size:10pt;line-height:115%;"> </p>
<p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span style="font-size:10pt;line-height:115%;"><span>3.<span style="font:7pt;">     </span></span></span></p>
<div class="MsoListParagraphCxSpMiddle" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span style="font-size:10pt;line-height:115%;">GetQueryString(FileName as string): This is a method which takes the query file name as a parameter, retrieves the file from the assembly, reads the string and returns the query.</span></div>
<p><span style="font-size:10pt;line-height:115%;"> </p>
<p></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent:-0.25in;margin:0 0 10pt 0.5in;"><span style="font-size:10pt;line-height:115%;"><span>4.<span style="font:7pt;">     </span></span></span></p>
<div class="MsoListParagraphCxSpLast" style="text-indent:-0.25in;margin:0 0 10pt 0.5in;"><span style="font-size:10pt;line-height:115%;">GetQueryString(FileName as string, args() as string): This method is meant to help you pass parameters in an easy, yet powerful way. Following example shows a sample query string and how to pass parameters to it.</span></div>
<p><span style="font-size:10pt;line-height:115%;">Sample query string:<br />
<span style="background:#fbd4b4;"><br />
SELECT * FROM CUSTOMER WHERE FNAME LIKE ‘{0}’ AND LNAME LIKE ‘{1}’<br />
</span><br />
Sample code to pass parameters or prepare queries:</p>
<p> </p>
<p></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0 0 0 0.5in;"><span style="font-size:10pt;"><br />
</span><span style="font-size:10pt;color:#0000ff;">Dim</span><span style="font-size:10pt;"> sParamArray(2) <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">String</span></span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0 0 0 0.5in;"><span style="font-size:10pt;">sParamArray.SetValue(“Sukanya”, 0)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0 0 0 0.5in;"><span style="font-size:10pt;">sParamArray.SetValue(“Singh”, 1)</span></p>
<p class="MsoNormal" style="background:#fbd4b4;line-height:normal;margin:0 0 0 0.5in;"><span style="font-size:10pt;">SQLHelper.GetQueryString(“GetCustomerByName”,sParamArray)</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;">To use the code shown above, </span></span></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span><span><span style="font-size:small;">1.</span><span style="font:7pt;">    </span></span></span><span><span style="font-size:small;">Add text files to your data access project. </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span><span><span style="font-size:small;">2.</span><span style="font:7pt;">    </span></span></span><span><span style="font-size:small;">Rename its extension to “.sql.qry” or whichever appropriate.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent:-0.25in;margin:0 0 0 0.5in;"><span><span><span style="font-size:small;">3.</span><span style="font:7pt;">    </span></span></span><span><span style="font-size:small;">Add your query to this file.</span></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent:-0.25in;margin:0 0 10pt 0.5in;"><span><span><span style="font-size:small;">4.</span><span style="font:7pt;">    </span></span></span><span><span style="font-size:small;">Call the query from your data access code. No need to write long code from creating command and passing parameters.</span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;">Let me know if it works for you.</span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;">Thanks and have fun!!!</span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span><span style="font-size:small;"> </span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sunild79.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sunild79.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunild79.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunild79.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunild79.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunild79.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunild79.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunild79.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunild79.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunild79.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=7&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunild79.wordpress.com/2008/07/05/simple-designs-to-solve-enterprise-problems-design-and-code-to-support-multiple-databases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/159169c177ac3bb8917725abde1f5af0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunild79</media:title>
		</media:content>
	</item>
		<item>
		<title>Do you use Information Expert?</title>
		<link>http://sunild79.wordpress.com/2008/03/08/do-you-use-information-expert/</link>
		<comments>http://sunild79.wordpress.com/2008/03/08/do-you-use-information-expert/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 16:53:02 +0000</pubDate>
		<dc:creator>sunild79</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[OOAD]]></category>
		<category><![CDATA[Craig Larman]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[GRASP]]></category>
		<category><![CDATA[Information Expert]]></category>

		<guid isPermaLink="false">http://sunild79.wordpress.com/?p=5</guid>
		<description><![CDATA[I&#8217;ve been recently involved in design as many of the teams I&#8217;ve been working with are starting newer projects. As we get on to design we had a lot of mention of using design patterns especially GOF(Gang Of Four). One of the common problems I&#8217;ve faced using GOF is that it really does not fit every [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=5&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sunild79.files.wordpress.com/2008/03/lightbulb_small.gif" title="Light Bulb"></a><a href="http://sunild79.files.wordpress.com/2008/03/lightbulb_small.gif" title="Light Bulb"><img src="http://sunild79.files.wordpress.com/2008/03/lightbulb_small.gif?w=510" alt="Light Bulb" /></a></p>
<p>I&#8217;ve been recently involved in design as many of the teams I&#8217;ve been working with are starting newer projects. As we get on to design we had a lot of mention of using design patterns especially <a target="_blank" href="http://en.wikipedia.org/wiki/Design_Patterns" title="Gang Of Four">GOF(Gang Of Four)</a>.</p>
<p>One of the common problems I&#8217;ve faced using GOF is that it really does not fit every scenario especially when it comes to object modeling. It also does not tell me which object should do what all functions/responsibilities. It is also easy for developers with relatively lesser experience to forget about basic design principles like Low Coupling, High Cohesion, Modular Design while concentrating too much on design patterns.  </p>
<p>Few years back I had a chance to work with an Architect, who trained us on some very basic principles of design and code. One such concept I learned was <strong><a target="_blank" href="http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)" title="GRASP - Information Expert">Information Expert Pattern</a></strong>. </p>
<p>It has since then served as a guiding principle, whenever i get in to design. It states that responsibility should be assigned to the <strong>information expert</strong>—the class that has all the necessary information.</p>
<p>Information expert not only enables you to keep the design simple, it also makes it a lot more easier to write code for reuse if followed religiously throughout the design.</p>
<p>The details of this can be found in the book <em>Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development</em>  by <a href="http://en.wikipedia.org/wiki/Craig_Larman" title="Craig Larman">Craig Larman</a>.</p>
<p>Some other references :</p>
<ul>
<li>
<div><a href="http://books.google.co.in/books?id=r8i-4En_aa4C&amp;pg=PP3&amp;vq=information+Expert&amp;dq=information+expert&amp;source=gbs_search_s&amp;sig=QXrlDoCUNrynJ3Tzv94A3OPKDcg#PPR7,M1" title="Book Preview">Google Book Preview</a></div>
</li>
<li>
<div><a href="http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx" title="Interesting blog by David Hayden">Interesting blog</a> by <a target="_blank" href="http://davidhayden.com">David Hayden</a></div>
</li>
</ul>
<p>If you have used Information Expert before. Let me know your experiences.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sunild79.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sunild79.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunild79.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunild79.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunild79.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunild79.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunild79.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunild79.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunild79.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunild79.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=5&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunild79.wordpress.com/2008/03/08/do-you-use-information-expert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/159169c177ac3bb8917725abde1f5af0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunild79</media:title>
		</media:content>

		<media:content url="http://sunild79.files.wordpress.com/2008/03/lightbulb_small.gif" medium="image">
			<media:title type="html">Light Bulb</media:title>
		</media:content>
	</item>
		<item>
		<title>Project Risks</title>
		<link>http://sunild79.wordpress.com/2008/02/18/project-risks/</link>
		<comments>http://sunild79.wordpress.com/2008/02/18/project-risks/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 07:24:04 +0000</pubDate>
		<dc:creator>sunild79</dc:creator>
				<category><![CDATA[Project Management]]></category>
		<category><![CDATA[RUP]]></category>
		<category><![CDATA[SDLC]]></category>

		<guid isPermaLink="false">http://sunild79.wordpress.com/?p=4</guid>
		<description><![CDATA[·         No vision? You may lose track of where you are going and may be easily distracted on detours. ·         No process? Without a common process, the team may have miscommunications and misunderstandings about who is going to do what &#8211; and when. ·         No plan? You will not be able to track progress. ·         [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=4&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No vision? You may lose track of where you are going and may be easily distracted on detours.<br />
</span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No process? Without a common process, the team may have miscommunications and misunderstandings about who is going to do what &#8211; and when.<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No plan? You will not be able to track progress.<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No risk list? You may be focusing on the wrong issues now and may explode on an unsuspected mine 5 months from now.<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No business case? You risk losing time and money on the project. It may be cancelled or go bankrupt.<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No architecture? You may be unable to handle communication, synchronization, and data access issues as they arise; there may be problems with scaling and performance.<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No product (prototype)? As soon as possible, get a product in front of the customer. Just accumulating paperwork doesn&#8217;t assure you or the customer that the product will be successful-and it maximizes risk of budget and schedule overruns and/or outright failure.<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No evaluation? Don&#8217;t keep your head in the sand. It is important to face the truth. How close are you really to your deadline? To your goals in quality or budget? Are all issues adequately being tracked?<br />
</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No change requests? How do you keep track of requests from your stakeholders? How do you prioritize them? And keep the lower priority ones from falling through the cracks?<br />
</span><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-size:10pt;font-family:'Arial','sans-serif';">No user support? What happens when a user has a question or can&#8217;t figure out how to use the product? How easy is it to get help? </span></p>
<p style="vertical-align:middle;text-indent:-0.25in;margin:0 0 0 27pt;" class="MsoNormal"><span style="font-size:10pt;font-family:'Arial','sans-serif';"></span></p>
<p><span style="font-size:10pt;font-family:'Arial','sans-serif';">Do you agree?</span><span style="font-size:12pt;font-family:'Times New Roman','serif';"></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sunild79.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sunild79.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunild79.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunild79.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunild79.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunild79.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunild79.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunild79.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunild79.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunild79.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=4&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunild79.wordpress.com/2008/02/18/project-risks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/159169c177ac3bb8917725abde1f5af0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunild79</media:title>
		</media:content>
	</item>
		<item>
		<title>MDI Windows in WPF</title>
		<link>http://sunild79.wordpress.com/2007/12/02/mdi-windows-in-wpfpost-1-learning/</link>
		<comments>http://sunild79.wordpress.com/2007/12/02/mdi-windows-in-wpfpost-1-learning/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 17:09:09 +0000</pubDate>
		<dc:creator>sunild79</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Elastic animation]]></category>
		<category><![CDATA[MDI Windows]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[MDI Window]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Studio .NET 2008]]></category>

		<guid isPermaLink="false">http://sunild79.wordpress.com/2007/12/02/mdi-windows-in-wpfpost-1-learning/</guid>
		<description><![CDATA[One of the graphics features of many windows applications which we are probably most comfortable using is multiple document interface. I am a software developer constantly trying my hand on newer technologies.   These days i am evaluating WPF, Visual Studio .NET 2008 and Expression Blend(tool for creating XAML). WPF is especially a new concept for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=3&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the graphics features of many windows applications which we are probably most comfortable using is multiple document interface. I am a software developer constantly trying my hand on newer technologies. </p>
<p> These days i am evaluating WPF, Visual Studio .NET 2008 and Expression Blend(tool for creating XAML). WPF is especially a new concept for Visual Basic developers and they may find it a little difficult to understand in the beginning, but i am sure once they understand a few basic classes of the new framework they would love the new features.</p>
<p>Going through the web i found that there is a tremendous demand for a MDI Window feature with in WPF and it is not included with in the first version of it. I thought it would be a good exercise to try and learn WPF while constructing classes for MDI.</p>
<p>Studying through web I&#8217;ve found that we&#8217;ll need to understand the architecture and the very facade which lies at the base of Windows Presentation Framework.</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms750441.aspx">http://msdn2.microsoft.com/en-us/library/ms750441.aspx</a> is a good start.</p>
<p> Going through article i found that i need to understand the four basic elements that define the facade. They are</p>
<p>1. UIElement<br />
2. ContentElement<br />
3. FrameworkElement<br />
4. FrameworkContentElement</p>
<p>Here is a sample code i&#8217;ve put together for supporting multiple windows.</p>
<p><a href="http://cid-b3dbeec391c45395.skydrive.live.com/self.aspx/Public/Source%20Code/MDIWindowUpdated.zip">MDIWindowUpdated.zip</a></p>
<p>The application uses animator library by Darren David. Use the following link to learn more about it:<br />
<a href="http://blog.lookorfeel.com/index.php/2007/05/14/pennerdoubleanimation-and-animator-code-based-wpf-animation-simplified/">link to Animator lib blog</a><br />
Have a great time meanwhile.</p>
<p> :)</p>
<p>Sunil</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sunild79.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sunild79.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunild79.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunild79.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunild79.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunild79.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunild79.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunild79.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunild79.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunild79.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunild79.wordpress.com&amp;blog=2228894&amp;post=3&amp;subd=sunild79&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunild79.wordpress.com/2007/12/02/mdi-windows-in-wpfpost-1-learning/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/159169c177ac3bb8917725abde1f5af0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunild79</media:title>
		</media:content>
	</item>
	</channel>
</rss>
