<?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 &#187; RIA</title>
	<atom:link href="http://akashkava.com/blog/category/programming/ria/feed/" rel="self" type="application/rss+xml" />
	<link>http://akashkava.com/blog</link>
	<description>Founder of NeuroSpeech</description>
	<lastBuildDate>Mon, 19 Sep 2011 16:21:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>UI Atoms 1.7.5 Released</title>
		<link>http://akashkava.com/blog/387/ui-atoms-1-7-5-released/</link>
		<comments>http://akashkava.com/blog/387/ui-atoms-1-7-5-released/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 09:04:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Customize]]></category>
		<category><![CDATA[DataForm]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/387/ui-atoms-1-7-5-released/</guid>
		<description><![CDATA[We are happy to announce new release of UI Atoms 1.7.5 with following new features. New AtomDataForm Control Tabs in AtomForm and AtomDataForm Lambda Binding Extensions Introducing new Control AtomDataForm AtomForm did support UI Validations, however Microsoft RIA Services Client has some inbuilt validation and support for IEditableObject. So we created a new AtomDataForm that [...]]]></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/387/ui-atoms-1-7-5-released/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "UI+Atoms+1.7.5+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%2F387%2Fui-atoms-1-7-5-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F387%2Fui-atoms-1-7-5-released%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We are happy to announce new release of UI Atoms 1.7.5 with following new features.</p>
<ol>
<li>New AtomDataForm Control </li>
<li>Tabs in AtomForm and AtomDataForm </li>
<li>Lambda Binding Extensions </li>
</ol>
<h2>Introducing new Control AtomDataForm</h2>
<p>AtomForm did support UI Validations, however Microsoft RIA Services Client has some inbuilt validation and support for IEditableObject. So we created a new AtomDataForm that supports RIA Services validation and IEditableObject support.</p>
<ol>
<li>AtomDataForm supports object with IEditableObject interface and fires event for BeginEdit, CancelEdit and EndEdit </li>
<li>AtomDataForm displays items in read only mode unless Edit button is clicked </li>
<li>After edit button is clicked, Save and Cancel button appear for you to persist changes or cancel changes </li>
<li>AtomDataForm contains UI Element (TextBox, ComboBox etc) as children, so you can easily define child ui element in your xaml as shown in sample below </li>
<li>AtomDataForm supports Tabbed layout, for that you can insert your items within AtomDataFormTab as shown in example below </li>
<li>Following sample illustrates Tabs, but you can also create simple user interface without tab as well </li>
<li>You can also use AtomDataFormGroup to group items in to a headered group </li>
<li>Every child element of AtomDataForm can be accessed in code behind file easily because they appear as a variables when you define x:Name property </li>
<li>AtomDataForm supports CanChangeDataContext property, which is false when the form is in edit mode </li>
<li>You can easily reuse any third party control within AtomDataForm, AtomDataFormGroup and AtomDataFormTab </li>
</ol>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:4af705bb-bc40-4470-8c60-7e87ee7745ca" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">AtomDataForm Sample</div>
<div style="background: #ddd; max-height: 500px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap">
<li><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm</span> </li>
<li>   <span style="color:#ff0000"> Grid.Column</span><span style="color:#0000ff">=&quot;1&quot;</span> </li>
<li>   <span style="color:#ff0000"> DataContext</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> SelectedItem</span><span style="color:#0000ff">,</span><span style="color:#ff0000">ElementName</span><span style="color:#0000ff">=dataGrid}&quot; &gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 1st Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;Default&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Name:&quot;</span> </li>
<li>           <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> ProductName</span><span style="color:#0000ff">,</span><span style="color:#ff0000"> Mode</span><span style="color:#0000ff">=TwoWay}&quot;/&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomToggleButtonBar</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Type:&quot;</span></li>
<li>           <span style="color:#ff0000"> SelectedItem</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> ProductType</span><span style="color:#0000ff">,</span><span style="color:#ff0000">Mode</span><span style="color:#0000ff">=TwoWay}&quot;&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span><span style="color:#a31515">Product</span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span><span style="color:#a31515">Service</span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomToggleButtonBar</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span></li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Folder:&quot;&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">Button</span><span style="color:#ff0000"> Content</span><span style="color:#0000ff">=&quot;&#8230;&quot;/&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">TextBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 2nd Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;General&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Email:&quot;</span>  </li>
<li>           <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Email</span><span style="color:#0000ff">,</span><span style="color:#ff0000"> Mode</span><span style="color:#0000ff">=TwoWay}&quot;/&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 3rd Conditional Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; This tab will be visible only if Product&#39;s </span></li>
<li>    <span style="color:#008000">IsTypeService is true&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span> </li>
<li>       <span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;Service&quot;</span> </li>
<li>       <span style="color:#ff0000"> IsEnabled</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> IsTypeService}</span><span style="color:#0000ff">&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Service Details:&quot;/&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>&nbsp;</li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 4th Conditional Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; This tab will be visible only if Product&#39;s </span></li>
<li>    <span style="color:#008000">IsTypeProduct is true&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span> </li>
<li>       <span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;Product&quot;</span> </li>
<li>       <span style="color:#ff0000"> IsEnabled</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> IsTypeProduct}</span><span style="color:#0000ff">&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span><span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Product Details:&quot;</span> <span style="color:#0000ff"> &gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">Button</span><span style="color:#ff0000"> Content</span><span style="color:#0000ff">=&quot;Search&quot;/&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">TextBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm</span><span style="color:#0000ff">&gt;</span></li>
</ol></div>
</p></div>
</p></div>
<p>In above sample you can notice following things,</p>
<ol>
<li>Header property of AtomDataFormTab is displayed in the title section on the top </li>
<li>AtomDataFormTab contains children and each child can have properties as below
<ol>
<li>ns:AtomDataForm.Label displays label on left side </li>
<li>ns:AtomDataForm.Description displays description on bottom </li>
<li>ns:AtomDataForm.Title displays title on the top of control </li>
<li>ns:AtomDataForm.CommandBox displays a UI Element on the right corner, usually a search button or expand button </li>
</ol>
</li>
<li>AtomDataFormTab supports IsEnabled binding, you can bind this property to show/hide the tab as shown in the example above </li>
<li>Every child elemen of either AtomDataForm , AtomDataFormTab or AtomDataFormGroup supports Visibility and IsEnabled binding
<ol>
<li>If Visibility is bound and it results in Collapsed then entire form item is not displayed </li>
<li>IsEnabled binding can enable/disable the editable control </li>
</ol>
</li>
</ol>
<p>Following is screenshot of Tabbed AtomDataForm in edit mode</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2011/04/AtomDataForm.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="AtomDataForm" border="0" alt="AtomDataForm" src="http://akashkava.com/blog/wp-content/uploads/2011/04/AtomDataForm_thumb.png" width="367" height="275" /></a></p>
<h2>Introducing Lambda Binder Extensions</h2>
<p>Writing binding expressions with conditions and converters can be very complex especially rewriting many and same logic at different classes. Now UI Atoms support, Lambda Binding Extensions which lets you do binding within the code without creating any complex IValueConverter implementation.</p>
<h3>Bind Method Extension</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e332ae3d-d3f7-4a80-9c53-c235f4c6914e" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Element Property Binding</div>
<div style="background: #ddd; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;">
<li>theForm.Bind(<span style="color:#2b91af">AtomDataForm</span>.HeaderProperty,</li>
<li>    () =&gt; <span style="color:#0000ff">string</span>.Format(<span style="color:#a31515">&quot;{0} ({1})&quot;</span>,</li>
<li>            productName.Text,</li>
<li>            typeToggleButtonBar.SelectedItem</li>
<li>        ));</li>
</ol></div>
</p></div>
</p></div>
<p>This will bind theForm’s Header property to an expression that will combine properties of two different elements. And this will also automatically update when any of bound source or its property will change.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3002cb7e-bef1-4f9b-9df1-b62ba184b9b3" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">DataContext Property Binding</div>
<div style="background: #ddd; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;">
<li>theForm.Bind(<span style="color:#2b91af">AtomDataForm</span>.HeaderProperty, </li>
<li>    () =&gt; <span style="color:#0000ff">string</span>.Format(<span style="color:#a31515">&quot;{0} ({1})&quot;</span>,</li>
<li>            theForm.DataContext.Property(<span style="color:#a31515">&quot;ProductName&quot;</span>),</li>
<li>            theForm.DataContext.Property(<span style="color:#a31515">&quot;ProductType&quot;</span>)</li>
<li>        ));</li>
</ol></div>
</p></div>
</p></div>
<p>Assuming, we may not have property information at design time, but we know that DataContext will be set to an object containing properties, then we can write Property extension method as shown above.</p>
<h3>BindVisibility Method Extension</h3>
<p>Visibility converters are very frequent so we created a BindVisibility extension method that will let you specify a boolean expression that will be converted to Visibility on the fly.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a064c496-433a-43e7-a96f-5b55bd5a8449" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">BindVisibility Extension</div>
<div style="background: #ddd; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;">
<li>productTab.BindVisibility(</li>
<li>    () =&gt; </li>
<li>        typeToggleButtonBar.SelectedIndex == 0);</li>
</ol></div>
</p></div>
</p></div>
<p>These extensions can be used anywhere in any third party controls as well.</p>
<h3>Download Now</h3>
<p><a href="http://uiatoms.neurospeech.com/v1/download/UIAtoms2010Demo.zip" target="_blank">Click here</a> to download your free demo copy of NeuroSpeech UI Atoms 1.7.5</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F387%2Fui-atoms-1-7-5-released%2F&amp;title=UI%20Atoms%201.7.5%20Released"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/387/ui-atoms-1-7-5-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detach Entities Recursively and Attach to New DomainContext in Entity Framework and RIA Services</title>
		<link>http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/</link>
		<comments>http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 08:03:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[EF]]></category>
		<category><![CDATA[EF4]]></category>
		<category><![CDATA[Entity]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[RIA Services]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=379</guid>
		<description><![CDATA[Entity Framework and RIA Services do not allow Entities to be added/removed from cross containers. In order to move Entity from one DomainContext/ObjectContext to another DomainContext/ObjectContext, we need to recursively detach the object graph and attach it to other DomainContext/ObjectContext. Object Graph Single entity can be easily detached and attached from EntitySet where it belongs, [...]]]></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/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Detach+Entities+Recursively+and+Attach+to+New+DomainContext+in+Entity+Framework+and+RIA+Services";
		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%2F379%2Fdetach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F379%2Fdetach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Entity Framework and RIA Services do not allow Entities to be added/removed from cross containers. In order to move Entity from one DomainContext/ObjectContext to another DomainContext/ObjectContext, we need to recursively detach the object graph and attach it to other DomainContext/ObjectContext.</p>
<h2>Object Graph</h2>
<p>Single entity can be easily detached and attached from EntitySet where it belongs, but the problem comes when navigation properties of entity are not empty. Entity object along with navigation properties is called Object Graph because if you notice, navigation property’s navigation property will contain reference to same entity and that will result in endless recursive code for Detach/Attach.</p>
<h2>An entity with the same identity already exists in the EntitySet</h2>
<p>When you try to detach entity from old DomainContext/ObjectContext and attach it to DomainContext/ObjectContext, it may give you an error that entity with same identity already exists and it will throw an exception. In this case we will just simply reuse the existing entity instead of attaching the entity we have.</p>
<h2>Entity cannot be attached to this EntityContainer because it is already attached to another EntityContainer</h2>
<p>In case of ObjectGraph, your root level entity is already detached, but navigation properties are not detached, and while you try to attach your root level entity, it will throw same error for entities that exist in navigation properties.&#160; Because detach method does not recursively detach every entity from navigation properties.</p>
<h2>Attach/Detach Extension Methods</h2>
<p>Finally after brainstorming little, I made following class that will allow you to recursively detach/attach object graphs from DomainContext. You can replace DomainContext to ObjectContext to use it inside Entity Framework.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1357a75c-1e52-42b7-8917-81a262c881ac" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">DomainContext Extensions</div>
<div style="background: #ddd; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap">
<li><span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;summary&gt;</span></li>
<li style="background: #f3f3f3"><span style="color:#808080">///</span><span style="color:#008000"> DomainContext Extensions</span></li>
<li><span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;/summary&gt;</span></li>
<li style="background: #f3f3f3"><span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">DomainContextExtensions</span> {</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;summary&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> Recursively Attaches entity loaded from Other DomainContext to </span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> current specified DomainContext</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;/summary&gt;</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;context&quot;&gt;</span><span style="color:#008000">DomainContext where entity will be attached</span><span style="color:#808080">&lt;/param&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;entity&quot;&gt;</span><span style="color:#008000">Entity loaded from other DomainContext</span><span style="color:#808080">&lt;/param&gt;</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;returns&gt;&lt;/returns&gt;</span></li>
<li>    <span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#2b91af">Entity</span> Attach(<span style="color:#0000ff">this</span> <span style="color:#2b91af">DomainContext</span> context, <span style="color:#2b91af">Entity</span> entity)</li>
<li style="background: #f3f3f3">    {</li>
<li>        <span style="color:#0000ff">if</span> (entity == <span style="color:#0000ff">null</span> || entity.EntityState != <span style="color:#2b91af">EntityState</span>.Detached)</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">return</span> entity;</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Entity</span> newEntity = entity;</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Entity</span>[] list = <span style="color:#0000ff">new</span> <span style="color:#2b91af">Entity</span>[] { entity };</li>
<li>        <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">Entity</span> c <span style="color:#0000ff">in</span> context.EntityContainer.LoadEntities(list, </li>
<li style="background: #f3f3f3">            <span style="color:#2b91af">LoadBehavior</span>.MergeIntoCurrent))</li>
<li>        {</li>
<li style="background: #f3f3f3">            newEntity = c;</li>
<li>            <span style="color:#0000ff">break</span>;</li>
<li style="background: #f3f3f3">        }</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#008000">// recursively attach all entities..</span></li>
<li>        <span style="color:#2b91af">Type</span> entityType = <span style="color:#0000ff">typeof</span>(<span style="color:#2b91af">Entity</span>);</li>
<li style="background: #f3f3f3">&nbsp;</li>
<li>        <span style="color:#008000">// get all navigation properties&#8230;</span></li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Type</span> type = entity.GetType();</li>
<li>        <span style="color:#0000ff">foreach</span> (<span style="color:#0000ff">var</span> item <span style="color:#0000ff">in</span> type.GetProperties())</li>
<li style="background: #f3f3f3">        {</li>
<li>            <span style="color:#0000ff">if</span> (entityType.IsAssignableFrom(item.PropertyType))</li>
<li style="background: #f3f3f3">            {</li>
<li>                <span style="color:#2b91af">Entity</span> navEntity = Attach(context, item.GetValue(entity, <span style="color:#0000ff">null</span>) </li>
<li style="background: #f3f3f3">                    <span style="color:#0000ff">as</span> <span style="color:#2b91af">Entity</span>);</li>
<li>                item.SetValue(newEntity,navEntity, <span style="color:#0000ff">null</span>);</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">continue</span>;</li>
<li>            }</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">if</span> (item.PropertyType.Name.StartsWith(<span style="color:#a31515">&quot;EntityCollection&quot;</span>))</li>
<li>            {</li>
<li style="background: #f3f3f3">                <span style="color:#2b91af">IEnumerable</span> coll = item.GetValue(entity, <span style="color:#0000ff">null</span>) <span style="color:#0000ff">as</span> <span style="color:#2b91af">IEnumerable</span>;</li>
<li>                <span style="color:#2b91af">List</span>&lt;<span style="color:#2b91af">Entity</span>&gt; newList = <span style="color:#0000ff">new</span> <span style="color:#2b91af">List</span>&lt;<span style="color:#2b91af">Entity</span>&gt;();</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">Entity</span> child <span style="color:#0000ff">in</span> coll)</li>
<li>                {</li>
<li style="background: #f3f3f3">                    newList.Add(Attach(context, child));</li>
<li>                }</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">dynamic</span> dcoll = item.GetValue(newEntity,<span style="color:#0000ff">null</span>);</li>
<li>                <span style="color:#0000ff">foreach</span> (<span style="color:#0000ff">dynamic</span> child <span style="color:#0000ff">in</span> newList)</li>
<li style="background: #f3f3f3">                {</li>
<li>                    dcoll.Add(child);</li>
<li style="background: #f3f3f3">                }</li>
<li>            }</li>
<li style="background: #f3f3f3">        }</li>
<li>        <span style="color:#0000ff">return</span> newEntity;</li>
<li style="background: #f3f3f3">    }</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;summary&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> Recursively detaches entities from DomainContext, this </span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> method detaches every navigation properties</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> of current Entity as well.</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;/summary&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;context&quot;&gt;&lt;/param&gt;</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;entity&quot;&gt;&lt;/param&gt;</span></li>
<li>    <span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#0000ff">void</span> Detach(<span style="color:#0000ff">this</span> <span style="color:#2b91af">DomainContext</span> context, <span style="color:#2b91af">Entity</span> entity)</li>
<li style="background: #f3f3f3">    {</li>
<li>        <span style="color:#0000ff">if</span> (entity == <span style="color:#0000ff">null</span> || entity.EntityState == <span style="color:#2b91af">EntityState</span>.Detached)</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">return</span>;</li>
<li>        <span style="color:#2b91af">EntitySet</span> nes = context.EntityContainer.GetEntitySet(entity.GetType());</li>
<li style="background: #f3f3f3">        nes.Detach(entity);</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Type</span> entityType = <span style="color:#0000ff">typeof</span>(<span style="color:#2b91af">Entity</span>);</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#008000">// get all navigation properties&#8230;</span></li>
<li>        <span style="color:#2b91af">Type</span> type = entity.GetType();</li>
<li style="background: #f3f3f3">        <span style="color:#0000ff">foreach</span> (<span style="color:#0000ff">var</span> item <span style="color:#0000ff">in</span> type.GetProperties())</li>
<li>        {</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">if</span> (entityType.IsAssignableFrom(item.PropertyType))</li>
<li>            {</li>
<li style="background: #f3f3f3">                Detach(context,item.GetValue(entity, <span style="color:#0000ff">null</span>) <span style="color:#0000ff">as</span> <span style="color:#2b91af">Entity</span>);</li>
<li>                <span style="color:#0000ff">continue</span>;</li>
<li style="background: #f3f3f3">            }</li>
<li>            <span style="color:#0000ff">if</span> (item.PropertyType.Name.StartsWith(<span style="color:#a31515">&quot;EntityCollection&quot;</span>))</li>
<li style="background: #f3f3f3">            {</li>
<li>                <span style="color:#2b91af">IEnumerable</span> coll = item.GetValue(entity, <span style="color:#0000ff">null</span>) <span style="color:#0000ff">as</span> <span style="color:#2b91af">IEnumerable</span>;</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">Entity</span> child <span style="color:#0000ff">in</span> coll)</li>
<li>                {</li>
<li style="background: #f3f3f3">                    Detach(context,child);</li>
<li>                }</li>
<li style="background: #f3f3f3">            }</li>
<li>        }</li>
<li style="background: #f3f3f3">    }</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">}</li>
</ol></div>
</p></div>
</p></div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F379%2Fdetach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services%2F&amp;title=Detach%20Entities%20Recursively%20and%20Attach%20to%20New%20DomainContext%20in%20Entity%20Framework%20and%20RIA%20Services"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s iPad risks RIA Technologies (Flex/Silverlight)</title>
		<link>http://akashkava.com/blog/222/apples-ipad-risks-ria-technologies-flexsilverlight/</link>
		<comments>http://akashkava.com/blog/222/apples-ipad-risks-ria-technologies-flexsilverlight/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:25:35 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Future]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=222</guid>
		<description><![CDATA[Apple announces iPad, a bigger version of iPod Touch. With a big screen of 1024&#215;786 pixels. And it comes with basic need of surfing internet and be online. So called magical and revolutionary device does not support Flash and Silverlight yet. And most of business apps today, built upon RIA are running either on Flash [...]]]></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/222/apples-ipad-risks-ria-technologies-flexsilverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Apple%26rsquo%3Bs+iPad+risks+RIA+Technologies+%28Flex%2FSilverlight%29";
		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%2F222%2Fapples-ipad-risks-ria-technologies-flexsilverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F222%2Fapples-ipad-risks-ria-technologies-flexsilverlight%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://apple.com/ipad" target="_blank"><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="Apple-iPad" border="0" alt="Apple-iPad" src="http://akashkava.com/blog/wp-content/uploads/2010/02/AppleiPad1.png" width="244" height="200" /></a> </p>
<p align="justify">Apple announces iPad, a bigger version of iPod Touch. With a big screen of 1024&#215;786 pixels. And it comes with basic need of surfing internet and be online. So called magical and revolutionary device does not support Flash and Silverlight yet. And most of business apps today, built upon RIA are running either on Flash or on Silverlight. And IT Devs are heavily investing in RIA technologies due to snail speed of WWW group. However, the device can replace a laptop for most of users who just spend time on internet doing their regular business, studies or entertainment. So lets analyze what will be future of Web for different type of users.</p>
<h2>Students</h2>
<p align="justify">Today students need a good web browser and an internet with lot of social media websites to study, interact, entertain and play games. Apple iPad is a best bet for students. Do they really care that it does not support Flash and Silverlight yet? Answer is no. They will certainly buy iPad, come to the website, and if it has Flash or Silverlight, they will call website’s support instead of Apple’s support and say, </p>
<blockquote><p align="justify">Your website is not working on my iPad.</p>
</blockquote>
<h2>Sales Reps and Business Owners</h2>
<p align="justify"><font color="#000000">Looking at the cost, and attractive looks, Sales Reps and Business Owners will buy iPad because they usually do not type anything great whole day, all they do is, look at websites, present demos (which are powerpoint or keynote), and access their office through online business portals. For all these purpose they will be very happy with iPad. However, once they come to your business app through online portal, they cant see Flash or Silverlight, they are not going to call apple support. They will call IT devs and say,</font></p>
<blockquote><p>What the hell IT devs are doing, cant they make our business app work on iPad?</p>
</blockquote>
<h2>Independent Professionals</h2>
<p align="justify">Independent professionals like Doctors, Lawyers, Photographers, Actors .. anyone who probably does not sit in front of PC for more then 2 hours a day, will certainly like to get rid of big laptop bag with 4-10 external wires and device connectors. All what they do mostly is, check their emails, surf the websites, fill simple forms on some business web apps and which they can do it on iPad. Today iPad may not have great drawing tools but some professional apps on App store will certainly provide capability of tagging, drawing and marking tools needed by these professionals. Today lot of business applications are on Flash and new ones are coming on silverlight. But iPad will not support !! , once again, they will pickup the phone to vendor and say,</p>
<blockquote><p>Your website is not working on my iPad.</p>
</blockquote>
<h2>Who needs any of following?</h2>
<p align="justify"><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="pc_vs_mac" border="0" alt="pc_vs_mac" src="http://akashkava.com/blog/wp-content/uploads/2010/02/pc_vs_mac1.jpg" width="244" height="128" />Clerks,&#160; Graphics/Media artist and IT Developers, which comprises of small part of computer users. Because their applications and workspace requires bigger screens and multiple devices, connectivity and computing performance. Apple’s iPad will be useful only to test the business apps and for other entertainment to this group.</p>
<p align="justify">It seems iPad will spread in Home Entertainment, Education and Independent Professional sectors very fast because of low cost solution. And that will shake the developer community.</p>
<h2>Troubles for IT Devs</h2>
<ol>
<li>Current investment in Flex or Silverlight is at stake, as usage of mobile devices is increasing heavily, supporting business apps on these devices will not be possible until device OS creators, Adobe or Microsoft work towards supporting RIA technologies. </li>
<li>Silverlight/Flex are heavy and costly to run on battery based devices, they will consume more cpu and battery to create consumption problems. </li>
<li>Rewriting apps in light HTML5 is a big challenge, training, planning and supporting all existing modules will be a big pain. However looks like World Wide Web Consortium (W3C) has been sleeping for 10 years to create features of RIA required today. Need of consumers were high, that created innovations like DHTML, Flash and Silverlight, and the problem was, W3C never observed in market what consumers (Internet users) really need. </li>
<li>Even if you decide to invest heavily on iMac and decide to make apps that can run on iPad, your Apps are at mercy of Apple Employee doing approval, here is the funny process. </li>
</ol>
<p><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="AppStoreComic" border="0" alt="AppStoreComic" src="http://akashkava.com/blog/wp-content/uploads/2010/02/AppStoreComic.jpg" width="364" height="574" /> </p>
<h2>Death of Free and Open Internet</h2>
<p>IT Devs will slowly loose the independence over distributing apps against open free internet distribution. Today any release, distribution of media (song, movie, play) etc are controlled by major Labels.</p>
<blockquote><p>If The&#160; Intelligence will be controlled by major Labels in IT with narrow route to success by Apple, Google, Microsoft etc giants, then the growth we saw in last decade in IT industry will slow down very rapidly and independent innovators will become slaves to major labels. </p>
</blockquote>
<h2>Will Bubble of RIA Burst now?</h2>
<p>Once again, just like Dot Com, if RIA (Flex/Silverlight) Bubble bursts and all IT Devs will be blamed again.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F222%2Fapples-ipad-risks-ria-technologies-flexsilverlight%2F&amp;title=Apple%26rsquo%3Bs%20iPad%20risks%20RIA%20Technologies%20%28Flex%2FSilverlight%29"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/222/apples-ipad-risks-ria-technologies-flexsilverlight/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RIA &#8211; Why? Which One? How?</title>
		<link>http://akashkava.com/blog/41/ria-why-which-one-how/</link>
		<comments>http://akashkava.com/blog/41/ria-why-which-one-how/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 17:29:14 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[RIA]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Client]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[Front End]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MIS]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=41</guid>
		<description><![CDATA[RIA (Rich Internet Application) means faster means to develop light applications to fit in your business presentation and few quick interactive applications. With RIA you can not make a money tree and you can not become rich. Target Applications: Frontend Applications Small Quick Demo Applications Graphical Analysis of MIS Marketing Presentations Quick Forms/Data Entry for [...]]]></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/41/ria-why-which-one-how/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "RIA+%26%238211%3B+Why%3F+Which+One%3F+How%3F";
		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%2F41%2Fria-why-which-one-how%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F41%2Fria-why-which-one-how%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>RIA (Rich Internet Application) means faster means to develop light applications to fit in your business presentation and few quick interactive applications. With RIA you can not make a money tree and you can not become rich.</p>
<p>Target Applications:</p>
<ol>
<li>Frontend Applications</li>
<li>Small Quick Demo Applications</li>
<li>Graphical Analysis of MIS</li>
<li>Marketing Presentations</li>
<li>Quick Forms/Data Entry for Mass Audience</li>
<li>Polls, Social Interaction Applications</li>
<li>Thin Client Applications</li>
</ol>
<p>With RIA you can generally make a thin client applications, which surely needs to interact with high poerful web server or any other form of server over internet. RIA replaces frontend for modern internet applications from traditional HTML/JS form processing websites.</p>
<h1>WHY RIA?</h1>
<p>Traditional web portal applications (ASP.NET/EJB..) takes too much of time to process every single request, as it does not use full potential of client side computer. Every decision of which button to be displayed, state of an application and user&#8217;s choices and preferences, everything is maintained on server and applications utilizes too much of bandwidth as well.</p>
<p>Thats why, RIA is simple step to differentiate user interface and business logic completely with implementations of standards like SOAP web services and REST apis.</p>
<p>All RIAs are compiled at development site, that means the final RIA is in form of an application, which will execute accurately as designed. However in traditional HTML+JS, if any part of HTML is not rendered properly or its coded wrongly, there is no way to detect until it is delivered to browser and some error has been encountered. Pre compilation on RIA, reduces time required to develop web application drastically.</p>
<h1>WHICH RIA?</h1>
<table style="font-family:Arial, Helvetica, sans-serif; font-size:12px" border="1" cellspacing="0" cellpadding="2" width="620">
<tbody>
<tr>
<th valign="top" scope="col"></th>
<th width="100" align="center" valign="top" scope="col">Flex</th>
<th width="100" align="center" valign="top" scope="col">Silverlight</th>
<th width="100" align="center" valign="top" scope="col">JavaFX</th>
<th width="100" align="center" valign="top" scope="col">XUL</th>
</tr>
<tr>
<td valign="top"><strong>Vendor</strong></td>
<td align="center" valign="top">Adobe</td>
<td align="center" valign="top">Microsoft</td>
<td align="center" valign="top">Sun Microsystems</td>
<td align="center" valign="top">Mozilla</td>
</tr>
<tr>
<td valign="top"><strong>Open Source</strong></td>
<td align="center" valign="top">Yes<br />
(I am talking about FLEX not Flash)</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top"><strong>Support</strong></p>
<p>Community Support is very bad when you need quick solution in an emergency.</td>
<td align="center" valign="top">Paid Support &amp; Community</td>
<td align="center" valign="top">Paid Support &amp; Community</td>
<td align="center" valign="top">Community Support</td>
<td align="center" valign="top">Community Support</td>
</tr>
<tr>
<td valign="top"><strong>Dependency</strong></td>
<td align="center" valign="top">Flash Player</td>
<td align="center" valign="top">Silverlight Player</td>
<td align="center" valign="top">Java Runtime + JavaFX Runtime</td>
<td align="center" valign="top">XUL Runtime</td>
</tr>
<tr>
<td valign="top"><strong>Availability</strong></p>
<p>According to various statistics, the by default availability of dependent software on PCs.</td>
<td align="center" valign="top">95%</td>
<td align="center" valign="top">10%</td>
<td align="center" valign="top">0%</p>
<p>Although few PCs and all MACs have Java Runtime, they still need something additional.</td>
<td align="center" valign="top">30% as FireFox supports XUL Apps</td>
</tr>
<tr>
<td valign="top"><strong>Size of Runtime</strong></td>
<td align="center" valign="top">1MB</td>
<td align="center" valign="top">4.5MB</td>
<td align="center" valign="top">30MB</td>
<td align="center" valign="top">4MB</td>
</tr>
<tr>
<td valign="top"><strong>Native Device Access</strong></td>
<td align="center" valign="top">Camera, Mic and Speakers</td>
<td align="center" valign="top">Speakers</td>
<td align="center" valign="top">Speakers</td>
<td align="center" valign="top">None in Web App,</p>
<p>May be few in Desktop App</td>
</tr>
<tr>
<td valign="top"><strong>Audio Video Support</strong></td>
<td align="center" valign="top">Widely used FLV and MP3 format, stable and its there since 2001</td>
<td align="center" valign="top">WMV/WMA/WMA Pro</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top"><strong>Converters for the Supported Video</strong></td>
<td align="center" valign="top">FFMPEG and many other commercial vendors available</td>
<td align="center" valign="top">Paid Encoders</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top"><strong>Documentation</strong></td>
<td align="center" valign="top">SDK Documentation and Samples</td>
<td align="center" valign="top">MSDN but still very premature, (Reason, the learning curve is little higher)</td>
<td align="center" valign="top">JavaDocs but JavaFX is still new</td>
<td align="center" valign="top">Apache Documentation, very scattered, difficult to learn.</td>
</tr>
<tr>
<td valign="top"><strong>Syntax</strong></td>
<td align="center" valign="top">XML + Action Script</td>
<td align="center" valign="top">XML + C# / JS / VB.NET</td>
<td align="center" valign="top">Totally New Syntax</td>
<td align="center" valign="top">XML + JS</td>
</tr>
<tr>
<td valign="top"><strong>Language Feature</strong></td>
<td align="center" valign="top">Strictly Typed with &#8220;Object&#8221; being dynamic type</td>
<td align="center" valign="top">Strictly Typed,</p>
<p>Dynamic type to come in C# 4.0</td>
<td align="center" valign="top">Strictly Typed</td>
<td align="center" valign="top">Dynamic Typed</td>
</tr>
<tr>
<td valign="top"><strong>Binding Expressions</strong></p>
<p>Flex introduced wonderful concept of auto updating expressions when properties or variables changes.</td>
<td align="center" valign="top">Very Accurate</td>
<td align="center" valign="top">Accurate but lengthy code</td>
<td align="center" valign="top">Available</td>
<td align="center" valign="top">Better then JavaFX and Silverlight</td>
</tr>
<tr>
<td valign="top"><strong>Two Way Databinding<br />
</strong></td>
<td align="center" valign="top">Not Available, Coming up in Flex 4</td>
<td align="center" valign="top">Available</td>
<td align="center" valign="top">-</td>
<td align="center" valign="top">Available</td>
</tr>
<tr>
<td valign="top"><strong>Binding Declaration</strong></td>
<td align="center" valign="top">Simple Attribute</td>
<td align="center" valign="top">Extra Code in each bindable property</td>
<td align="center" valign="top">Extra code in each bindable property</td>
<td align="center" valign="top">Simple Attribute</td>
</tr>
<tr>
<td valign="top"><strong>Reflection</strong></td>
<td align="center" valign="top">Available</td>
<td align="center" valign="top">Available</td>
<td align="center" valign="top">Available</td>
<td align="center" valign="top">Available</td>
</tr>
<tr>
<td valign="top"><strong>Code Size</strong></td>
<td align="center" valign="top">Very Concise</td>
<td align="center" valign="top">Even simpler things like validator etc takes 6 lines, too big code size to maintain</td>
<td align="center" valign="top">Size is small, but very disorganized, difficult to read</td>
<td align="center" valign="top">Concise enough</td>
</tr>
<tr>
<td valign="top"><strong>Platform Availability</strong></td>
<td align="center" valign="top">Windows, Mac, Linux</td>
<td align="center" valign="top"><strong>Windows Only</strong></td>
<td align="center" valign="top">Windows, Mac, Linux</td>
<td align="center" valign="top">Windows, Mac, Linux</td>
</tr>
<tr>
<td valign="top"><strong>Stability</strong></td>
<td align="center" valign="top">Very Stable</td>
<td align="center" valign="top">Pre Beta</td>
<td align="center" valign="top">Pre Beta</td>
<td align="center" valign="top">Stable Enough</td>
</tr>
<tr>
<td valign="top"><strong>Control Library</strong></td>
<td align="center" valign="top">Rich set of Controls available, plus lots of free stuff available as well</td>
<td align="center" valign="top">Very basic controls, you have to spend money on other ISVs to get good controls</td>
<td align="center" valign="top">Good set of Controls</td>
<td align="center" valign="top">Almost everything is free, lacks good documentation though</td>
</tr>
<tr>
<td valign="top"><strong>Coders Availability</strong></p>
<p>For project managers, how difficult it will be to find coders who will code.</td>
<td align="center" valign="top">Easily Available as existing Flash, HTML, JS, ActionScript can code.</td>
<td align="center" valign="top">C# and Microsoft Technology programmers can code.</td>
<td align="center" valign="top">Java Programmers can code, but due to new syntax, its still difficult to get hands on it.</td>
<td align="center" valign="top">Very difficult as it requires too extra knowledge of mozilla architecture and various standards, which is not taught anywhere.</td>
</tr>
<tr>
<td valign="top"><strong>Commercial Training</strong></p>
<p><strong> </strong>Starting project is very easy, but ongoing maintanence and meeting deadlines requires excellent knowledge of technology, which you should not rely on community blogs, because time required to search any solution is costly.</td>
<td align="center" valign="top">Excellent</td>
<td align="center" valign="top">Excellent</td>
<td align="center" valign="top">Training available</td>
<td align="center" valign="top">Where?</td>
</tr>
<tr>
<td valign="top"><strong>Threading Support</strong></td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">Limited</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">Limited</td>
</tr>
<tr>
<td valign="top"><strong>Themes/Skinning</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes, but size of code is very big</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top"><strong>WebService Integration</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes but very frustrating</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top"><strong>Upload/Download</strong></td>
<td align="center" valign="top">The Best Feature in Flex</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top"><strong>Installable on Desktop</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top"><strong>Database Support</strong> (in desktop app only)</td>
<td align="center" valign="top">Sqlite</td>
<td align="center" valign="top">Not Applicable</td>
<td align="center" valign="top">JavaDB</p>
<p>Too heavy and too slow</td>
<td align="center" valign="top">Sqlite</td>
</tr>
<tr>
<td valign="top"><strong>Auto Update on Desktop App</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top"><strong>Present Since</strong></td>
<td align="center" valign="top">2001</td>
<td align="center" valign="top">2007</td>
<td align="center" valign="top">2007</td>
<td align="center" valign="top">2001</td>
</tr>
<tr>
<td valign="top"><strong>IDE</strong></p>
<p>Plugins are available under eclipse and netbeans etc type of editor, but problem is they are so premature, they dont support refractoring, analysis, debugging and lots of other facilities.</td>
<td align="center" valign="top">Flex Builder</td>
<td align="center" valign="top">Visual Studio</td>
<td align="center" valign="top">Plugin</td>
<td align="center" valign="top">Plugin</td>
</tr>
<tr>
<td valign="top"><strong>IDE Cost</strong></td>
<td align="center" valign="top"></td>
<td align="center" valign="top"></td>
<td align="center" valign="top"></td>
<td align="center" valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>IDE Refractoring</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top"><strong>IDE Source Versioning</strong></td>
<td align="center" valign="top">CVS</p>
<p>Good for Multiusers</td>
<td align="center" valign="top">Source Safe (Single Developer only)/ TSS (too costly)</td>
<td align="center" valign="top">Plugin</td>
<td align="center" valign="top">Plugin</td>
</tr>
<tr>
<td valign="top"><strong>Drag and Drop Editor</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Limited, because to script you need Visual Studio and to design you need Blend (Other paid software)</td>
<td align="center" valign="top">No</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top"><strong>Code Intellisense (Auto Complete)</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top"></td>
<td align="center" valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Project Management</strong></td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top"></td>
<td align="center" valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Library</strong> <strong>Management</strong></p>
<p>Creating and importing shared code in the form of libraries.</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top">Yes</td>
<td align="center" valign="top"></td>
<td align="center" valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Component Development</strong></td>
<td align="center" valign="top">Very Simple</td>
<td align="center" valign="top">Quite Complex as it is divided in User/Custom controls categories.</td>
<td align="center" valign="top">Available</td>
<td align="center" valign="top">Simple</td>
</tr>
<tr>
<td valign="top"><strong>The Result<br />
</strong></td>
<td align="center" valign="top">Leader of RIA</td>
<td align="center" valign="top">Flex Follower</td>
<td align="center" valign="top">The Last</td>
<td align="center" valign="top">Linux Love</td>
</tr>
</tbody>
</table>
<h1>Important Note:</h1>
<p>Silverlight claims to be platform independent, but reality is, Microsoft no longer provides any more upgrades of Silverlight version for any other operating system other then Windows. And Linux was already not officially supported by Microsoft.</p>
<h1>Advantages of RIA</h1>
<ol>
<li><strong>Reduce Development time</strong><br />
As compared with traditional web application, since RIAs are pre compiled, errors due to syntax, wrong spellings can be detected earlier at time of desiging.</li>
<li><strong>Load First, Run Throughout</strong><br />
RIAs load entire application (Except XUL) in the beginning, instead of HTML+JS, which loads as things proceed. This means, either application will load completely and work accurately even with slower bandwidth connection, or if some part didnt load, it will straightway display an error. So it works like transaction, either all or nothing. HTML+JS can behave unexpectedly in case of missing components.</li>
<li><strong>Seperate Design and Development Processes<br />
</strong>Flex and Sliverlight offers complete seperation of Development and Designing keeping integration simple, other platforms (earlier web ones) require too much time integrating designs and process.</li>
<li><strong>Utilize Client Computing</strong><br />
Almost every computer has high powerful graphics capabilities, HTML/JS doesnt offer any great benefit over it. RIAs can completely explore native graphics capabilities and you get wide range of user interface functionality.</li>
</ol>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F41%2Fria-why-which-one-how%2F&amp;title=RIA%20%26%238211%3B%20Why%3F%20Which%20One%3F%20How%3F"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/41/ria-why-which-one-how/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

