<?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/"
	>

<channel>
	<title>Akash Kava</title>
	<atom:link href="http://akashkava.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://akashkava.com/blog</link>
	<description>Founder of NeuroSpeech</description>
	<lastBuildDate>Fri, 25 Jun 2010 16:07:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Setup MySQL 5.1 Replication on Windows Servers</title>
		<link>http://akashkava.com/blog/321/setup-mysql-5-1-replication-on-windows-servers/</link>
		<comments>http://akashkava.com/blog/321/setup-mysql-5-1-replication-on-windows-servers/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 16:07:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Master-Slave]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/321/setup-mysql-5-1-replication-on-windows-servers/</guid>
		<description><![CDATA[This article illustrates step by step procedure of how to setup MySQL Master to Slave Asynchronous Replication with MySQL 5.1 Server and with MySQL Workbench tools 5.2 on Windows Server. Installation You need to download MySQL from the corresponding download location and install “Windows Installer Package” and make sure you install the edition with Server [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/321/setup-mysql-5-1-replication-on-windows-servers/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Setup+MySQL+5.1+Replication+on+Windows+Servers";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F321%2Fsetup-mysql-5-1-replication-on-windows-servers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F321%2Fsetup-mysql-5-1-replication-on-windows-servers%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p align="justify"> This article illustrates step by step procedure of how to setup MySQL Master to Slave Asynchronous Replication with MySQL 5.1 Server and with MySQL Workbench tools 5.2 on Windows Server.</p>
<h3 align="justify">Installation</h3>
<p align="justify">You need to download MySQL from the corresponding download location and install “Windows Installer Package” and make sure you install the edition with Server configuration wizard and configure your server accordingly.</p>
<p align="justify">You have to setup 2 servers, one as Master and one as Slave, and both must be accessible via TCP/IP to each other.</p>
<p align="justify">Also configure Workbench to open localhost connection for administration.</p>
<h2>Configure Bin Log on Master</h2>
<p>Open configuration on Master and setup following options in Log Files to configure bin log.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationMasterBinLog.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="MySQL-Replication-Master-Bin-Log" border="0" alt="MySQL-Replication-Master-Bin-Log" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationMasterBinLog_thumb.png" width="601" height="502" /></a></p>
<h2>Configure Master Server ID</h2>
</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationMasterServerID.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="MySQL-Replication-Master-Server-ID" border="0" alt="MySQL-Replication-Master-Server-ID" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationMasterServerID_thumb.png" width="644" height="224" /></a> </p>
<h2>Configure Replication User ID on Master</h2>
<p>In order for Slave to access your server, you must setup a user “replication_user” (you can choose your own name) and give replication access as shown in picture.<a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationMasterUser.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="MySQL-Replication-Master-User" border="0" alt="MySQL-Replication-Master-User" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationMasterUser_thumb.png" width="644" height="332" /></a></p>
<h2> Configure Replication Slave Server ID</h2>
<p>Now go to your Slave server and set its Server ID as shown below.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationSlaveServerID.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="MySQL-Replication-Slave-Server-ID" border="0" alt="MySQL-Replication-Slave-Server-ID" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationSlaveServerID_thumb.png" width="644" height="142" /></a></p>
<h2> Configure Replication Settings on Slave</h2>
<p>This is the last step to configure your Slave server, please make sure you enter correct address of your Master server and username and password as shown below. Just tick the Master info file name and give a path of file on any folder, even if file does not exist, dont worry, it will be created automatically by slave server.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationSlaveSettings.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="MySQL-Replication-Slave-Settings" border="0" alt="MySQL-Replication-Slave-Settings" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MySQLReplicationSlaveSettings_thumb.png" width="644" height="416" /></a> </p>
<h2>Start Slave</h2>
<p>The final step is to open query browser and run the query “START SLAVE”.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F321%2Fsetup-mysql-5-1-replication-on-windows-servers%2F&amp;linkname=Setup%20MySQL%205.1%20Replication%20on%20Windows%20Servers" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/321/setup-mysql-5-1-replication-on-windows-servers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Enabling Tracing in Silverlight with UI Atoms</title>
		<link>http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/</link>
		<comments>http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 15:44:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[Trace]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/</guid>
		<description><![CDATA[UI Atoms 2010 v1.9 update now includes Trace API for developers to log information on screen just like normal .NET application. Diagnostics Trace API Microsoft .NET provided Trace API to help in troubleshoot problems which is of great help at time of development. But Silverlight developers are disappointed for not being able to trace in [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Enabling+Tracing+in+Silverlight+with+UI+Atoms";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F307%2Fenabling-tracing-in-silverlight-with-ui-atoms%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F307%2Fenabling-tracing-in-silverlight-with-ui-atoms%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p align="justify">UI Atoms 2010 v1.9 update now includes Trace API for developers to log information on screen just like normal .NET application.</p>
<h2 align="justify">Diagnostics Trace API</h2>
<p align="justify">Microsoft .NET provided Trace API to help in troubleshoot problems which is of great help at time of development. But Silverlight developers are disappointed for not being able to trace in Silverlight apps. However running apps on multiple platform isn’t quite easy, and different user experiences on different platforms raise unexpected issues. Such issues are difficult to resolve as deployed client computer may not have development tools available to troubleshoot and see application logs.</p>
<blockquote><p align="justify">Trace.WriteLine(“ Hello World “);</p>
</blockquote>
<p align="justify">We sure miss Trace in Silverlight, so we decided to add similar diagnostics API in Silverlight.</p>
<h2 align="justify">Trace Viewer</h2>
<p align="justify">In Silverlight, as it runs inside a browser, there is no way to see any trace information not only this, on different platforms like Mac, it may be too difficult for no technical user to install and enable remote debugging.</p>
<p align="justify">So we decided to include a visual component that can be put anywhere on screen, just like “Output” pane in visual studio. Its developer’s choice to fit the Trace Viewer. Its pretty simple Text View control, where in you can see lines of log automatically scrolling down as log grows.</p>
<h2>AtomTraceView</h2>
<p align="justify">UI Atoms’s AtomTraceView control works well with Silverlight as well as WPF, in WPF it uses inbuilt Trace functionality and displays trace information to user, and in Silverlight we have added custom API, that is used to display Trace information. Syntax is pretty simple.</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">Grid</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">Grid.RowDefintions</span><span class="kwrd">&gt;</span>
       <span class="kwrd">&lt;</span><span class="html">RowDefinition</span><span class="kwrd">/&gt;</span>
       <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="attr">Height</span><span class="kwrd">=&quot;200&quot;</span><span class="kwrd">/&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">Grid.RowDefintions</span><span class="kwrd">&gt;</span>

   <span class="kwrd">&lt;</span><span class="html">MyUserControl</span><span class="kwrd">/&gt;</span>

   <span class="kwrd">&lt;</span><span class="html">AtomTraceView</span> <span class="attr">Grid</span>.<span class="attr">Row</span><span class="kwrd">=&quot;1&quot;</span><span class="kwrd">/&gt;</span>

<span class="kwrd">&lt;</span><span class="html">Grid</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p align="justify">This way you can include AtomTraceView at the bottom of your page and it will display all traces programmed by the developer.</p>
<h2 align="justify">Limited API</h2>
<p align="justify">However, .NET Trace API is very huge, and it is extensible, but Trace API offered by UI Atoms as of now is very limited, not by the design but by implications, Silverlight itself is very limited platform, this is just an Add-on for users to troubleshoot their apps.</p>
<h2>Trace Statements in Silverlight</h2>
<p>In order to write Trace statements, you have to import following namespace,</p>
<blockquote>
<p><font color="#333333">using NeuroSpeech.UIAtoms.Core;</font></p>
</blockquote>
<p>Then you can write following statements and they will appear in AtomTraceView Control.</p>
<pre class="csharpcode">AtomTrace.WriteLine(<span class="str">&quot; Hello World &quot;</span>);

AtomTrace.WriteLine( exception.ToString() );

AtomTrace.WriteLine( <span class="kwrd">string</span>.Format(<span class="str">&quot;{0},{1} Coordinates&quot;</span>, x, y) );</pre>
<p>&#160;</p>
<p>The AtomTrace class exists for both Silverlight and WPF, so it becomes easier to write your logs with AtomTrace instead of Trace, so your code can be shared on both Silverlight as well as WPF.</p>
<h2>Trace and Multithreading</h2>
<p align="justify">Trace statements can be accessed by thread in Silverlight app, however the sequence in which it will appear can not be guaranteed because it depends upon the processor and scheduling algorithm used in thread pool of Silverlight application.</p>
<h2>Custom Trace Listener</h2>
<p>Just similar to .NET, we have included&#160; AtomTraceListener class, which you can derive and customize trace information according to your need as well as it has Traced event, which you can implement and get trace notifications anywhere..</p>
<h2>&#160;</h2>
<h2>Future of Trace API in Silverlight</h2>
<p align="justify">When Trace API will be included by Microsoft in future edition of Silverlight, we may plan to remove Trace API, to be consistent with the Silverlight development workflow, this API has been enabled only to write shared code between WPF and Silverlight environment. However otherwise, we plan to make tracing more rich with UI Atoms. But for now, it is very helpful for everyone.</p>
<h2>Live Demo</h2>
<p><a href="http://go.neurospeech.com/10" target="_blank"><strong><font size="4">Click Here</font></strong></a> to see live demo of Tracing in Silverlight.</p>
<p><strong><a href="http://go.neurospeech.com/4" target="_blank"><font size="4">Click Here</font></a></strong> to download demo version of UI Atoms 2010.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F307%2Fenabling-tracing-in-silverlight-with-ui-atoms%2F&amp;linkname=Enabling%20Tracing%20in%20Silverlight%20with%20UI%20Atoms" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Measurement Unit Conversion for WPF and Silverlight</title>
		<link>http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/</link>
		<comments>http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 15:25:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Conversion]]></category>
		<category><![CDATA[Measurement]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[Silverlight 4 RC]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[Unit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/</guid>
		<description><![CDATA[Scientific calculations often require measurement unit conversion and demand high accuracy. Although it may be very easy to google around the web and get some formula, however when we looked into SI units and its Unit Guide, then we realized that even units with same name have little different value in different countries and continents. [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Measurement+Unit+Conversion+for+WPF+and+Silverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F300%2Fmeasurement-unit-conversion-for-wpf-and-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F300%2Fmeasurement-unit-conversion-for-wpf-and-silverlight%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Scientific calculations often require measurement unit conversion and demand high accuracy. Although it may be very easy to google around the web and get some formula, however when we looked into SI units and its Unit Guide, then we realized that even units with same name have little different value in different countries and continents.</p>
<p>So we decided to bring them all into User Interface control for WPF and Silverlight.</p>
<ol>
<li>Which allows Developer to adhere to one standard unit.</li>
<li>Which allows users to choose unit of their own choice.</li>
<li>See the conversion while editing the value.</li>
</ol>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MeasurementControlPart1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MeasurementControlPart1" border="0" alt="MeasurementControlPart1" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MeasurementControlPart1_thumb.png" width="583" height="490" /></a> </p>
<p>&#160;</p>
<p>The following sample code displays how to use these unit converters in Silverlight and WPF.</p>
<h3>Properties</h3>
<p>Each of the measurement unit converter controls has four properties as mentioned below.</p>
<h4>DisplayValue Property:</h4>
<p>This is the editable value displayed in the text box, and user can directly modify this value by either using up/down arrow buttons or by typing in the value. The display value works in conjunction with the type of unit that is selected in Display Unit ID property.</p>
<h4>DisplayUnitID Property:</h4>
<p>Every measurement unit has different ID assigned by our developers to uniquely identify alpha numeric ID within the set of units. For example, meter and centimeter are IDs of Length. However you do not have to remember these IDs, when you edit your UI in Visual Studio, you can configure these IDs in the property editor. End user can visually modify Display Unit in order to retrieve and enter value in the desired unit.</p>
<h4>ValueUnitID Property:</h4>
<p>The DisplayUnitID is attached to DisplayValue, similarly the underlying actual value is attached with ValueUnitID property. This Unit ID is usually set to a constant throughout the lifetime of the application and is already defaulted to SI unit. e.g. for Length, it is set to meter. We recommend you to change this only if your base unit requirement is something different then SI unit. This unit can not be changed by end user it can only be programmed in the code at design time.</p>
<h4>Value Property:</h4>
<p>The value property is something which you are interested saving in the database and use it as base value. This is the converted value of unit ValueUnitID specified from display value of display unit.</p>
<h4>Example:</h4>
<p>In the first control in the above picture, Display Value is 100, Display Unit is Fathom, Value Unit is meter, so converted value in meter is 182.8804.</p>
<h4>Live Sample:</h4>
<p><a href="http://go.neurospeech.com/6" target="_blank"><strong>Click here</strong></a> to view live sample in Silverlight.</p>
<h4>Download Demo:</h4>
<p><a href="http://go.neurospeech.com/4" target="_blank"><strong>Click here</strong></a> to download the demo version of UI Atoms.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F300%2Fmeasurement-unit-conversion-for-wpf-and-silverlight%2F&amp;linkname=Measurement%20Unit%20Conversion%20for%20WPF%20and%20Silverlight" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced Data Form with UI Atoms on WPF and Silverlight</title>
		<link>http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/</link>
		<comments>http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 11:14:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Advanced Form]]></category>
		<category><![CDATA[DataForm]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/</guid>
		<description><![CDATA[Building line of business applications for over years, we realized that the Silverlight DataForm offers very small subset of features that are needed in the long run. We figured out the problem with form based applications, that frustrates developers. That is “Change Management”. Although WPF/Silverlight does offer very customizable UI designing platform but when we [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Advanced+Data+Form+with+UI+Atoms+on+WPF+and+Silverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F296%2Fadvanced-data-form-with-ui-atoms-on-wpf-and-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F296%2Fadvanced-data-form-with-ui-atoms-on-wpf-and-silverlight%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Building line of business applications for over years, we realized that the Silverlight DataForm offers very small subset of features that are needed in the long run. We figured out the problem with form based applications, that frustrates developers. That is “Change Management”.</p>
<p>Although WPF/Silverlight does offer very customizable UI designing platform but when we go on the field to develop ling of business applications, we realize that initial development hardly takes any time but maintenance is very difficult.</p>
<p>Lets review the designing problems of panels such as Grid, StackPanel, Canvas etc.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/StackPanelGridChallenges.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="StackPanelGridChallenges" border="0" alt="StackPanelGridChallenges" src="http://akashkava.com/blog/wp-content/uploads/2010/06/StackPanelGridChallenges_thumb.png" width="420" height="289" /></a> </p>
<h3>Standard Form Design</h3>
<p>Lets review standard form design that is expected, this is the layout that can not be made except canvas panel because there is no way we can support variable columns per row. If you notice, first two rows have 3 columns equally placed and last 2 rows have two columns equally placed. Every field has description at the bottom and red required asterisk (*).</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/StandardFormDesign.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="StandardFormDesign" border="0" alt="StandardFormDesign" src="http://akashkava.com/blog/wp-content/uploads/2010/06/StandardFormDesign_thumb.png" width="420" height="298" /></a></p>
<h3>Initial Form Design</h3>
<p>The first draft of UI in any application is very simple and we probably do it in minutes.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/CustomerRequest.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="CustomerRequest" border="0" alt="CustomerRequest" src="http://akashkava.com/blog/wp-content/uploads/2010/06/CustomerRequest_thumb.png" width="420" height="373" /></a> </p>
<h3>Changes Requested</h3>
<p>But the bigger problem always comes later on when changes are requested.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/TypicalChanges.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="TypicalChanges" border="0" alt="TypicalChanges" src="http://akashkava.com/blog/wp-content/uploads/2010/06/TypicalChanges_thumb.png" width="420" height="332" /></a> </p>
<h3>Atom Flexible Grid </h3>
</p>
<p>This is the reason we created “AtomFlexibleGrid” which supports variable columns per row as displayed in the picture above. You can see that form and the flexible grid have a property called “RowLayout” which accepts comma separated cell values to be displayed per row. As displayed in the example below.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/FlexibleGrid.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="FlexibleGrid" border="0" alt="FlexibleGrid" src="http://akashkava.com/blog/wp-content/uploads/2010/06/FlexibleGrid_thumb.png" width="420" height="302" /></a> </p>
<p>This is very helpful in quick design, but this also way to easy to manage when changes are requested.</p>
<ul>
<li>Intelligent Flow Layout with ability share multiple items in single row. </li>
<li>No attributes required on any child items. </li>
<li>Comma Separated “RowLayout” instantly renders variable column grid. </li>
<li>E.g. 3,2,1 = 3 cells in first row, 2 cells in 2nd row and 1 cell in 3rd row with automatic spanning. </li>
</ul>
<h3>Benefits of Atom Flexible Grid over Canvas, Grid and Stack Panel    <br /></h3>
<ul>
<li>Atom Form children are similar to Wrap Panel children, but Wrapping is completely customized via simple attributes. </li>
<li>Its easy to move items around without changing lots of attributes, Grid is very powerful but changing grid children can be huge pain. </li>
<li>Canvas is very easy to operate, but needs a powerful designer, once again changing layout can be very tedious job.
</li>
</ul>
<h3>Form Field Layout</h3>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/FormFieldLayout.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="FormFieldLayout" border="0" alt="FormFieldLayout" src="http://akashkava.com/blog/wp-content/uploads/2010/06/FormFieldLayout_thumb.png" width="420" height="180" /></a></p>
<p>This is how individual components of Form Field are positioned within the Form Field. Collapsible panels are only visible if the content is provided. However in future more of such components will be available in Form Field to standardize the fields.    <br />In next slide, you will see how the fields are positioned in the Form.     </p>
<h3>Change Management</h3>
<p>Changing layout is extremely simple, as you can simply move your items up and down and change “RowLayout” text field to quickly review how it will look. No tedious drag and drop and no typing.</p>
<h3>Live Form Demos</h3>
<p><a href="http://uiatoms.neurospeech.com/silverlight/index.html" target="_blank">Click here</a> to see live UI Atoms form demos for Silverlight.</p>
<p><a href="http://go.neurospeech.com/4" target="_blank">Click here</a> to download UI Atoms form demos for WPF.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F296%2Fadvanced-data-form-with-ui-atoms-on-wpf-and-silverlight%2F&amp;linkname=Advanced%20Data%20Form%20with%20UI%20Atoms%20on%20WPF%20and%20Silverlight" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced Data Form and Easiest Change Management with AtomForm</title>
		<link>http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/</link>
		<comments>http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/#comments</comments>
		<pubDate>Mon, 31 May 2010 16:50:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Advanced Form]]></category>
		<category><![CDATA[AtomForm]]></category>
		<category><![CDATA[LOB]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/</guid>
		<description><![CDATA[UI Atoms Form Layout View more presentations from Akash Kava. Here at NeuroSpeech, we figured out the problem with forms based business applications that frustrates developers and change management is not only time consuming but its quite boring job to do. Although WPF/Silverlight does offer very customizable UI designing platform but when we go on [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Advanced+Data+Form+and+Easiest+Change+Management+with+AtomForm";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F283%2Fadvanced-data-form-and-easiest-change-management-with-atomform%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F283%2Fadvanced-data-form-and-easiest-change-management-with-atomform%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:5804ff25-c861-4c9e-8478-5c56aa833c15" class="wlWriterEditableSmartContent">
<div>
<div style="width:425px" id="__ss_3736922"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ackava/ui-atoms-form-layout" title="UI Atoms Form Layout">UI Atoms Form Layout</a></strong><object id="__sse3736922" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uiatomsformlayout-100415105821-phpapp01&amp;stripped_title=ui-atoms-form-layout" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed name="__sse3736922" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uiatomsformlayout-100415105821-phpapp01&amp;stripped_title=ui-atoms-form-layout" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ackava">Akash Kava</a>.</div>
</div>
</div>
</div>
<p>Here at NeuroSpeech, we figured out the problem with forms based business applications that frustrates developers and change management is not only time consuming but its quite boring job to do.</p>
<p>Although WPF/Silverlight does offer very customizable UI designing platform but when we go on the field to develop ling of business applications, we realize that initial development hardly takes any time but maintenance is very difficult.</p>
<p>AtomForm has been designed to offer a standard rich business class user interface along with various advanced validation methods and the change management is very easy as “AtomFlexibleGrid” offers simple row layout concept that is offered nowhere today.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F283%2Fadvanced-data-form-and-easiest-change-management-with-atomform%2F&amp;linkname=Advanced%20Data%20Form%20and%20Easiest%20Change%20Management%20with%20AtomForm" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Code Generation in Eclipse/Flash Builder with TFS 2010</title>
		<link>http://akashkava.com/blog/282/dynamic-code-generation-in-eclipseflash-builder-with-tfs-2010/</link>
		<comments>http://akashkava.com/blog/282/dynamic-code-generation-in-eclipseflash-builder-with-tfs-2010/#comments</comments>
		<pubDate>Sat, 15 May 2010 15:38:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Team Foundation System]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/282/dynamic-code-generation-in-eclipseflash-builder-with-tfs-2010/</guid>
		<description><![CDATA[Eclipse based IDEs such as Flash Builders have problem with generated source code with TFS 2010 (Visual Studio Team Foundation 2010 Everywhere), and here is the workaround to solve this problem. Problem Definition Eclipse monitors file system changes and automatically adds all generated files in the Team Foundation Server. Now TFS Everywhere for Eclipse does [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/282/dynamic-code-generation-in-eclipseflash-builder-with-tfs-2010/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Dynamic+Code+Generation+in+Eclipse%2FFlash+Builder+with+TFS+2010";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F282%2Fdynamic-code-generation-in-eclipseflash-builder-with-tfs-2010%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F282%2Fdynamic-code-generation-in-eclipseflash-builder-with-tfs-2010%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Eclipse based IDEs such as Flash Builders have problem with generated source code with TFS 2010 (Visual Studio Team Foundation 2010 Everywhere), and here is the workaround to solve this problem.</p>
<h2>Problem Definition</h2>
<p>Eclipse monitors file system changes and automatically adds all generated files in the Team Foundation Server. Now TFS Everywhere for Eclipse does not support ignoring a folder. Eclipse keeps on adding code of your Web Service generated code in TFS and finally TFS shows lot of files in pending check ins. However if you check-in them, then next time, your code generation tools will not work correctly because files will have to be checked out. And even if you do, code generation will delete some files, and TFS will give error that it can not file and will not let you check-in new items.</p>
<ol>
<li><font color="#333333">TFS will not let source code generator generate new files, as they are not checked out.</font></li>
<li><font color="#333333">After checking out, Deleted files will give errors while checking new files.</font></li>
</ol>
<h2>Web Library Projects as Solution</h2>
<p>We ran with exact same problem with Eclipse to manage flex and java projects. Mostly the web service client code are generated dynamically and we really do not want it to go in TFS. So we created library projects and we only stored library project’s configuration in the TFS.</p>
<p>We can import the WebLibs in our main projects, there are various advantages.</p>
<ol>
<li><font color="#333333">The generated code stays out of TFS.</font></li>
<li><font color="#333333">Compiled code of WebLibs takes lesser time to build project.</font></li>
</ol>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F282%2Fdynamic-code-generation-in-eclipseflash-builder-with-tfs-2010%2F&amp;linkname=Dynamic%20Code%20Generation%20in%20Eclipse%2FFlash%20Builder%20with%20TFS%202010" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/282/dynamic-code-generation-in-eclipseflash-builder-with-tfs-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UI Atoms 2010 v1.1 Released</title>
		<link>http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/</link>
		<comments>http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/#comments</comments>
		<pubDate>Wed, 05 May 2010 16:28:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Conversion]]></category>
		<category><![CDATA[Measurement]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[Unit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/</guid>
		<description><![CDATA[New update of UI Atoms 2010 v1.1 is now available, it includes fixes for Silverlight 4 and new controls as per following list. Update 1.1 UI Atoms is now upgraded to Silverlight 4, all binding workarounds have been removed. Six New Measurement Unit Controls have been added. Measurement Unit Controls Scientific measurements are complex and [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "UI+Atoms+2010+v1.1+Released";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F281%2Fui-atoms-2010-v1-1-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F281%2Fui-atoms-2010-v1-1-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>New update of UI Atoms 2010 v1.1 is now available, it includes fixes for Silverlight 4 and new controls as per following list.</p>
<h2>Update 1.1</h2>
<ol>
<li><font color="#333333">UI Atoms is now upgraded to Silverlight 4, all binding workarounds have been removed.</font></li>
<li><font color="#333333">Six New Measurement Unit Controls have been added.</font></li>
</ol>
<h2>Measurement Unit Controls</h2>
<p>Scientific measurements are complex and wide range of units are used everywhere, though conversions are not difficult but it is not possible to carry and remember all conversions and correct formulae.</p>
<p>UI Atoms 2010 v1.1 brings power of SI units conversion in set of following Measurement Unit Controls.</p>
<ul>
<li><font color="#333333">AtomLengthEditor – helps in conversion of “Length” units.</font></li>
<li><font color="#333333">AtomTemperatureEditor – helps in conversion of “Temperature” units.</font></li>
<li><font color="#333333">AtomTimeEditor – helps in conversion of “Time” units.</font></li>
<li><font color="#333333">AtomVelocityEditor – helps in conversion of “Velocity” units.</font></li>
<li><font color="#333333">AtomVolumeEditor – helps in conversion of “Volume” units.</font></li>
<li><font color="#333333">AtomWeightEditor – helps in conversion of “Weight” units.</font></li>
</ul>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/05/MeasurementControls.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MeasurementControls" border="0" alt="MeasurementControls" src="http://akashkava.com/blog/wp-content/uploads/2010/05/MeasurementControls_thumb.png" width="613" height="490" /></a> Currently, these controls offers very simple GUI as first draft, however you can see the number of units that are available that can help users view/edit the value in any desired unit.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F281%2Fui-atoms-2010-v1-1-released%2F&amp;linkname=UI%20Atoms%202010%20v1.1%20Released" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UI Delegation Pattern for Data Controls in WPF/Silverlight</title>
		<link>http://akashkava.com/blog/258/ui-delegation-pattern-for-data-controls-in-wpfsilverlight/</link>
		<comments>http://akashkava.com/blog/258/ui-delegation-pattern-for-data-controls-in-wpfsilverlight/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 10:44:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Delegation]]></category>
		<category><![CDATA[Pattern]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=258</guid>
		<description><![CDATA[This is Preliminary documentation about UI Delegation Pattern to create Clean and Reusable Data Components and UI Markups in a Business Application. UI Delegation Pattern for WPF and Silverlight View more presentations from Akash Kava. UI Delegation Pattern I would call it simply divide and rule, UI Delegation Pattern is narrowing the focus towards piece [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/258/ui-delegation-pattern-for-data-controls-in-wpfsilverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "UI+Delegation+Pattern+for+Data+Controls+in+WPF%2FSilverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F258%2Fui-delegation-pattern-for-data-controls-in-wpfsilverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F258%2Fui-delegation-pattern-for-data-controls-in-wpfsilverlight%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p align="justify">This is Preliminary documentation about UI Delegation Pattern to create Clean and Reusable Data Components and UI Markups in a Business Application.</p>
<div align="justify">
<div style="padding-bottom: 0px; padding-left: 0px; width: 425px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:77a73d93-0392-4904-b5ec-376ec54e12c8" class="wlWriterEditableSmartContent">
<div>
<div style="width:425px" id="__ss_3832620"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ackava/ui-delegation-pattern-for-wpf-and-silverlight" title="UI Delegation Pattern for WPF and Silverlight">UI Delegation Pattern for WPF and Silverlight</a></strong><object width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uidelegationpatternfordatacontrolsinwpfandsilverlight-100423123459-phpapp02&amp;stripped_title=ui-delegation-pattern-for-wpf-and-silverlight" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uidelegationpatternfordatacontrolsinwpfandsilverlight-100423123459-phpapp02&amp;stripped_title=ui-delegation-pattern-for-wpf-and-silverlight" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ackava">Akash Kava</a>.</div>
</div>
</div>
</div></div>
<h2 align="justify">UI Delegation Pattern</h2>
<p align="justify">I would call it simply divide and rule, UI Delegation Pattern is narrowing the focus towards piece of UI Element on the screen and have a UI component to fulfill every specific business needs.</p>
<p align="justify">User Interface is the direct connection between User and your business application, thought MVC, MVVM models exist, but they are found to be very useful in CRUD business applications, but when your application is more then CRUD and it involves complex UI and media / hardware interfaces for scientific and entertainment related applications, MVC/MVVM are little difficult to maintain over huge applications. This pattern is already in existence at many places. </p>
<h2 align="justify">Initial Rough Draft</h2>
<p align="justify">This is initial rough draft, I intend to collect problems and solutions and then I want to give a good name to this pattern, for now I am calling this as “UI Delegation Pattern” however I don&#8217;t know whether it suits the name correctly or not. But your opinions are most welcome, if such pattern is already named and exists then I am sorry if I am unaware of it, but please suggest if you know so.</p>
<h2 align="justify">UI Markup vs. Editor Files</h2>
<p align="justify">Earlier Visual Basic or Visual Studio would create .frm and resource files that would contain the contents of UI design created in “Designer/Editor” inside an IDE. These Editors would create code that is required to execute at runtime to create desired user interface. However since Editors would create code with specific style and pattern, these editor files are more or less very structured and they are less buggy. Of course too much of code will certainly make Editor very slow but at the same time, the consistency of UI code is preserved. But you are too much dependent on the Editor and complex UI could be very difficult to work in Editors.</p>
<p align="justify">Where else UI Markup based on xml, gives full freedom to user to create highly complex UI, but at the same time there is no consistency left as everyone writes code very differently. Markups gets piled into one file and it becomes way to difficult to maintain and understand how it works.</p>
<h2 align="justify">Identify Markup Noise</h2>
<p align="justify">My first approach is to identify problems with Markup Noise, so lets identify what is markup noise. When I see any html, aspx, php or such web scripts, the most annoying things I discover that in spite&#160; great CSS and Modular programming support, the scripts becomes a big junk to maintain. Sure WPF / Silverlight are also text markups, hand coded markups becomes way to big junk to manage.</p>
<p align="justify">Bigger problem is to visualize markups as they become more complex. As more and more lines of code gets piled into markup, more time is spent understanding and troubleshooting the UI.</p>
<h2 align="justify">How to Reduce Markup Noise?</h2>
<p align="justify">
<p align="justify">CSS brought a very useful way to reduce markup noise. Still lot of developers write inline styles and I hate to see that. Ideally nicely written code should have inline styles as small as possible.</p>
<h3 align="justify">Appearance Delegation</h3>
<p align="justify">CSS comes under category of Appearance Delegation where your delegate the look and feel of your component to CSS file. In WPF and Silverlight the themes are styles are introduced and you must have all your styles and look and feel related code into resources only.</p>
<p align="justify">The markup containers (Connection Containers) such as Window / Page / User Control should not have any inbuilt styles at all.</p>
<h3 align="justify">Business Logic Delegation</h3>
<p align="justify">This was not possible in plain html, but aspx, php etc did brought concept of server side controls where in you could inject business logic specific to components and reuse them. But these components (user controls / custom controls ) are only designed when they need to be reused, but even if it will be used only once, I would still suggest its better to have components as small as possible.</p>
<p align="justify">Example, Country Combo drop down , Gender Combo drop down, these boxes are nothing but set of options provided to user to select one of them. Now nobody makes specific custom controls for such items, but lets see a practical example.</p>
<h2 align="justify">Bad Markup Example</h2>
<div align="justify">
<pre class="csharpcode">    <span class="kwrd">&lt;</span><span class="html">Window.Resources</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">XmlDataProvider</span> <span class="attr">x:Key</span><span class="kwrd">=&quot;CountryData&quot;</span> <span class="attr">XPath</span><span class="kwrd">=&quot;/Countries&quot;</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">Countries</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;&quot;</span><span class="kwrd">&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">Country</span>
                    <span class="attr">CountryName</span><span class="kwrd">=&quot;United States&quot;</span>
                    <span class="attr">CountryCode</span><span class="kwrd">=&quot;US&quot;</span><span class="kwrd">/&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">Country</span>
                    <span class="attr">CountryName</span><span class="kwrd">=&quot;United States&quot;</span>
                    <span class="attr">CountryCode</span><span class="kwrd">=&quot;US&quot;</span><span class="kwrd">/&gt;</span>
            <span class="kwrd">&lt;/</span><span class="html">Countries</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;/</span><span class="html">XmlDataProvider</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">Window.Resources</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">StackPanel</span><span class="kwrd">&gt;</span>

        <span class="kwrd">&lt;</span><span class="html">ComboBox</span>
            <span class="attr">ItemsSource</span><span class="kwrd">=&quot;{Binding Source={StaticResource CountryData},
                XPath=Country}&quot;</span>
            <span class="attr">DisplayMemberPath</span><span class="kwrd">=&quot;@CountryName&quot;</span>
            <span class="attr">SelectedValuePath</span><span class="kwrd">=&quot;@CountryCode&quot;</span>
            <span class="kwrd">/&gt;</span>

        <span class="kwrd">&lt;</span><span class="html">ComboBox</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">sys:String</span><span class="kwrd">&gt;</span>Male<span class="kwrd">&lt;/</span><span class="html">sys:String</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">sys:String</span><span class="kwrd">&gt;</span>Female<span class="kwrd">&lt;/</span><span class="html">sys:String</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;/</span><span class="html">ComboBox</span><span class="kwrd">&gt;</span>

    <span class="kwrd">&lt;/</span><span class="html">StackPanel</span><span class="kwrd">&gt;</span></pre>
</div>
<p align="justify">
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p align="justify">Now this file defines a resource xml for Country List, and it is bounded by ComboBox to list countries and another ComboBox defines inline items to be displayed.</p>
<h3 align="justify">Let us identify “Controls and Connection Containers”.</h3>
<p align="justify">The window, that hosts Country List and Gender Combo Boxes is <strong>“Connection Container” </strong>in which we should only host controls and connect inter dependent properties of every controls.</p>
<p align="justify">The Connection Container should not have any code that is not related to either any other items or business logic of the container at all.</p>
<p align="justify">List of Countries and Gender items are not at all related to anyone else except for the drop downs. This is pure markup junk where we have so many unnecessary information.</p>
<h2>Solution</h2>
<p>Define custom controls as shown below and see how small our markup becomes. And move Country List xml to some resource file.</p>
<pre class="csharpcode">    <span class="kwrd">public</span> <span class="kwrd">class</span> CountryComboBox : ComboBox
    {

        <span class="kwrd">public</span> CountryComboBox()
        {
            <span class="kwrd">this</span>.DisplayMemberPath = <span class="str">&quot;@CountryName&quot;</span>;
            <span class="kwrd">this</span>.SelectedValuePath = <span class="str">&quot;@CountryCode&quot;</span>;

            Binding b = <span class="kwrd">new</span> Binding();
            b.XPath = <span class="str">&quot;Country&quot;</span>;
            b.Source = FindResource(<span class="str">&quot;CountryData&quot;</span>);
            <span class="kwrd">this</span>.SetBinding(ItemsSourceProperty, b);
        }

    }</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<pre class="csharpcode">    <span class="kwrd">public</span> <span class="kwrd">class</span> GenderComboBox : ComboBox
    {
        <span class="kwrd">public</span> GenderComboBox()
        {
            <span class="kwrd">this</span>.ItemsSource =
                <span class="kwrd">new</span> <span class="kwrd">string</span>[] {
                    <span class="str">&quot;Male&quot;</span>,
                    <span class="str">&quot;Female&quot;</span>
                };
        }
    }</pre>
<p>&#160;</p>
<p>The final Markup.</p>
<pre class="csharpcode">    <span class="kwrd">&lt;</span><span class="html">StackPanel</span><span class="kwrd">&gt;</span>

        <span class="kwrd">&lt;</span><span class="html">local:CountryComboBox</span>
            <span class="kwrd">/&gt;</span>

        <span class="kwrd">&lt;</span><span class="html">local:GenderComboBox</span>
            <span class="kwrd">/&gt;</span>

    <span class="kwrd">&lt;/</span><span class="html">StackPanel</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Wow, the markup is very clean now. Also the code is easy to understand.</p>
<h2>Conclusion</h2>
<p align="justify">The connection container (Window / Page / User Control) should only have interdependent declarations and should not have any items that are only specific to one control. It should be as clean as possible and it should execute all necessary business logic for the component.</p>
<p align="justify">Configuration items, even resource bindings should be avoided in Connection Containers. They should be narrowed down to custom controls as much as possible.</p>
<p align="justify">This increases readability, reusability and helps in troubleshooting while focusing by narrowing the target.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F258%2Fui-delegation-pattern-for-data-controls-in-wpfsilverlight%2F&amp;linkname=UI%20Delegation%20Pattern%20for%20Data%20Controls%20in%20WPF%2FSilverlight" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/258/ui-delegation-pattern-for-data-controls-in-wpfsilverlight/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LOB Business Form Layout for WPF &amp; Silverlight</title>
		<link>http://akashkava.com/blog/272/lob-business-form-layout-for-wpf-silverlight/</link>
		<comments>http://akashkava.com/blog/272/lob-business-form-layout-for-wpf-silverlight/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 10:34:48 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[DataForm]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[LOB]]></category>
		<category><![CDATA[SilverLight]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/272/lob-business-form-layout-for-wpf-silverlight/</guid>
		<description><![CDATA[UI Atoms LOB Business Form Layout for WPF &#38; Silverlight View more presentations from Akash Kava. There is lot of buzz about LOB Business Form Layout for new platforms WPF &#38; Silverlight, both capable of displaying rich content and extend functionalities of existing components so better then ever before. XAML is better then earlier Rapid [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/272/lob-business-form-layout-for-wpf-silverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "LOB+Business+Form+Layout+for+WPF+%26amp%3B+Silverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F272%2Flob-business-form-layout-for-wpf-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F272%2Flob-business-form-layout-for-wpf-silverlight%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<div style="padding-bottom: 0px; padding-left: 0px; width: 425px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:e15324b0-9e04-458a-bccf-63639d8642e2" class="wlWriterEditableSmartContent">
<div>
<div style="width:425px" id="__ss_3756627"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ackava/ui-atoms-lob-business-form-layout-for-wpf-silverlight" title="UI Atoms LOB Business Form Layout for WPF &amp; Silverlight">UI Atoms LOB Business Form Layout for WPF &amp; Silverlight</a></strong><object width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uiatomslobbusinessformlayoutforwpfsilverlight-100417052402-phpapp01&amp;stripped_title=ui-atoms-lob-business-form-layout-for-wpf-silverlight" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uiatomslobbusinessformlayoutforwpfsilverlight-100417052402-phpapp01&amp;stripped_title=ui-atoms-lob-business-form-layout-for-wpf-silverlight" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ackava">Akash Kava</a>.</div>
</div>
</div>
</div>
<p align="justify">There is lot of buzz about LOB Business Form Layout for new platforms WPF &amp; Silverlight, both capable of displaying rich content and extend functionalities of existing components so better then ever before.</p>
<p align="justify">XAML is better then earlier Rapid Form designers where you need to drag and drop within an IDE and the layout management becomes so complicated because no IDE is perfect. I remember upgrading from Visual Studio 2005 to 2008 and now 2010, most of our ASP.NET and WinForm projects would require lot of effort to work seamlessly in newer versions. The worst of all is, modifying layout without IDE becomes way to difficult.</p>
<p align="justify">In this presentation, I collected all important aspects of Business Form that we encounter in our day to day life and the complexity of forms make life terrible when clients request changes that takes hours on any IDE that sure breaks lot of code graphs and makes existing working system as completely useless code junk.</p>
<p align="justify">In UI Atoms, we at NeuroSpeech tried make set of components that are very easy to operate while going through tough change management.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F272%2Flob-business-form-layout-for-wpf-silverlight%2F&amp;linkname=LOB%20Business%20Form%20Layout%20for%20WPF%20%26amp%3B%20Silverlight" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/272/lob-business-form-layout-for-wpf-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SQL Assembly to replace T-SQL Business Logic</title>
		<link>http://akashkava.com/blog/259/using-sql-assembly-to-replace-t-sql-business-logic/</link>
		<comments>http://akashkava.com/blog/259/using-sql-assembly-to-replace-t-sql-business-logic/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 09:00:32 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=259</guid>
		<description><![CDATA[SQL Assembly brings power of CLR (Common language runtime) inside SQL Database Stored Procedure which can overcome T-SQL programming pains of Intellisense, Debugging, Logging and Versioning. Traditional Problems with T-SQL and Stored Procedures I never liked programming in T-SQL, for various reasons listed below, No Intellisense, of course it has been introduced SQL 2008 onwards, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/259/using-sql-assembly-to-replace-t-sql-business-logic/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Using+SQL+Assembly+to+replace+T-SQL+Business+Logic";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F259%2Fusing-sql-assembly-to-replace-t-sql-business-logic%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F259%2Fusing-sql-assembly-to-replace-t-sql-business-logic%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>SQL Assembly brings power of CLR (Common language runtime) inside SQL Database Stored Procedure which can overcome T-SQL programming pains of Intellisense, Debugging, Logging and Versioning.</p>
<h2>Traditional Problems with T-SQL and Stored Procedures</h2>
<p>I never liked programming in T-SQL, for various reasons listed below,</p>
<ol>
<li><font color="#333333">No Intellisense, of course it has been introduced SQL 2008 onwards, but still its far behind what we get in Visual Studio.</font> </li>
<li><font color="#333333">Source Code Control, although scripts can be added to source code control, usually its unawareness and unwillingness of Database Administrator / Designer to use it correctly and mess things up.</font> </li>
<li><font color="#333333">Less human readable, T-SQL is very difficult to understand if its not documented well.</font> </li>
<li><font color="#333333">Source code is open, it can be modified, so in short Database Administrator has complete access to alter business logic.</font> </li>
<li><font color="#333333">Very less reusable, unless you do copy paste, no way to standardize the development.</font> </li>
<li><font color="#333333">No support for advanced visual tools to design T-SQL Stored Procedures.</font> </li>
<li><font color="#333333">Deployment is difficult, minor alternation can cause problems.</font> </li>
<li><font color="#333333">Most of business logic involves, loops, if-else, switch statements, and it takes 10 times more code to execute such logic in T-SQL then any other programming language in world.</font> </li>
<li><font color="#333333">You need multiple language talent, one with either VB.NET/C# and T-SQL.</font> </li>
<li>Difficult to Log information.</li>
</ol>
<h2>Introduction of SQL Assembly</h2>
<p>Since SQL 2005, introduction of SQL Assembly has been of great importance, however not much of people still use it, because of unawareness. But SQL Assembly can be modularized and reused, and it exists as simple CLR assembly inside database. </p>
<p>And following are benefits of SQL Assembly, besides few listed in <a href="http://msdn.microsoft.com/en-us/library/k2e1fb36(v=VS.100).aspx" target="_blank">MSDN here</a>.</p>
<ol>
<li><font color="#333333">LINQ in CLR Stored Procedure.</font> </li>
<li><font color="#333333">Better Source Code control over Visual C#/Visual Basic.NET project through Team System.</font> </li>
<li><font color="#333333">Intellisense.</font> </li>
<li><font color="#333333">Closed source, its safe.</font> </li>
<li><font color="#333333">Highly secure as Database Administrator can not alter business logic.</font> </li>
<li><font color="#333333">C# and VB.NET along with LINQ are more human readable, understanding and reusing code can be very easy.</font> </li>
<li><font color="#333333">Support for advanced documentation in comments.</font> </li>
<li><font color="#333333">Visual Studio Model designer can be used.</font> </li>
<li>Reuse your Business Logic for other database vendor products, e.g. Oracle, MySQL (Explained below). </li>
<li>You can do advanced logging with log-4-net or custom logging.</li>
</ol>
<h2>Small Example of How to use LINQ in SQL Assembly</h2>
<ol>
<li>Create a simple Visual C# Class Library Project. </li>
<li>Add reference of “System.Data” Assembly. </li>
<li>Create new ADO.NET Entity Model, and you can create it from Database or empty model, the way you want to develop your project. </li>
<li>Add few entities, I am going to demonstrate entity “Cart” which is a saved shopping cart for the Customer. </li>
</ol>
<h2><a href="http://akashkava.com/blog/wp-content/uploads/2010/04/CartDemo.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="CartDemo" border="0" alt="CartDemo" src="http://akashkava.com/blog/wp-content/uploads/2010/04/CartDemo_thumb.png" width="389" height="206" /></a>Create a Stored Procedure Class</h2>
<p>After creating model, lets create a class called “ShoppingCart” and add a static method as shown below.</p>
<blockquote><pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">ShoppingCart
</span>{

    <span style="color: gray">/// &lt;summary&gt;
    /// </span><span style="color: green">Creates new Cart if none exists and returns the Cart ID
    </span><span style="color: gray">/// &lt;/summary&gt;
    /// &lt;param name=&quot;CustomerID&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    </span>[<span style="color: #2b91af">SqlProcedure</span>]
    <span style="color: blue">public static </span><span style="color: #2b91af">SqlInt64 </span>GetSavedCartID(<span style="color: #2b91af">SqlInt64 </span>CustomerID)
    {

        <span style="color: green">// Set context connection=true
        </span><span style="color: #2b91af">ShoppingCartModelContainer </span>context =
            <span style="color: blue">new </span><span style="color: #2b91af">ShoppingCartModelContainer</span>(<span style="color: #a31515">&quot;context connection=true&quot;</span>);

        <span style="color: green">// Query for exisitng cart
        </span><span style="color: #2b91af">Cart </span>c = context.Carts.FirstOrDefault(
                        t =&gt; t.CustomerID == CustomerID.Value);

        <span style="color: blue">if </span>(c == <span style="color: blue">null</span>) { 

            <span style="color: green">// create new Cart
            </span>c = <span style="color: #2b91af">Cart</span>.CreateCart(0, CustomerID.Value, <span style="color: #2b91af">DateTime</span>.Now);
            context.AddToCarts(c);
            context.SaveChanges();
        }

        <span style="color: green">// return the Cart ID
        </span><span style="color: blue">return new </span><span style="color: #2b91af">SqlInt64</span>(c.CartdID);

    }

}</pre>
</blockquote>
<p align="justify">This code demonstrates how easy it is to write SQL Assembly, now here is the ultimate benefit of everything.</p>
<h2>Ultimate Benefit</h2>
<p align="justify">You can use your Business Logic in multiple vendor databases, like for example for Oracle and MySQL, you can reuse your SQL Assembly and just change your connection string. You can reuse your business logic in your front end code with simple wrapper.</p>
<p align="justify">And with SQL Server, you can reuse this assembly inside SQL Database.</p>
<p align="justify"><a href="http://akashkava.com/blog/wp-content/uploads/2010/04/CodeSharing.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="CodeSharing" border="0" alt="CodeSharing" src="http://akashkava.com/blog/wp-content/uploads/2010/04/CodeSharing_thumb.png" width="644" height="200" /></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fakashkava.com%2Fblog%2F259%2Fusing-sql-assembly-to-replace-t-sql-business-logic%2F&amp;linkname=Using%20SQL%20Assembly%20to%20replace%20T-SQL%20Business%20Logic" target="_blank"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/259/using-sql-assembly-to-replace-t-sql-business-logic/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
