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

<channel>
	<title>Dave&#039;s Two Cents</title>
	<atom:link href="http://blog.davemdavis.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.davemdavis.net</link>
	<description>Exploring the world of software development through my eyes!</description>
	<lastBuildDate>Thu, 24 Nov 2011 13:37:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.davemdavis.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dave&#039;s Two Cents</title>
		<link>http://blog.davemdavis.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.davemdavis.net/osd.xml" title="Dave&#039;s Two Cents" />
	<atom:link rel='hub' href='http://blog.davemdavis.net/?pushpress=hub'/>
		<item>
		<title>Code Once Use Twice&#8230;.or More</title>
		<link>http://blog.davemdavis.net/2011/07/05/code-once-use-twice-or-more/</link>
		<comments>http://blog.davemdavis.net/2011/07/05/code-once-use-twice-or-more/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 13:04:15 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/07/05/code-once-use-twice-or-more/</guid>
		<description><![CDATA[If you have programed against any of Microsoft’s Xaml based user interface frameworks then you might have heard about the MVVM (Model-View-ViewModel) pattern.&#160; One of the benefits of this pattern is the separation of the view&#160; from the view model.&#160; &#8230; <a href="http://blog.davemdavis.net/2011/07/05/code-once-use-twice-or-more/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=209&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have programed against any of Microsoft’s Xaml based user interface frameworks then you might have heard about the MVVM (Model-View-ViewModel) pattern.&nbsp; One of the benefits of this pattern is the separation of the view&nbsp; from the view model.&nbsp; All of the logic lives in the view model which is then bound to the view.&nbsp; This separation allows for rapid revolutions of the visual components.&nbsp; All that is needed is to recreate the Xaml and go.&nbsp; What is you do that across Xaml technologies?&nbsp; As of now Microsoft has three Xaml based UI Frameworks, WPF, Silverlight, WP7 (which is of course is a variant of Silverlight 3).&nbsp; There is even a hint of a <a href="http://www.zdnet.com/blog/microsoft/under-the-windows-8-hood-questions-and-answers-from-the-trenches/9738?pg=1">new/revamped Xaml Framework in Windows 8</a>.</p>
<p>I have recently started to look at reusing a Silverlight 4 ViewModels in a WP7 applications. I figured this would probably be the easiest place to start since they are both Silverlight. I was recently asked what would it take to make a component reusable across Silverlight and WPF.&nbsp; That figures right into my ViewModel sharing research. I will start by looking at different ways to share code across all three frameworks.&nbsp; In a future post I will explore ways to reuse Xaml.</p>
<h3></h3>
<h3>The Challenges</h3>
<p>Let’s start off by examining the challenges associated with this task.&nbsp; The first challenge is the fact that they are three different frameworks that are designed for three different use cases.&nbsp; That means that any reusable code would have to be coded to the lowest common denominator.&nbsp; In this case it means WP7. </p>
<p>For this post I don’t have any working code to share but I have been trying a few things.&nbsp; One of the first things I ran into was in the System.ServiceModel namespace.&nbsp; Each framework handles calling web services differently.&nbsp; Silverlight and WP7 can only make calls asynchronously and WPF defaults to synchronous calls.&nbsp; I am still working out how I want to handle this.&nbsp; There are other challenges too, take third party libraries for instance. </p>
<p>Another challenge that you are going to face is keeping consistent namespaces across the frameworks.&nbsp; If your organization has a strict naming convention then this could become a challenge.&nbsp; Luckily you control what your namespaces are but it can become quite hairy if you are not careful.&nbsp; </p>
<p>Third Party Libraries are usually compiled against specific runtimes.&nbsp; The third party library that I consistently use when working with Xaml is the <a href="http://galasoft.ch/mvvm/">MVVM Light Toolkit</a>.&nbsp; Luckily the MVVM Light Toolkit is compiled against the different Xaml runtimes and the functionality is consistent across the frameworks.&nbsp; But with other libraries you may not be as lucky.&nbsp; Now it is time to talk about the different options available for reuse.</p>
<h3>Copy and Paste</h3>
<p><a href="http://dmd0822.files.wordpress.com/2011/07/copyandpaste.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;" title="CopyAndPaste" border="0" alt="CopyAndPaste" align="right" src="http://dmd0822.files.wordpress.com/2011/07/copyandpaste_thumb.png?w=203&#038;h=334" width="203" height="334"></a>The most basic method is copy and paste.&nbsp; This is a quick and dirty solution.&nbsp; First you create a file that works in one framework.&nbsp; Then you create that same file in the other projects copying the code from the original class to the new class.&nbsp; The up side to this method is that you can tweak the code for each framework.&nbsp; But red flags should be waving and alarms sounding. </p>
<p>Copy and paste architecture is NOT the key to a reusable strategy.&nbsp; There is no means to update the code once it resides in each project since the code is not linked together. Any change would need to be propagated across the different files.&nbsp; Which may be ok if there is one “shared” file and more than that and you are asking for a nightmare. In other words there is no maintainability or scalability with this option.</p>
<h3>Add As a Link</h3>
<p><a href="http://dmd0822.files.wordpress.com/2011/07/addaslinkdiag.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;margin:0 15px 0 0;" title="AddAsLinkDiag" border="0" alt="AddAsLinkDiag" align="left" src="http://dmd0822.files.wordpress.com/2011/07/addaslinkdiag_thumb.png?w=303&#038;h=188" width="303" height="188"></a>The next option I explored is add linked files to the projects. For this method you create a class in on project and then add it as a link to another project.&nbsp; In the “Add Existing Items” dialog you can navigate to the file you want to link and select “Add As Link” from the “Add” button dropdown.</p>
<p>&nbsp;</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/07/addaslink.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;" title="AddAsLink" border="0" alt="AddAsLink" align="right" src="http://dmd0822.files.wordpress.com/2011/07/addaslink_thumb.png?w=257&#038;h=273" width="257" height="273"></a>You can tell the file is linked by the icon of the file in the linked project. With this solution there is only one physical copy of the file.&nbsp; Each project then compiles the file against the proper framework. The up side to this approach is that there is only one file to maintain.&nbsp; On the downside namespaces can become an issue. You may also have to use conditional compile tags if modifications are needed.&nbsp; Conditional tag will allow for the use of different using statements when it comes to third part libraries as long as the internal namespaces are consistent.</p>
<h3>Portable Library Tools</h3>
<p>The final method I looked at was the <a href="http://msdn.microsoft.com/en-us/library/gg597391.aspx">Portable Library Tools</a> from Microsoft. The Portable Library tools </p>
<blockquote><p>is a new Visual Studio add-in from Microsoft that enables you to create C# and Visual Basic libraries that run on a variety of .NET-based platforms without recompilation. – Visual Studio Gallery Description</p>
</blockquote>
<p>The add-in can be downloaded from the <a href="http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981/">Visual Studio Gallery</a>.&nbsp; This method allows you to create a class library that can run against many of the .Net runtimes.&nbsp; To accomplish this the class library compiles against a very restrictive version of the .Net framework.&nbsp;&nbsp; This can be a challenge when planning out what to include in a reusable library.</p>
<p>Since this project is still in the CTP/Beta phase not all of the available frameworks libraries have been included. Most notably there is no odata support so you cannot create a reusable odata access library with this tool. According to the Q and A tab in the gallery there is a product road map that plans to include more of the framework. </p>
<p>On a side note it looks like this tool is part of the developer story for Windows 8.&nbsp; Take a look at the response, on the <a href="http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981/">Q and A Tab</a>, to the “System.Threading.Thread problem” question. </p>
<blockquote><p>We needed to remove explictly thread creation for a reason that we&#8217;re not ready to discuss yet (ask me again in 3 months).</p>
</blockquote>
<p>Note that the <a href="http://www.buildwindows.com/">Build Windows Conference</a> is three months away.</p>
<h3>Conclusion </h3>
<p>Sorry there is not any working code for this post.&nbsp; I am still mulling over how I want to accomplish my goals.&nbsp; I wanted to put this together to organize my thoughts and get feedback from others who have tried for reusable nirvana.&nbsp; One of the lessons that I have learned so far is be picky about what you include.&nbsp; The different frameworks kind of take care of that for you by restricting what libraries are available.</p>
<p>The other early lesson I have garnered from my investigation is that you have to be more aware of Framework updates that could break your reusable code.&nbsp; There is a lot of churn happening right now with Xaml frameworks (Silverlight 5 and WP7.1).&nbsp;&nbsp; New releases may break what you are doing but they may also bring in more components that can be reusable!&nbsp; </p>
<p>Next I will be looking to see how compatible Xmal is across the different frameworks. The ultimate goal is to develop a strategy that allows components to be used across Silverlight, WPF and Windows Phone.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=209&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/07/05/code-once-use-twice-or-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/07/copyandpaste_thumb.png" medium="image">
			<media:title type="html">CopyAndPaste</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/07/addaslinkdiag_thumb.png" medium="image">
			<media:title type="html">AddAsLinkDiag</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/07/addaslink_thumb.png" medium="image">
			<media:title type="html">AddAsLink</media:title>
		</media:content>
	</item>
		<item>
		<title>Greetings From New England givecamp!</title>
		<link>http://blog.davemdavis.net/2011/05/01/greetings-from-new-england-givecamp/</link>
		<comments>http://blog.davemdavis.net/2011/05/01/greetings-from-new-england-givecamp/#comments</comments>
		<pubDate>Sun, 01 May 2011 12:57:50 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/05/01/greetings-from-new-england-givecamp/</guid>
		<description><![CDATA[What can you do with 48 hour and over 120 volunteers.&#160; I will tell you what we did.&#160; We helped out over 25 charity with variety technical projects.&#160; Projects that would normally not get done because of lack of budget &#8230; <a href="http://blog.davemdavis.net/2011/05/01/greetings-from-new-england-givecamp/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=201&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dmd0822.files.wordpress.com/2011/05/givecampcolorlogo2011.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;" title="GiveCampColorLogo2011" border="0" alt="GiveCampColorLogo2011" align="right" src="http://dmd0822.files.wordpress.com/2011/05/givecampcolorlogo2011_thumb.png?w=342&#038;h=193" width="342" height="193" /></a>What can you do with 48 hour and over 120 volunteers.&#160; I will tell you what we did.&#160; We helped out over 25 charity with variety technical projects.&#160; Projects that would normally not get done because of lack of budget and lack of skill but desperately needed none the less.&#160; </p>
<p>This weekend was the second annual <a href="http://newenglandgivecamp.org/" target="_blank">New England givecamp</a>.&#160; A weekend dedicated to helping out charities with technical projects.&#160; These projects range from designing web sites to building out content management systems.&#160; In addition to getting technical help there are seminars designed to help charities make the most of the technology they are getting.&#160; This weekend there were sessions on content management, engaging social media, and others to help these organizations grow in a highly technological world.</p>
<p>First I would like to thank all the sponsors of providing the means to fuel all the activities this weekend.&#160; What does it take to keep developers developing…..a lot of support so again thanks.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_08-03-07_699.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="2011-05-01_08-03-07_699" border="0" alt="2011-05-01_08-03-07_699" src="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_08-03-07_699_thumb.jpg?w=617&#038;h=464" width="617" height="464" /></a></p>
<p>Next I would like to thank Jim O’Neil and Kelley Muir for organizing the event.&#160; It may not have seemed it to you but to us it was very well organized.&#160; Leaps and bounds over last year.&#160; Which means next years should be spectacular…..no pressure!</p>
<p>The one thing you need to realize is that the word camp is in the title and camped we did.&#160; A number of the volunteers camped out here at <a href="http://microsoftcambridge.com/Default.aspx?pmc=bing" target="_blank">Microsoft’s New England Research and Development Center</a>, affectionately known as NERD! Thank you Microsoft for letting us have run of your beautiful facility for the weekend. There was plenty of room for people to pull up a piece of the floor, grab a couch and pitch a tent……wait pitch a tent?&#160; That’s right some people even pitch tents!</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_08-23-45_358.jpg"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="2011-05-01_08-23-45_358" border="0" alt="2011-05-01_08-23-45_358" src="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_08-23-45_358_thumb.jpg?w=596&#038;h=448" width="596" height="448" /></a></p>
<p>As I stated before it takes a lot of food to keep an Army of Techies moving.&#160; The food this year did not disappoint!&#160; We had&#160; chowdah from <a href="http://shop.legalseafoods.com/?source=MSN&amp;page=homepage/pd/1" target="_blank">Legals</a>, sandwiches for <a href="http://www.getcosi.com/" target="_blank">Cosi</a> and pizza from <a href="http://www.nakedpizza.biz/" target="_blank">Naked</a>.&#160; </p>
<p><a href="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_07-51-35_478.jpg"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="2011-05-01_07-51-35_478" border="0" alt="2011-05-01_07-51-35_478" src="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_07-51-35_478_thumb.jpg?w=621&#038;h=468" width="621" height="468" /></a></p>
<p>And when there was too much food what did givecamp do?&#160; Give it away, of course, to a local shelter:</p>
<blockquote><p>“took <a href="http://twitter.com/#!/search?q=%23givecamp">#givecamp</a> leftovers, fruit, chips to <a href="http://www.casparinc.org/" target="_blank">CASPAR in Cambridge</a> &#8211; shelter housing 100 tonight. Another way <a href="http://twitter.com/#!/search?q=%23negc2011">#negc2011</a> makes a difference.” <a href="http://twitter.com/#!/jimoneil">@jimoneil</a></p>
</blockquote>
<p>So here we sit, the morning of the final day.&#160; Tech teams have 5 hours to get their projects done.&#160; They are frantically racing to deliver quality projects to their charities.&#160; The key word is quality.&#160; The goal is to handover all the work to the charities so they can build upon a foundation laid out by their tech teams.</p>
<p>So until next year I leave you give camp with this quote</p>
<blockquote><p>“Ladies and gentlemen, take my advice, pull down your pants and slide on the ice.” Dr. Sidney Freedman (M.A.S.H.)</p>
</blockquote>
<p>And I would add </p>
<blockquote><p>Get out of your office and do something nice!</p>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/201/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=201&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/05/01/greetings-from-new-england-givecamp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/05/givecampcolorlogo2011_thumb.png" medium="image">
			<media:title type="html">GiveCampColorLogo2011</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_08-03-07_699_thumb.jpg" medium="image">
			<media:title type="html">2011-05-01_08-03-07_699</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_08-23-45_358_thumb.jpg" medium="image">
			<media:title type="html">2011-05-01_08-23-45_358</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/05/2011-05-01_07-51-35_478_thumb.jpg" medium="image">
			<media:title type="html">2011-05-01_07-51-35_478</media:title>
		</media:content>
	</item>
		<item>
		<title>Controlling Silverlight Child Windows Using MVVM</title>
		<link>http://blog.davemdavis.net/2011/04/22/controlling-silverlight-child-windows-using-mvvm/</link>
		<comments>http://blog.davemdavis.net/2011/04/22/controlling-silverlight-child-windows-using-mvvm/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 20:19:24 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[MVVMLight]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/04/22/controlling-silverlight-child-windows-using-mvvm/</guid>
		<description><![CDATA[A while ago I wrote a post called “Silverlight Child Window With MEF and MVVM Light” where I laid out an approach on how to implement a child window in Silverlight while following MVVM.&#160; Some of the challenges of using &#8230; <a href="http://blog.davemdavis.net/2011/04/22/controlling-silverlight-child-windows-using-mvvm/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=190&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote a post called “<a href="http://blog.davemdavis.net/2010/07/24/silverlight-child-window-with-mef-and-mvvm-light/" target="_blank">Silverlight Child Window With MEF and MVVM Light</a>” where I laid out an approach on how to implement a child window in Silverlight while following MVVM.&nbsp; Some of the challenges of using MVVM center around keeping UI specifics out of the view model.&nbsp; Keeping UI out of the view model is not mandatory but seems to a generally accepted practice.&nbsp; So how do you launch UI without referencing UI?&nbsp; In my previous approach I used <a href="http://galasoft.ch/mvvm/" target="_blank">MVVMLight’s</a> to message to the active view to launch the dialog.&nbsp; The dialog would then message back with any return results that the view model would handle. A big component for passing objects around was MEF.&nbsp; In this post I am going show a couple of different ways to accomplish the same thing without using MEF, though I am still using MVVMLight.</p>
<h3>Goals</h3>
<p>The ultimate goal is to keep the UI specifics out of the view model.&nbsp; This separation increases the reusability of the view models while at the same time allowing for maintainability and testability.&nbsp; Another goal is to abstract out the launching of child windows so that they can be easily launched from any view.&nbsp; A good example of this is an Error Window.&nbsp; I will show an example of this in this post.</p>
<p>In this post I will show launching a dialog that requires passing data from the view. I will show an example that returns data from a dialog that the view model can consume. Finally I will show an example that takes my ReturnAction&lt;T&gt; object (described in my last post <a href="http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/" target="_blank">here</a>) to handle passing data back including any exceptions.&nbsp; You should be able to handle any situations by interchanging these building blocks.&nbsp; </p>
<p>All of my child windows have their own view models so I am limiting the amount of code I place in my view’s code behind.&nbsp; I am not an MVVM purist.&nbsp; I believe you can put code in the code behind as long as you limit it to view specific code and do not do any business logic there.&nbsp; In my case I will be setting properties on the DataContext (ViewModels).&nbsp; I will also be closing the child windows from the code behind as you will see in later examples.</p>
<h3></h3>
<p>The Pieces </p>
<p>The first step is to abstract the launching of the dialogs.&nbsp; To accomplish this I create a navigation service.&nbsp; Here is the interface for my navigation service:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image13.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb13.png?w=610&#038;h=105" width="610" height="105"></a></p>
<p>As you can see I have three different child windows in this demo, each requiring different data.&nbsp; Note you could also add a method for navigating to other pages if you are using a Silverlight Navigation application.&nbsp; This would allow you to navigate from page to page from the view models.</p>
<p>The actual implementation is responsible for launching the child windows passing any required arguments.&nbsp; Here is what my implementation looks like:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image14.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb14.png?w=602&#038;h=256" width="602" height="256"></a></p>
<p>Note the two different ways I am passing arguments to the child windows.&nbsp; In the first method I am passing an exception to the constructor of the ErrorView child window.&nbsp; I will then pass this parameter to the DataContext in the code behind of the ErrorView.&nbsp; The second dialog takes no arguments and returns a message that gets displayed in the main view.&nbsp; The final dialog takes a ReturnAction&lt;T&gt; which it uses to pass the results back to the main view. </p>
<p>The NavigationService is injected into the ViewModels&nbsp; from the ServiceProviderBase through the ViewModel Locator (described in my last post <a href="http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/" target="_blank">here</a>).&nbsp; I treat the NavigationService just like I treat the my service wrappers from my service layer.&nbsp; The NavigationService provides a service for the view model.&nbsp; </p>
<h3></h3>
<h3></h3>
<h3></h3>
<h3>A Reusable Error Dialog</h3>
<p>One of the most common dialog in an application should be the error dialog.&nbsp; There should be a mechanism to display friendly messages when an exception happens.&nbsp; This is especially useful when fault exceptions come back from service calls.&nbsp;&nbsp; I will be showing an example of this when I show the dialog that works with my ReturnAction&lt;T&gt;.&nbsp; For now I am going to explain how I implemented the ErrorView dialog.</p>
<p>You can see from the code above that I am passing the exception to the DisplayError method in my navigation service.&nbsp; It then calls the constructor on the ErrorView passing the exception:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image15.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb15.png?w=582&#038;h=144" width="582" height="144"></a></p>
<p>In the constructor I am casting the DataContext as an ErrorViewModel.&nbsp; I the set a property, that I created, with that exception.&nbsp; The DataContext is set in my Xaml (described in my last post <a href="http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/" target="_blank">here</a>).&nbsp; Through the magic of data binding the dialog calls ToString() on the exception and displays it to the user.&nbsp; If the dialog looks familiar it is because it is the same one that gets created by the “Silverlight Business Application” template in the New Project dialog.&nbsp; This shows how easily that can be adapted to fit this architecture. </p>
<p>Now to launch the dialog I bind a command to the button from the MainViewModel:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image16.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb16.png?w=594&#038;h=110" width="594" height="110"></a></p>
<p>That is how easy it is one line of code (line 77).</p>
<h3></h3>
<h3>Handling Return Data</h3>
<p>The next example will show how I handle dialogs that need to return data to the underlying View/ViewModel.&nbsp; In this example I am going to use the Messaging capabilities of the MVVMLight framework.&nbsp; There is nothing fancy with how I create the dialog.&nbsp; It is exactly the same way I created the ErrorView dialog above except that I am not passing any arguments. This is the dialog that gets launched:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image17.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb17.png?w=491&#038;h=377" width="491" height="377"></a></p>
<p>I bind a command to the ‘Ok’ button from the ViewModel:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image18.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb18.png?w=621&#038;h=97" width="621" height="97"></a></p>
<p>Here the Messenger class takes a MyMessage object and sends it out setting TheMessage property with the text in the TextBox. In the MainViewModel I subscribe to the message from the dialog.&nbsp; It takes the MyMessage object and uses it to set a property on the MainViewModel that is bound to a TextBlock on the view:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image19.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb19.png?w=635&#038;h=125" width="635" height="125"></a></p>
<p>The final thing to do is close the dialog.&nbsp; Since we removed the click handler from the ‘Ok’ button, the code that usually closes the dialog no longer gets called.&nbsp; So I subscribe to the same message in the dialog’s code behind.&nbsp; In the Action of the message I call the code that closes the dialog.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image20.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb20.png?w=608&#038;h=137" width="608" height="137"></a></p>
<p>One thing to note, it does not matter what you set DialogResult to.&nbsp; We are not subscribing to the close event of the dialog.&nbsp; We are handling any business logic (whether the user clicked ‘Cancel’ or ‘Ok’) through messaging.&nbsp; It is up to the view models to take appropriate actions.&nbsp; Theoretically you could hold off sending the message until a service returned and not do it right on the button click.&nbsp; This would allow for a save action, for instance, to complete prior to closing the dialog.&nbsp; But the decision to&nbsp; close now resides with the view models and not the view.</p>
<h3></h3>
<h3>An Alternate Way</h3>
<p>The previous example is one way to get data back from a dialog.&nbsp; Here is another way.&nbsp; It is a combination of the ErrorView (getting an object in) and the last example getting data back.&nbsp; In the ErrorView example I use the view code behind to set a property on the DataContext.&nbsp; Here is an alternate way to accomplish the same task without using the code behind:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image21.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb21.png?w=644&#038;h=113" width="644" height="113"></a></p>
<p>To understand what the ReturnAction&lt;T&gt; is look at my previous post <a href="http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/" target="_blank">here</a>.&nbsp; In a nutshell it captures a return object or and exception and allows the caller to create a call back method that gets called when the Notify method is called.&nbsp; Here is the ReturnAction&lt;T&gt; getting created:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image22.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb22.png?w=651&#038;h=98" width="651" height="98"></a></p>
<p>The constructor takes an Action callback which I will show in a few minutes.&nbsp; In the dialog I create commands to bind to buttons on the dialog. For this example I simulate a message and simulate an exception being thrown:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image23.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb23.png?w=653&#038;h=226" width="653" height="226"></a></p>
<p>(Note: I still have to use the Messenger to close the dialog).</p>
<p>In the MainViewModel I can now handle the action appropriately.&nbsp; If there is a message I can display it and if there is an error I can handle it.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image24.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb24.png?w=676&#038;h=248" width="676" height="248"></a></p>
<h3>Conclusion</h3>
<p>These example should give you some ideas as to how easy it is to use MVVM in your Silverlight Applications while dealing with Child Windows.&nbsp; With a little bit of infrastructure in place you are able to work with different views passing data back and forth.</p>
<p>If you want to play with the code you can get it <a href="http://dl.dropbox.com/u/16582482/ChildWindowExample.zip" target="_blank">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=190&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/04/22/controlling-silverlight-child-windows-using-mvvm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb17.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb18.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb19.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb20.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb21.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb22.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb23.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb24.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Isolating OData Calls in Silverlight.</title>
		<link>http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/</link>
		<comments>http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 20:34:08 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[OData]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/04/18/isolating-odata-calls-in-silverlight/</guid>
		<description><![CDATA[As Software Engineers we strive to build elegant solutions.&#160; We tend to layer our architecture so that our code is modular so that our code is testable and maintainable.&#160; With Silverlight this poses some particular challenges specifically when dealing with &#8230; <a href="http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=165&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As Software Engineers we strive to build elegant solutions.&nbsp; We tend to layer our architecture so that our code is modular so that our code is testable and maintainable.&nbsp; With Silverlight this poses some particular challenges specifically when dealing with external services.&nbsp; All external calls from with Silverlight are asynchronous in order to prevent developers from locking up the UI thread waiting for the response. How do we build our applications to conform to this while keeping us from tightly coupling our applications to the services we consume.</p>
<p>In this post I will document an approach that I have used a couple of times that allows me to layer my Silverlight application in the way I would any other application.&nbsp; That is the first trick to developing in Silverlight.&nbsp; Treat the Silverlight part of the application as if it were is its own application, because it is! This holds true whether you are using RIA Services or getting your data from an external web service. By treating it as its own application you tend to bring in accepted coding practices but as I stated before there are some challenges.</p>
<p>For this blog I am going to use a project that I just started and will be working in my spare time.&nbsp; I am building a File downloader to download content from <a href="http://live.visitmix.com/" target="_blank">Microsoft’s Mix11 Conference</a>. This little project was inspired by a project <a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/12/31/rebuilding-the-pdc-2010-silverlight-application-part-7.aspx" target="_blank">Mike Taulty did for last year’s PDC</a>.&nbsp; I know that there are easier ways to download the video content from the conference.&nbsp; Scott Hanselmen documents one such way by using the <a href="http://www.hanselman.com/blog/Mix11VideosDownloadThemAllWithRSS.aspx" target="_blank">RSS feeds from Channel 9</a>. This is more of an exercise to build an application that consumes an OData feed while at the same time maintaining an elegant solution. </p>
<p>Here is my initial layer diagram that I am working form:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/layerdiagram.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="LayerDiagram" border="0" alt="LayerDiagram" src="http://dmd0822.files.wordpress.com/2011/04/layerdiagram_thumb.png?w=604&#038;h=289" width="604" height="289"></a></p>
<p>These are the layers that I have come up with and will be working with through out this project.&nbsp; I will be covering the details and interesting aspects of each layer in the following sections.</p>
<h3>Presentation</h3>
<p>I choose to use M-V-VM when I develop with Silverlight.&nbsp; This pattern allows for separation of the UI markup from the functionality.&nbsp; There are many frameworks that help out when working with MVVM.&nbsp; The one I like to use the most is <a href="http://mvvmlight.codeplex.com/" target="_blank">MVVMLight</a>.&nbsp; This is a nice light weight framework that contains a bunch of templates, some base classes and a messaging service.&nbsp; Laurent Bugnion is even adding a light IoC container in the next version.&nbsp; There are other frameworks that perform similar functionality and are just as good (<a href="http://compositewpf.codeplex.com/" target="_blank">Prism</a> for one). I started using MVVMLight a few years ago and haven’t turned back since.</p>
<p>The next key to an elegant solution is to use a ViewModelLocator.&nbsp; There are a few schools of thought when it comes to binding ViewModels to Views.&nbsp; Some new them up in the constructor of the Views.&nbsp; The problem with this is that there is no design time feed back using this method.&nbsp; Others like to declare the binding in Xaml.&nbsp; This is similar to how I do it except that I bind to a property in my ViewModelLocator.&nbsp; With a ViewModelLocator you can control the lifetime of the ViewModel (new instance for each load or created once for the lifetime of the application).</p>
<p>Here is my ViewModelLocator: </p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image5.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb5.png?w=564&#038;h=534" width="564" height="534"></a></p>
<p>Here you can see that I am using my locator class to inject a dependency into my ViewModel (I may changes this in the future to use the Simple IoC class from the MVVMLight framework).&nbsp; I create an entry in a Resource Dictionary for my locator class.&nbsp; So binding the ViewModel to the View is as simple as this: </p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image6.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb6.png?w=617&#038;h=83" width="617" height="83"></a></p>
<p>In my ViewModelLocator you should notice a class called ServiceProviderBase.&nbsp; You may be asking yourself what purpose does this serve.&nbsp; I will tell you.&nbsp; As you recall from our layer diagram our data access services live in another project. This class serves a factory for serving up our services.&nbsp; In order to have design time data a DesignServiceProvider is created. Let’s take a look at the base class:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image7.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb7.png?w=615&#038;h=416" width="615" height="416"></a></p>
<p>As you can see it is implemented a Singleton and which instance to serve up is determined in the CreateInstance method.&nbsp; This method determines if it is design time or run time and serves up the proper provider.&nbsp; That rounds out my Presentation Layer except for some Resources and Value Converters (the other things that make the UI elegant).</p>
<h3>Model</h3>
<p>You can’t have MVVM with a Model.&nbsp; If you did you would VVM and that just does not look balanced! In this project I am not doing anything fancy.&nbsp; I did decide to create a model that is separate from the model that is generated from the service proxy.&nbsp; This will allow me to switch out the service layer implementation (say when the next conference happens) with little impact to my presentation layer.&nbsp; I handle the mapping in the service layer. That concludes the model layer, I will now return you to your regularly scheduled program…..I told you not too exciting.</p>
<h3>The Commons</h3>
<p>When I am developing Silverlight application, I find that there are some classes I can’t live without.&nbsp; These classes are needed in all the layers so I like to pull them out to a separate project that can be referenced throughout the application.&nbsp; Someday I may even create my own open source collection of these things.&nbsp; One of the biggest short comings of the Silverlight framework is a means to convert an IEnumerable into an ObservableCollection.&nbsp; ObservableCollection’s are used to bind collections to the ItemsSource property of ItemsControls.&nbsp; The observable part is what allows for updates to be delivered to the UI when something changes.&nbsp; So I implement this as an extension method in my common project.&nbsp; This is the kind of stuff that I like to put in.</p>
<p>One of the key things needed to separate out the services from the rest of the application is to have a means handle the asynchronous nature of service calls, especially when they are happening in a different dll. How does that presentation layer know when the service call they made is finished?&nbsp; I have seen a few different ways to handle this including creating events in my service layer that the ViewModels cans subscribe to.&nbsp; This is kind of like recreating the functionality in the proxy.&nbsp; This approach can complicate things when it comes to unit testing.&nbsp; The approach I like to take is to build out an object that contains a callback action.&nbsp; This approach is similar to the approached outlined by Ben Day in his post <a href="http://blog.benday.com/archive/2010/12/24/23300.aspx" target="_blank">Silverlight Asynchronous WCF Calls Without Ruining Your Architecture</a>. Here is my implementation of his ReturnResult object:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image8.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb8.png?w=631&#038;h=733" width="631" height="733"></a></p>
<p>The premise is that this object will be passed into all service calls.&nbsp; When the service returns the Notify method is called with either the results or and exception.&nbsp; The ViewModel can then handle this.&nbsp; This brings us to our Service Layer.</p>
<h3></h3>
<h3>The Serivce Layer</h3>
<p>This is the layer that is responsible for ferrying the data between the source and the Presentation Layer.&nbsp; The source can be anything from an RSS feed to a SOAP Service or in our case an OData feed.&nbsp; Here I am abstracting out the how the data is retrieved allowing the Presentation Layer to concentrate on presentation.&nbsp; I start out by creating a ServiceBase that is responsible for instantiating the proxy.&nbsp; Here is my ServiceBase for the Mix11 OData feed:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image9.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb9.png?w=601&#038;h=430" width="601" height="430"></a></p>
<p>I then create a design time service that returns design data and I create an actual runtime service.&nbsp; In Silverlight all service calls return void.&nbsp; The magic happens in the callback method.&nbsp; How do I get access to my ResultAction&lt;T&gt; object in the callback method?&nbsp; With a proxy created from a web service all the service method calls have an overload that takes an object that is available in the callback.&nbsp; all you have to do is cast it as the ReturnAction&lt;T&gt; and be on your way.&nbsp; I could not find such a thing when dealing with the DataServiceCollection&lt;T&gt; object used to pass queries to the OData service.&nbsp; So I created my own caller that inherits from DataServiceCollection&lt;T&gt; and has a property to hold any state that must persist after the call returns.&nbsp; Here is my caller:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image10.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb10.png?w=572&#038;h=625" width="572" height="625"></a></p>
<p>And here is an example of this class in action pre call:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image11.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb11.png?w=582&#038;h=120" width="582" height="120"></a></p>
<p>and post call:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image12.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb12.png?w=577&#038;h=363" width="577" height="363"></a></p>
<p>This also shows the ReturnAction&lt;T&gt; class in action.&nbsp; All my services implement interfaces that are used by the Presentation Layer in the ServiceProviders.&nbsp; The Service Layer allows for many different data sources.&nbsp; Adding/subtracting sources or even changing source will not have any affect on the Presentation Layer as long as they adhere to the contracts set forth in the interfaces. </p>
<h3></h3>
<h3>Conclusion</h3>
<p>This is a good place to stop for this post.&nbsp; In this post I have laid out a layered architecture that can help developers build elegant Silverlight solutions.&nbsp; I have addressed some of the pitfalls associated with Silverlight development and proposed solutions to those pitfalls that have worked for me.&nbsp; As I get further along in my quest for building this downloader I will write further post that other may find useful.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=165&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/04/18/isolating-odata-calls-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/layerdiagram_thumb.png" medium="image">
			<media:title type="html">LayerDiagram</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting a User&#8217;s Windows Identity in WCF</title>
		<link>http://blog.davemdavis.net/2011/04/11/getting-a-users-windows-identity-in-wcf/</link>
		<comments>http://blog.davemdavis.net/2011/04/11/getting-a-users-windows-identity-in-wcf/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 20:14:47 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/04/11/getting-a-users-windows-identity-in-wcf/</guid>
		<description><![CDATA[I was recently asked by a coworker, “How do I get the Windows Identity of a user calling my WCF service from Silverlight?”&#160; My answer to him was “To the Cloud!”&#160;&#160; No seriously, I put together a little demo application.&#160; &#8230; <a href="http://blog.davemdavis.net/2011/04/11/getting-a-users-windows-identity-in-wcf/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=146&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was recently asked by a coworker, “How do I get the Windows Identity of a user calling my WCF service from Silverlight?”&nbsp; My answer to him was “To the Cloud!”&nbsp;&nbsp; No seriously, I put together a little demo application.&nbsp; I figured I would write a short blog post so that others can partake in the logic. </p>
<p>The first question to as is why do I care about the Windows credentials of the user?&nbsp; The simple answer is that I am building an internal Line of Business (LOB) application and I want to use Windows Authentication .&nbsp; This makes sense.&nbsp; If your company does not have a federated solution so that you can use claims base security, then Windows Authentication is the next best thing.&nbsp; </p>
<p>Start out by creating a Silverlight application using the defaults, letting the template create the web application for you.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb.png?w=416&#038;h=334" width="416" height="334"></a></p>
<p>The first thing that you want to do is set up the web application to restrict users from accessing your web resources (xap files, .svc files, etc…).&nbsp; To do that add the following code to your web.config file:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb1.png?w=544&#038;h=144" width="544" height="144"></a></p>
<p>Obviously you would restrict the “allow” to specific domains and add a deny key for all other users.&nbsp; You can restrict down to the folder level, allowing different access rights to different folders.</p>
<p>Now you are ready to create the a service.&nbsp; For this example I am did a simple “Hello <em>User</em>” service.&nbsp; It has a single method that returns the Windows Identity of the user making the call.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb2.png?w=673&#038;h=166" width="673" height="166"></a></p>
<p>Ok the service method is configured, you need to modify service configuration in the web.config.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image3.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb3.png?w=638&#038;h=157" width="638" height="157"></a>&nbsp; </p>
<p>The key to this is the “security” configuration in the binding.&nbsp; Once the service is configured you add a reference from the Silverlight client just like you would normally do.&nbsp; There is nothing else you have to do.</p>
<p>My coworker then came back and said, “Our services are hosted on a different server this surely this won’t work in that situation?”&nbsp; So I added another web application created an identical to the service I created in the original web application.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/04/image4.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dmd0822.files.wordpress.com/2011/04/image_thumb4.png?w=315&#038;h=588" width="315" height="588"></a></p>
<p>What do you think happened?&nbsp; The same results. So it didn’t matter what server the services were on a different servers.</p>
<p>In this situation the client technology doesn’t matter.&nbsp; The client could be WPF or even Winforms.&nbsp; The key is your service configuration. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=146&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/04/11/getting-a-users-windows-identity-in-wcf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/04/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Update on the 5&#8217;s&#8221;</title>
		<link>http://blog.davemdavis.net/2011/04/05/update-on-the-5s/</link>
		<comments>http://blog.davemdavis.net/2011/04/05/update-on-the-5s/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 13:29:08 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[MIX11]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/04/05/update-on-the-5s/</guid>
		<description><![CDATA[Microsoft’s MIX11conference is next week in Las Vegas. This is Microsoft’s conference dedicated to UX.&#160; It has been at this conference where the various versions of Silverlight have be announce/released.&#160; It was at this, last year, that they announced the &#8230; <a href="http://blog.davemdavis.net/2011/04/05/update-on-the-5s/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=135&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://live.visitmix.com/mix11" target="_blank">Microsoft’s MIX11conference</a> is next week in Las Vegas. This is Microsoft’s conference dedicated to UX.&nbsp; It has been at this conference where the various versions of Silverlight have be announce/released.&nbsp; It was at this, last year, that they announced the Windows Phone 7 SDK. Prior to this year’s conference a message from Microsoft Developer Division VPs <a href="http://www.microsoft.com/Presspass/exec/abuhadba/default.aspx" target="_blank">Walid Abu-Hadba</a>, <a href="http://www.microsoft.com/presspass/exec/guthrie/" target="_blank">Scott Guthrie</a> and <a href="http://www.microsoft.com/presspass/exec/somasegar/default.aspx" target="_blank">Soma Somasegar</a> provides new clarification of Microsoft’s position on Silverlight and HTML 5 has been posted on <a href="http://team.silverlight.net/announcement/standards-based-web-plug-ins-and-silverlight/">The Silverlight Team Blog</a>.</p>
<p>The message that they are sending is choose the technology that bests fits your situation.&nbsp; They are also saying the Microsoft is committed to advancing development tools for both technologies. Based on this article here are my predictions for announcements for MIX11:</p>
<ul>
<ul>
<li>Emphasis on Silverlight 5 may pale in comparison to HTML5 and WP7.&nbsp; By the mere fact that they sent this message out they are trying to prevent another storm they received by downplaying Silverlight at PDC10. Also by announcing the SL5 Beta prior to the conference they are taking away some of the thunder that they like to have at these conferences.&nbsp; So where is the thunder…..</li>
<li>Thunder #1 tooling for HTML5. Microsoft has already started to support tooling for HTML5.&nbsp; <a href="http://expression.microsoft.com/en-us/cc136529.aspx" target="_blank">Expression Web 4 SP1</a> now supports HTML5.&nbsp; But where is the support for ASP.Net?&nbsp; I think you will hear about the .Net Framework vNext (4.5 or 5.o).&nbsp; So I am going to guess it is going to be a point release to 4.5.&nbsp; They may not have a beta/CTP ready yet but one would soon follow.</li>
<li>Thunder #2 a new/updated version of the WP7 SDK.&nbsp; There are two major release of the Windows Phone operating system coming up, Mango in the fall and WP8(?) sometime next year (to coincide with Windows 8). Here is what I would expect to here around these updates</li>
<ul>
<li>Full IE 9 (already announced for the Mango release) but with full support for in browser Silverlight applications!</li>
<li>Upgrading the OS to Silverlight 5. Right now it is a hybrid of SL3 and SL4 with some phone functionality thrown in.</li>
<li>Enterprise support (most likely would be in the release after Mango) for deploying internal corporate applications.&nbsp; Also support for enterprise IT organization to control phone functionality in order to more align with corporate IT policies.</li>
</ul>
</ul>
</ul>
<p>It will be interesting to see what comes out of next week.&nbsp; Like I said these are my predictions and I am sticking to them…..but since I don’t work for Microsoft I have no way of know what they are really going to do.&nbsp; I wish that I was going to MIX11 because no matter what they announce it is going to be an exciting place to be. I guess I will just have to watch the Keynotes online!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=135&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/04/05/update-on-the-5s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Repositories Matter!</title>
		<link>http://blog.davemdavis.net/2011/03/21/why-repositories-matter/</link>
		<comments>http://blog.davemdavis.net/2011/03/21/why-repositories-matter/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 18:02:33 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/03/21/why-repositories-matter/</guid>
		<description><![CDATA[I recently read a blog titled “Architecting in the pit of doom: The evils of the repository abstraction layer”. In it Ayende makes some pretty compelling points as to why you should not use repositories.  In his example he is &#8230; <a href="http://blog.davemdavis.net/2011/03/21/why-repositories-matter/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=131&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently read a blog titled “<a href="http://ayende.com/Blog/archive/2011/03/16/architecting-in-the-pit-of-doom-the-evils-of-the.aspx" target="_blank">Architecting in the pit of doom: The evils of the repository abstraction layer</a>”. In it Ayende makes some pretty compelling points as to why you should not use repositories.  In his example he is stating that NHibernate’s ISession and Entity Framework’s Context objects are repositories.  He also states that we should stop trying to abstract out the data source (stop trying to develop as if we are going to switch out databases).  When you have a single data source this may work.</p>
<p>I wanted to comment but decided that a post would be better. I can expand on my thought as to why repositories work.  The first comment that I want to make is problem should dictate the architecture.  To make a blanked statement that repositories are bad may close the door on certain solutions.  In some instances implementing repositories may over architect the solution but is some instances it may be the right thing to do.</p>
<p>I am working on a side project where I have implemented repositories.  I chose this solution because I have two different data sources.  I have data in a database and I am also using the <a href="http://odata.netflix.com/Catalog/" target="_blank">Netflix OData Service</a>. The repositories allow me to abstract out the OData calls.  My business layer can now work it a MovieRepository (data from OData) and a repository that gets data from my database.  The business layer can then aggregate the data from the two sources and pass it to the Presentation layer.</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/03/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://dmd0822.files.wordpress.com/2011/03/image_thumb.png?w=327&#038;h=371" border="0" alt="image" width="327" height="371" /></a></p>
<p>Through the Specification Pattern I can pass my queries to the repositories and not litter my BLL with data access specific code.  The other thing that I was able to do was to create a database table that had a sampling of the OData data.  I built a repository around that since it adheres to the interface for the OData repository, I can switch them out without a code chance.  I use Unity to inject the repositories into the business layer so switch is as easy as changing the config file.  Now I have a data set to work with in situations where the OData service is not available. </p>
<p>Repositories also allow me to go to one place to modify my data access code.  The key to using repositories is to have a good infrastructure in place in order to facilitate ease of development.  With right pieces in place adding functionality to an application should take no additional time.  A team from Microsoft – Spain put together the <a href="http://microsoftnlayerapp.codeplex.com/" target="_blank">Domain Oriented N-Layered .NET 4.0 Sample App</a>.  This is a great example of the use of Repository and Specification patterns.</p>
<h3>Conclusion</h3>
<p>The problem with patterns is we tend to over use them or adjust the situation to fit them.  The real skill of the developer is to know how to adapt them to the situation so that they become part of the solution and not part of the problem.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=131&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/03/21/why-repositories-matter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/03/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Implement an Entity Framework Trace Listener For Logging Application Block</title>
		<link>http://blog.davemdavis.net/2011/02/10/implement-an-entity-framework-trace-listener-for-logging-application-block/</link>
		<comments>http://blog.davemdavis.net/2011/02/10/implement-an-entity-framework-trace-listener-for-logging-application-block/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 16:53:03 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Enterprise Application Block]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2011/02/10/implement-an-entity-framework-trace-listener-for-logging-application-block/</guid>
		<description><![CDATA[I am working on a project that wants to implement a logging utilizing the Microsoft Enterprise Library 5.0.  The project has a need to create different types of logs (Auditing, Exception, …). This log information is going to be stored &#8230; <a href="http://blog.davemdavis.net/2011/02/10/implement-an-entity-framework-trace-listener-for-logging-application-block/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=126&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am working on a project that wants to implement a logging utilizing the <a href="http://msdn.microsoft.com/en-us/library/ff632023.aspx" target="_blank">Microsoft Enterprise Library 5.0</a>.  The project has a need to create different types of logs (Auditing, Exception, …). This log information is going to be stored in different tables in a SQL Server database.    Each table will have its own schema, capturing different data points required for the type of log.  The rest of the application is using Entity Framework so I thought I would utilize EF for the logging.</p>
<h5><strong>Log Entry to the Rescue </strong></h5>
<p>The first step is to come up with the schema that you want to use to store your log information.  Here is the entity of that I am going to use in the example for this post:</p>
<pre style="font-family:consolas;"><span style="color:#2b91af;">CustomLogEntry</span> log = <span style="color:blue;">new</span> <span style="color:#2b91af;">CustomLogEntry</span>();
log.Message = txtLog.Text;
log.Categories.Add(<span style="color:#2b91af;">Category</span>.General);
log.Priority = <span style="color:#2b91af;">Priority</span>.Normal;
log.MyStuff = <span style="color:blue;">string</span>.Format(<span style="color:#a31515;">"This is my stuff {0}"</span>, txtLog.Text);</pre>
<p><a href="http://dmd0822.files.wordpress.com/2011/02/image.png"><img style="display:inline;border-width:0;" title="image" src="http://dmd0822.files.wordpress.com/2011/02/image_thumb.png?w=237&#038;h=356" border="0" alt="image" width="237" height="356" /></a></p>
<p>I am capturing the data that is part of the LogEntry object plus I added my own column called MyStuff.  This could have been arbitrary data but LogEntry contains the data I want to capture. Plus you can use the Severity to filter what gets log.</p>
<p>Since I want most of the data from the LogEntry object I created my own entry object that inherits from LogEntry:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/02/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://dmd0822.files.wordpress.com/2011/02/image_thumb1.png?w=550&#038;h=377" border="0" alt="image" width="550" height="377" /></a></p>
<p>By inheriting from LogEntry I get all the goodness of the default logging framework and the ability to extend it to my will. </p>
<h5><strong>Who is Listening</strong></h5>
<p>Now that I have my LogEntry object I have to create my trace listener to write it out to the database.  The logging block use trace listeners to direct the entries to the appropriate destination.  You set up logging categories that can have 1 to many trace listeners.  The category allows you to filter out what gets sent to the listener based on the severity.  Next comes the listener.  My listener inherits from CustomTraceListener. Which is pretty basic.  There are three methods that you need to override TraceData, Write, and WriteLine.  In the TraceData method you determine if data coming in is of type CustomLogEntry.  if it is you pass it to the write method that implements the call to the Entity Framework.  Here is my custom listener:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/02/image2.png"><img style="display:inline;border-width:0;" title="image" src="http://dmd0822.files.wordpress.com/2011/02/image_thumb2.png?w=773&#038;h=606" border="0" alt="image" width="773" height="606" /></a></p>
<p>Here I am mapping my CustomLogEntry to my entity.  Optionally I could use a mapper or create a POCO Entity that inherits for LogEntry by modifying the T4 template.  I should also abstract out the data call to a repository so that I could easily switch out the implementation.  I did not do these things because this was a prototype to see how easily I can log data to a custom schema.</p>
<h5><strong>Configuration Time</strong></h5>
<p>Ok the pieces are now in place, what do I do.  The Enterprise Library come with a great tool for setting up the configuration.  Right click on the configuration file and select “Edit Enterprise Library V5 Configuration”:</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/02/image3.png"><img style="display:inline;border-width:0;" title="image" src="http://dmd0822.files.wordpress.com/2011/02/image_thumb3.png?w=494&#038;h=257" border="0" alt="image" width="494" height="257" /></a></p>
<p>Here you can wire up your listener to which ever category you want. Here my listener is wire to the General Category</p>
<p><a href="http://dmd0822.files.wordpress.com/2011/02/image4.png"><img style="display:inline;border-width:0;" title="image" src="http://dmd0822.files.wordpress.com/2011/02/image_thumb4.png?w=541&#038;h=323" border="0" alt="image" width="541" height="323" /></a></p>
<p>I won’t get into how to get your custom listener to display here but the <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4f8cd377-5522-4f45-a024-44a6ca5111ec&amp;displaylang=en" target="_blank">Hands on Labs</a> do a good job explaining this.</p>
<h5><strong>Log That Message</strong></h5>
<p>Now all you have to do is log messages.  Here is a code snippet that does just that:</p>
<pre style="font-family:consolas;">   <span style="color:#2b91af;">CustomLogEntry</span> log = <span style="color:blue;">new</span> <span style="color:#2b91af;">CustomLogEntry</span>();            log.Message = txtLog.Text;            log.Categories.Add(<span style="color:#2b91af;">Category</span>.General);            log.Priority = <span style="color:#2b91af;">Priority</span>.Normal;            log.MyStuff = <span style="color:blue;">string</span>.Format(<span style="color:#a31515;">"This is my stuff {0}"</span>, txtLog.Text);</pre>
<h5><strong>Summary </strong></h5>
<p>That is all there is to it.  There are other improvements that could be made but for the most part this should show you the control that you have when it comes to where you send your log information.</p>
<p>The source code for this example can be downloaded <a href="http://cid-b6b274a4de69d771.office.live.com/self.aspx/.Public/BlogSource/Custom%20Log%20Listener/CustomLogging.zip" target="_blank">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=126&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2011/02/10/implement-an-entity-framework-trace-listener-for-logging-application-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/02/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/02/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/02/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/02/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dmd0822.files.wordpress.com/2011/02/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Some Silverlight Resources to Help Get Started</title>
		<link>http://blog.davemdavis.net/2010/12/22/some-silverlight-resources-to-get-started/</link>
		<comments>http://blog.davemdavis.net/2010/12/22/some-silverlight-resources-to-get-started/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 14:18:49 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/2010/12/22/some-silverlight-resources-to-get-started/</guid>
		<description><![CDATA[I seem to get this question a lot “I want to get started in Silverlight…Where do I begin?”  A while back I put together an email to a friend with some resources that I have found helpful.  The last couple &#8230; <a href="http://blog.davemdavis.net/2010/12/22/some-silverlight-resources-to-get-started/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=113&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I seem to get this question a lot “I want to get started in Silverlight…Where do I begin?”  A while back I put together an email to a friend with some resources that I have found helpful.  The last couple of weeks I seem to have to go back to that email and forward it to others.  So I decided to put this post together so I don’t have to keep looking for it.</p>
<p>So what do we have here. This is a list of resources that I have found useful.  This is not an all encompassing list and I am sure that there are better resources (feel free to send me your favorites in the comments)</p>
<p>Start here: <a href="http://www.silverlight.net/">http://www.silverlight.net/</a></p>
<p>The Future of Microsoft Silverlight: <a href="http://www.microsoft.com/silverlight/future/">http://www.microsoft.com/silverlight/future/</a> The Future of Microsoft Silverlight</p>
<p>Silverlight 5 Plans Revealed: <a href="http://timheuer.com/blog/archive/2010/12/02/silverlight-5-revealed-at-firestarter.aspx?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+timheuer+%28Method+%7E+of+%7E+failed+by+Tim+Heuer%29">http://timheuer.com/blog/archive/2010/12/02/silverlight-5-revealed-at-firestarter.aspx?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+timheuer+%28Method+%7E+of+%7E+failed+by+Tim+Heuer%29</a></p>
<p>Silverlight Firestarter: <a href="http://www.silverlight.net/news/events/firestarter/">http://www.silverlight.net/news/events/firestarter/</a></p>
<p>Good MVVM Video: <a href="http://jpapa.me/pdc10kungfu">http://jpapa.me/pdc10kungfu</a> Associated blog post &#8211; <a href="http://johnpapa.net/silverlight/pdc10kungfu/">http://johnpapa.net/silverlight/pdc10kungfu/</a></p>
<p>Good blogs (from Microsoft people):</p>
<ul>
<li>John Papa &#8211; <a href="http://johnpapa.net/">http://johnpapa.net/</a></li>
<li>Tim Heuer &#8211; <a href="http://timheuer.com/blog/">http://timheuer.com/blog/</a></li>
<li>Mike Taulty &#8211; <a href="http://mtaulty.com/communityserver/blogs/mike_taultys_blog/default.aspx">http://mtaulty.com/communityserver/blogs/mike_taultys_blog/default.aspx</a></li>
<li>Jesse Liberty &#8211; <a href="http://jesseliberty.com/">http://jesseliberty.com/</a> (More Windows Phone 7 now)</li>
<li>Pete Brown &#8211; <a href="http://10rem.net/">http://10rem.net/</a></li>
</ul>
<p>Other Silverlight Blogs:</p>
<ul>
<li>Adam Kinney &#8211; <a title="http://adamkinney.com/blog/" href="http://adamkinney.com/blog/">http://adamkinney.com/blog/</a></li>
<li>Wyn Apse &#8211; <a title="http://geekswithblogs.net/WynApseTechnicalMusings/Default.aspx" href="http://geekswithblogs.net/WynApseTechnicalMusings/Default.aspx">http://geekswithblogs.net/WynApseTechnicalMusings/Default.aspx</a></li>
</ul>
<p>Good Book: <a href="http://www.amazon.com/Silverlight-4-Action-Pete-Brown/dp/1935182374/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1290136534&amp;sr=8-1">http://www.amazon.com/Silverlight-4-Action-Pete-Brown/dp/1935182374/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1290136534&amp;sr=8-1</a></p>
<p>This book has gotten a lot of good reviews from some respected people in the Silverlight Community: <a title="http://www.amazon.com/Silverlight-4-Unleashed-Laurent-Bugnion/dp/0672333368/ref=sr_1_4?ie=UTF8&amp;qid=1293027056&amp;sr=8-4" href="http://www.amazon.com/Silverlight-4-Unleashed-Laurent-Bugnion/dp/0672333368/ref=sr_1_4?ie=UTF8&amp;qid=1293027056&amp;sr=8-4">http://www.amazon.com/Silverlight-4-Unleashed-Laurent-Bugnion/dp/0672333368/ref=sr_1_4?ie=UTF8&amp;qid=1293027056&amp;sr=8-4</a>.  The author is also responsible for MVVMLight <a title="http://www.galasoft.ch/mvvm/getstarted/" href="http://www.galasoft.ch/mvvm/getstarted/">http://www.galasoft.ch/mvvm/getstarted/</a>.</p>
<p>Again these are just some of the resource I continually go back to.  Enjoy</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=113&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2010/12/22/some-silverlight-resources-to-get-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>
	</item>
		<item>
		<title>The Dawn of Interconnectivity!</title>
		<link>http://blog.davemdavis.net/2010/12/07/the-dawn-of-interconnectivity/</link>
		<comments>http://blog.davemdavis.net/2010/12/07/the-dawn-of-interconnectivity/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 17:07:13 +0000</pubDate>
		<dc:creator>dmd0822</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://dmd0822.wordpress.com/?p=110</guid>
		<description><![CDATA[I was cleaning out my RSS reader and came across an interesting post from KELLABYTE. She wants a seamlessly integrated world. I have seen commercials for Verizon FIOS that may be deliver that. The challenge comes in delivering that across &#8230; <a href="http://blog.davemdavis.net/2010/12/07/the-dawn-of-interconnectivity/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=110&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was cleaning out my RSS reader and came across an interesting <a href="http://kellabyte.com/2010/07/09/the-cloud-a-perfect-compliment-to-mobile/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+kellabyte+%28kellabyte%29">post from KELLABYTE</a>. She wants a seamlessly integrated world. I have seen commercials for Verizon FIOS that may be deliver that. The challenge comes in delivering that across the spectrum of applications. Pairing you life with the cloud is a must in this situation. Let’s take a look at the different challenges that would limit this achievement.</p>
<p><a title="Montana 047 by dmd0822, on Flickr" href="http://www.flickr.com/photos/daves_world/1767145649/"><img style="display:inline;margin-left:0;margin-right:0;border:0;" src="http://farm3.static.flickr.com/2013/1767145649_af2f21142b.jpg" border="0" alt="Montana 047" width="500" height="334" align="right" /></a></p>
<p>For reference I have copied the data stream that kellabyte would like to consume:</p>
<ul>
<li>Email</li>
<li>News (RSS)</li>
<li>Social (Twitter, etc)</li>
<li>Calendar</li>
<li>Media (music, video)</li>
<li>Documents</li>
<li>Web</li>
<li>Instant Messaging</li>
</ul>
<p>The first hurdle is the Cloud. All this data would have to live behind some service (the Cloud) in order to be consumed seamlessly by different devices. Outside of techies there are very few people who feel comfortable storing all their personal data on the cloud (you can’t tell that by what people post on face book). When it comes to non social website data it can become an issue of privacy. The mental hurdle is a little less for an average person compared to large corporations. Losing control of where their proprietary data resides does not sit well for most CIOs.</p>
<p>Next all applications would have to be delivered as Software as a Service (SaaS) or Software plus Services. In this space you have Google Docs and Microsoft Office Live have made strides in the documents, email and calendar. But other providers need to be on board with developing SaaS. Should there be some overarching framework to ensure interoperability? Most would say that is what Service Oriented Architectures are trying to do but most organization struggle with developing pure SOA.</p>
<p>Moving to the cloud requires bandwidth both in the mobile space and in the ISP space. All these bits moving back and forth are going to eat up the current bandwidth that a common users has. A lot of AT&amp;T customers currently complain about lagging networks think what would happen if everyone started moving to the cloud. The technology is catching up with services like FIOS and 4G mobile networks. Is it hard to imagine T1 lines to everyone’s home? This plays into the user experience. Usability will help drive adoption but it will also deter users as well. That is why there needs to be a strong infrastructure.</p>
<p>What would be the next hurdle that would need to be jumped, cost? Infrastructure changes require millions and millions of dollars. Application development requires funding. Hardware to support such a reality cost money. So what is the cost benefit analysis for companies that would under takes such an endeavor, the service providers, software makers, and application developers alike? Will there be a large enough user base to support such a capital undertaking? What kind of psychological barriers to adoption that need to be overcome.</p>
<p>Another technological challenge is security. I alluded to it before in that large corporations are reluctant to move to the cloud. Most of the infrastructure in existence was not developed with security in mind. Just think about what built in security mechanisms we have in TCP. A lot of the security we have has been bolted on as an afterthought. Moving to the cloud introduce a whole new round of privacy concerns. Unfortunately there are bad people in the world that are looking for opportunities to steal your data. I believe that until there is some strong belief of security is there gaining wide spread adoption will be a challenge.</p>
<p>The final challenge I want to address is the social aspects of this interconnectivity. Yes we interact socially through services like Twitter and Facebook but we lose out on the human interaction. We become tied to our devices so that we never unwind. This could lead to burn out if you don’t have a nontechnical outlet. You need something that requires you to become disconnected. Here is a personal experience. A group of coworker came around to my desk and asked who is up to going to lunch. I was game so off we went. As soon as we left the building out came the devices to check work emails. Really we weren’t gone 5 minutes. They couldn’t put down their devices for 30 minutes to enjoy lunch. Which goes to show that if they lost connectivity they would have major withdrawals. Is that a good thing?</p>
<p>There are the challenges so what are the benefits? For one, the prospect of the technology excites me. This opens a whole new line of thinking about how interact with the world around us. I believe that there are productivity gains to be had by being interconnected. I am also excited to see how we would interact with these technologies. The possibilities are endless and we are in an age of technological advances that will allow us to push the envelope.</p>
<p>I really enjoyed reading kellabyte’s post and really got me thinking as to what it would take to make interconnectivity a reality. I look forward to more debate on the topic.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmd0822.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmd0822.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dmd0822.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dmd0822.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmd0822.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmd0822.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmd0822.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmd0822.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davemdavis.net&amp;blog=5272298&amp;post=110&amp;subd=dmd0822&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davemdavis.net/2010/12/07/the-dawn-of-interconnectivity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9acf8c419b792dd362657f8233647de9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmd0822</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2013/1767145649_af2f21142b.jpg" medium="image">
			<media:title type="html">Montana 047</media:title>
		</media:content>
	</item>
	</channel>
</rss>
