<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Benjamin Day Consulting, Inc.</title>
	<atom:link href="http://www.benday.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benday.com</link>
	<description>Scrum, Team Foundation Server, and Visual Studio Best Practices</description>
	<lastBuildDate>Wed, 15 May 2013 16:15:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>VSLive Chicago 2013: TFS2012 Build Customization talk</title>
		<link>http://www.benday.com/2013/05/15/vslive-chicago-2013-tfs2012-build-customization-talk/</link>
		<comments>http://www.benday.com/2013/05/15/vslive-chicago-2013-tfs2012-build-customization-talk/#comments</comments>
		<pubDate>Wed, 15 May 2013 16:15:08 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[Application Lifecycle Management (ALM)]]></category>
		<category><![CDATA[Team Build]]></category>
		<category><![CDATA[Team Foundation Server (TFS)]]></category>
		<category><![CDATA[Visual Studio 2012]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=739</guid>
		<description><![CDATA[<p>Thanks to those of you who came to my TFS2012 Build customization talk at VSLive Chicago 2013 yesterday.&#160; As promised, here are the slides and samples from the talk.</p> <p>Team Foundation Server 2012 Builds: Understand, Configure, and Customize <p>The Build system in TFS2012 could be the best feature in the product. Actually, it’s almost definitely the best feature in the product. It’s got a slick Windows Workflow structure that has done away with the old-style, clunky text-based and XML-based scripts. It’s got a great integration with Source Control through Gated Check-ins that requires a build to pass before code can be checked in. (Buh-bye, broken builds.) There’s even integration with Virtual Lab Management to help with your QA process. <p>If [...]]]></description>
				<content:encoded><![CDATA[<p>Thanks to those of you who came to my TFS2012 Build customization talk at VSLive Chicago 2013 yesterday.&nbsp; As promised, here are the slides and samples from the talk.</p>
<blockquote><p><b>Team Foundation Server 2012 Builds: Understand, Configure, and Customize </b>
<p>The Build system in TFS2012 could be the best feature in the product. Actually, it’s almost definitely the best feature in the product. It’s got a slick Windows Workflow structure that has done away with the old-style, clunky text-based and XML-based scripts. It’s got a great integration with Source Control through Gated Check-ins that requires a build to pass before code can be checked in. (Buh-bye, broken builds.) There’s even integration with Virtual Lab Management to help with your QA process.
<p>If you want to eliminate a bunch of integration headaches and improve quality on your project, using TFS Builds is a perfect place to start.
<p>In this talk, Ben will start by giving you a tour of the features. Then he’ll move on to show you how to configure your build servers and builds. Finally, he’ll show you how to extend and customize the default build scripts to handle environment-specific configuration files, configuring IIS applications, and more.</p>
</blockquote>
<ul>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_TfsBuilds.pptx">Slides in PPTX</a>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_TfsBuilds.pdf">Slides in PDF</a>
<li><a href="http://www.benday.com/2012/12/17/updated-tfs2012-build-activities-now-with-iis-reset-and-database-deploy/">Custom TFS2012 Build Activities</a>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-TfsBuilds-Code.zip">Sample App, Build Scripts, and Build Editor project</a></li>
</ul>
<p>Enjoy!</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p>&#8211; <em>Looking for help getting going with Team Foundation Server 2012 Builds?&nbsp; Looking to get Lab Management configured?&nbsp; Looking to automate your QA test cases and run them from your TFS2012 Builds?&nbsp; Drop us a line at <a href="mailto:info@benday.com">info@benday.com</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/05/15/vslive-chicago-2013-tfs2012-build-customization-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSLive Chicago 2013: &#8220;Design for Testability&#8221; slides &amp; code</title>
		<link>http://www.benday.com/2013/05/15/vslive-chicago-2013-design-for-testability-slides-code/</link>
		<comments>http://www.benday.com/2013/05/15/vslive-chicago-2013-design-for-testability-slides-code/#comments</comments>
		<pubDate>Wed, 15 May 2013 16:13:19 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Unit Testing / Test-Driven Development (TDD)]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=738</guid>
		<description><![CDATA[<p>I just wrapped up at VSLive Chicago 2013 and, as promised, here are my slides and code samples from the “Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces” talk.&#160; </p> <p>Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces <p>You’re sold on unit testing. You’re even doing “test first” development – but there are always those nagging questions. How do your user interfaces fit into your testing plan? Do I have to call my database in order to have a good, solid test? What about calls into separate sub-systems or calls out to web services? Do you really need to have all those pieces running in order to test your logic? Are my UI tests the same for WPF, [...]]]></description>
				<content:encoded><![CDATA[<p>I just wrapped up at VSLive Chicago 2013 and, as promised, here are my slides and code samples from the <em>“Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces”</em> talk.&nbsp; </p>
<blockquote><p><b>Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces</b>
<p>You’re sold on unit testing. You’re even doing “test first” development – but there are always those nagging questions. How do your user interfaces fit into your testing plan? Do I have to call my database in order to have a good, solid test? What about calls into separate sub-systems or calls out to web services? Do you really need to have all those pieces running in order to test your logic? Are my UI tests the same for WPF, Windows Forms, Windows Phone, Win RT, and ASP.NET? What do I do about that app that doesn’t have any tests?
<p>In this session, Ben will start by clarifying the difference between “unit” and “integration” tests. After that, he’ll demonstrate how using dependency injection, mocks objects and stubs can help break dependencies and simplify your tests. Throughout the talk, you can expect to hear a lot about design patterns, how much code coverage is enough, and the fine line between too much and too little object mocking.</p>
</blockquote>
<ul>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_DesignForTestability.pptx">Slides in PPTX</a>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_DesignForTestability.pdf">Slides in PDF</a>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-BeyondBasicUnitTestingWithVsFakes.zip">Code samples for the demos using Visual Studio 2012 Fakes Framework</a>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-BeyondBasicUnitTestingWithRhinoMocks.zip">Code samples for the demos using RhinoMocks</a>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-VsFakes-ShimsDemo.zip">Code sample for the Visual Studio Shims demo that I mentioned</a></li>
</ul>
<p>Enjoy!</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p><em>&#8211; Looking for help getting going on unit testing, integration testing, and Coded UI testing?&nbsp; Want to raise your testing game?&nbsp; Got an ‘untestable’ app that you’d like to start testing?&nbsp; Drop us a line at <a href="mailto:info@benday.com">info@benday.com</a>.&nbsp; </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/05/15/vslive-chicago-2013-design-for-testability-slides-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem moving virtual machines between Hyper-V 2012 hosts</title>
		<link>http://www.benday.com/2013/05/09/problem-moving-virtual-machines-between-hyper-v-2012-hosts/</link>
		<comments>http://www.benday.com/2013/05/09/problem-moving-virtual-machines-between-hyper-v-2012-hosts/#comments</comments>
		<pubDate>Thu, 09 May 2013 15:38:53 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=737</guid>
		<description><![CDATA[<p>(Huge thanks to <a href="http://thehyperadvisor.com/2013/01/microsoft-hyper-v-2012-live-migration-and-constrained-delegation/">Antone Heyward for the answer to this problem</a>.)</p> <p>One of the things I love about Hyper-V 2012 is that you can easily move Hyper-v virtual machines (guests) between Hyper-V hosts using the Hyper-V Manager app.&#160; Sure, in previous versions of Hyper-V you could do an Export, Copy, and Import to move VMs between hosts but that’s a lot of manual steps.&#160; Or, if you were feeling really motivated, you could set up System Center Virtual Machine Manager and have SCVMM handle moving your hosts around.&#160; </p> <p>I ran into a problem today moving some VMs between some new Hyper-V hosts.&#160; I’d right-click on the machine, choose Move…, and then go through the migration wizard only get [...]]]></description>
				<content:encoded><![CDATA[<p><em>(Huge thanks to </em><a href="http://thehyperadvisor.com/2013/01/microsoft-hyper-v-2012-live-migration-and-constrained-delegation/"><em>Antone Heyward for the answer to this problem</em></a><em>.)</em></p>
<p>One of the things I love about Hyper-V 2012 is that you can easily move Hyper-v virtual machines (guests) between Hyper-V hosts using the Hyper-V Manager app.&nbsp; Sure, in previous versions of Hyper-V you could do an Export, Copy, and Import to move VMs between hosts but that’s a lot of manual steps.&nbsp; Or, if you were feeling really motivated, you could set up System Center Virtual Machine Manager and have SCVMM handle moving your hosts around.&nbsp; </p>
<p>I ran into a problem today moving some VMs between some new Hyper-V hosts.&nbsp; I’d right-click on the machine, choose Move…, and then go through the migration wizard only get an error.&nbsp; Here’s the error:</p>
<p><em>“Failed to establish a connection with host ‘VESIME’: the credentials supplied to the package were not recognized (0x8009030D).&nbsp; The Virtual Machine Management Service failed to authenticate the connection for a Virtual Machine migration at the source host: no suitable credentials available.&nbsp; Make sure the operation is initiated on the source host of the migration, or the source host is configured to use Kerberos for the authentication of migration connections and Constrained Delegation is enabled for the host in Active Directory.”</em></p>
<p>&nbsp;</p>
<p><a href="http://www.benday.com/wp-content/uploads/2013/05/SNAGHTML1d2970.png"><img title="SNAGHTML1d2970" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML1d2970" src="http://www.benday.com/wp-content/uploads/2013/05/SNAGHTML1d2970_thumb.png" width="397" height="268"></a><br /><em>Right-click the VM you want to migrate and choose Move… from the context menu.</em></p>
<p><em></em>&nbsp;</p>
<p><a href="http://www.benday.com/wp-content/uploads/2013/05/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.benday.com/wp-content/uploads/2013/05/image_thumb.png" width="503" height="476"></a><br /><em>Here’s that error message.</em></p>
<p>&nbsp;</p>
<p>Two things popped out at me in that error.&nbsp; 1) “Make sure the operation is initiated on the source host” and 2) “make sure…Constrained Delegation is enabled for the host in Active Directory.”&nbsp; For item #1, I tried logging in to the source server and starting the migration from there and it worked.&nbsp; Win.&nbsp; But that’s a bit of a pain so I started looking for how to enable Constrained Delegation.&nbsp; </p>
<p>The answer came from <a href="http://thehyperadvisor.com/2013/01/microsoft-hyper-v-2012-live-migration-and-constrained-delegation/">Antone Heyward’s blog post “Microsoft Hyper-V 2012 Live Migration and Constrained Delegation”</a>.&nbsp; Antone has a full walk-through on his blog but here’s the short form.</p>
<p>Step 1: Go to Hyper-V settings for the host machines and enable Live Migrations using Kerberos.</p>
<p><a href="http://www.benday.com/wp-content/uploads/2013/05/SNAGHTML283726.png"><img title="SNAGHTML283726" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML283726" src="http://www.benday.com/wp-content/uploads/2013/05/SNAGHTML283726_thumb.png" width="700" height="460"></a></p>
<p>Step 2: Go to Active Directory Users and Computers and for each Hyper-V host server enable delegation for “cifs” and “Microsoft Virtual System Migration Service” for all the servers you want to migrate to/from.&nbsp; </p>
<p><a href="http://www.benday.com/wp-content/uploads/2013/05/SNAGHTML2a0c02.png"><img title="SNAGHTML2a0c02" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML2a0c02" src="http://www.benday.com/wp-content/uploads/2013/05/SNAGHTML2a0c02_thumb.png" width="708" height="501"></a></p>
<p>Done and done.&nbsp; </p>
<p>&nbsp;</p>
<p>-Ben</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/05/09/problem-moving-virtual-machines-between-hyper-v-2012-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSLive Las Vegas 2013: TFS2012 Build Customization talk</title>
		<link>http://www.benday.com/2013/03/27/vslive-las-vegas-2013-tfs2012-build-customization-talk/</link>
		<comments>http://www.benday.com/2013/03/27/vslive-las-vegas-2013-tfs2012-build-customization-talk/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 20:32:53 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[Application Lifecycle Management (ALM)]]></category>
		<category><![CDATA[Team Build]]></category>
		<category><![CDATA[Team Foundation Server (TFS)]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=723</guid>
		<description><![CDATA[<p>Thanks to those of you who came to my TFS2012 Build customization talk at VSLive Vegas 2013 yesterday.&#160; As promised, here are the slides and samples from the talk.</p> <p>Team Foundation Server 2012 Builds: Understand, Configure, and Customize <p>The Build system in TFS2012 could be the best feature in the product. Actually, it’s almost definitely the best feature in the product. It’s got a slick Windows Workflow structure that has done away with the old-style, clunky text-based and XML-based scripts. It’s got a great integration with Source Control through Gated Check-ins that requires a build to pass before code can be checked in. (Buh-bye, broken builds.) There’s even integration with Virtual Lab Management to help with your QA process. <p>If [...]]]></description>
				<content:encoded><![CDATA[<p>Thanks to those of you who came to my TFS2012 Build customization talk at VSLive Vegas 2013 yesterday.&nbsp; As promised, here are the slides and samples from the talk.</p>
<blockquote><p><b>Team Foundation Server 2012 Builds: Understand, Configure, and Customize </b>
<p>The Build system in TFS2012 could be the best feature in the product. Actually, it’s almost definitely the best feature in the product. It’s got a slick Windows Workflow structure that has done away with the old-style, clunky text-based and XML-based scripts. It’s got a great integration with Source Control through Gated Check-ins that requires a build to pass before code can be checked in. (Buh-bye, broken builds.) There’s even integration with Virtual Lab Management to help with your QA process.
<p>If you want to eliminate a bunch of integration headaches and improve quality on your project, using TFS Builds is a perfect place to start.
<p>In this talk, Ben will start by giving you a tour of the features. Then he’ll move on to show you how to configure your build servers and builds. Finally, he’ll show you how to extend and customize the default build scripts to handle environment-specific configuration files, configuring IIS applications, and more.</p>
</blockquote>
<ul>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_TfsBuilds.pptx">Slides in PPTX</a></li>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_TfsBuilds.pdf">Slides in PDF</a></li>
<li><a href="http://www.benday.com/2012/12/17/updated-tfs2012-build-activities-now-with-iis-reset-and-database-deploy/">Custom TFS2012 Build Activities</a></li>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-TfsBuilds-Code.zip">Sample App, Build Scripts, and Build Editor project</a></li>
</ul>
<p>Enjoy!</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p>&#8211; <em>Looking for help getting going with Team Foundation Server 2012 Builds?&nbsp; Looking to get Lab Management configured?&nbsp; Looking to automate your QA test cases and run them from your TFS2012 Builds?&nbsp; Drop us a line at <a href="mailto:info@benday.com">info@benday.com</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/03/27/vslive-las-vegas-2013-tfs2012-build-customization-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSLive Las Vegas 2013: &#8220;Design for Testability&#8221; slides &amp; code</title>
		<link>http://www.benday.com/2013/03/27/vslive-las-vegas-2013-design-for-testability-slides-code/</link>
		<comments>http://www.benday.com/2013/03/27/vslive-las-vegas-2013-design-for-testability-slides-code/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 20:11:37 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Unit Testing / Test-Driven Development (TDD)]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=721</guid>
		<description><![CDATA[<p>I just wrapped up at VSLive Las Vegas 2013 and, as promised, here are my slides and code samples from the “Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces” talk.&#160; </p> <p>Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces <p>You’re sold on unit testing. You’re even doing “test first” development – but there are always those nagging questions. How do your user interfaces fit into your testing plan? Do I have to call my database in order to have a good, solid test? What about calls into separate sub-systems or calls out to web services? Do you really need to have all those pieces running in order to test your logic? Are my UI tests the same for [...]]]></description>
				<content:encoded><![CDATA[<p>I just wrapped up at VSLive Las Vegas 2013 and, as promised, here are my slides and code samples from the <em>“Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces”</em> talk.&nbsp; </p>
<blockquote><p><b>Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces</b>
<p>You’re sold on unit testing. You’re even doing “test first” development – but there are always those nagging questions. How do your user interfaces fit into your testing plan? Do I have to call my database in order to have a good, solid test? What about calls into separate sub-systems or calls out to web services? Do you really need to have all those pieces running in order to test your logic? Are my UI tests the same for WPF, Windows Forms, Windows Phone, Win RT, and ASP.NET? What do I do about that app that doesn’t have any tests?
<p>In this session, Ben will start by clarifying the difference between “unit” and “integration” tests. After that, he’ll demonstrate how using dependency injection, mocks objects and stubs can help break dependencies and simplify your tests. Throughout the talk, you can expect to hear a lot about design patterns, how much code coverage is enough, and the fine line between too much and too little object mocking.</p>
</blockquote>
<ul>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_DesignForTestability.pptx">Slides in PPTX</a></li>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/VSLLV13_BenDay_DesignForTestability.pdf">Slides in PDF</a></li>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-BeyondBasicUnitTestingWithVsFakes.zip">Code samples for the demos using Visual Studio 2012 Fakes Framework</a></li>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-BeyondBasicUnitTestingWithRhinoMocks.zip">Code samples for the demos using RhinoMocks</a></li>
<li><a href="http://www.benday.com/presentations/VSLiveVegas2013/BenDay-VSL-Vegas2013-VsFakes-ShimsDemo.zip">Code sample for the Visual Studio Shims demo that I mentioned</a></li>
</ul>
<p>Enjoy!</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p><em>&#8211; Looking for help getting going on unit testing, integration testing, and Coded UI testing?&nbsp; Want to raise your testing game?&nbsp; Got an ‘untestable’ app that you’d like to start testing?&nbsp; Drop us a line at <a href="mailto:info@benday.com">info@benday.com</a>.&nbsp; </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/03/27/vslive-las-vegas-2013-design-for-testability-slides-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Slides &amp; Video from &#8220;Agile Under a Waterfall&#8221; talk at ALM Summit 2013</title>
		<link>http://www.benday.com/2013/01/30/slides-from-agile-under-a-waterfall-talk-at-alm-summit-2013/</link>
		<comments>http://www.benday.com/2013/01/30/slides-from-agile-under-a-waterfall-talk-at-alm-summit-2013/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 22:07:22 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[Microsoft Project Server]]></category>
		<category><![CDATA[Scrum]]></category>
		<category><![CDATA[Team Foundation Server (TFS)]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=717</guid>
		<description><![CDATA[<p>I finished up presenting at <a href="http://www.alm-summit.com/" target="_blank">the 2013 ALM Summit</a> a little while ago where I presented “Agile Under a Waterfall.”&#160; </p> <p>Agile Under a Waterfall <p>It would be so easy if everyone at our companies just used Scrum &#8212; or at least Agile. No one would lean on the team for dates and deadlines, and everyone would know that change is a good thing. It&#8217;d be one great big happy project management family. But let&#8217;s face it &#8212; an all-Agile organization isn&#8217;t always possible. Maybe you have a Project Management Office (PMO). Maybe you work for a government contractor. Maybe you have regulatory requirements. Maybe you&#8217;re the first Scrum/Agile project at your company. Maybe your company simply *likes* [...]]]></description>
				<content:encoded><![CDATA[<p>I finished up presenting at <a href="http://www.alm-summit.com/" target="_blank">the 2013 ALM Summit</a> a little while ago where I presented “Agile Under a Waterfall.”&nbsp; </p>
<blockquote><p><b>Agile Under a Waterfall</b>
<p>It would be so easy if everyone at our companies just used Scrum &#8212; or at least Agile. No one would lean on the team for dates and deadlines, and everyone would know that change is a good thing. It&#8217;d be one great big happy project management family. But let&#8217;s face it &#8212; an all-Agile organization isn&#8217;t always possible. Maybe you have a Project Management Office (PMO). Maybe you work for a government contractor. Maybe you have regulatory requirements. Maybe you&#8217;re the first Scrum/Agile project at your company. Maybe your company simply *likes* it this way. Whatever the reason, Agile teams frequently report into Waterfall organizations.
<p>Your team thinks &#8220;backlog&#8221; and your bosses think &#8220;project plan.&#8221; How do you make it work? How do you ensure communication and foster trust between the two groups? How do you bridge the project management impedance mismatch? You need to find a way get everybody to ‘play nice’ so they can do their jobs.
<p>In this session, we’ll drill into the details of the project management impedance mismatch and talk about strategies to improve communication and delivery when you need to make Agile work inside a Waterfall-centric organization.</p>
</blockquote>
<p>As promised, here are the slides for the talk in <a href="http://www.benday.com/BlogFiles/AlmSummit2013/BenDay_ScrumUnderAWaterfall_AlmSummit2013-v1.pptx" target="_blank">PowerPoint format</a> and <a href="http://www.benday.com/BlogFiles/AlmSummit2013/BenDay_ScrumUnderAWaterfall_AlmSummit2013-v1.pdf" target="_blank">in PDF</a>.</p>
<p><strong><em>Update 2/18/2013:</em> </strong>The <a href="http://channel9.msdn.com/Events/ALM-Summit/ALM-Summit-3/Agile-Under-a-Waterfall" target="_blank">video is on Channel 9</a> for the talk now.</p>
<p><a href="http://channel9.msdn.com/Events/ALM-Summit/ALM-Summit-3/Agile-Under-a-Waterfall"><img title="SNAGHTML46cde92" style="display: inline" alt="SNAGHTML46cde92" src="http://www.benday.com/wp-content/uploads/2013/02/SNAGHTML46cde92.png" width="529" height="386"></a></p>
<p>-Ben</p>
<p>&nbsp;</p>
<p><em>&#8211; Looking for help with Scrum Under a Waterfall at your company?&nbsp; Thinking about adopting Team Foundation Server and Microsoft Project Server?&nbsp; Want training for your teams on delivering great, working software with Scrum?&nbsp; Drop us a line at </em><a href="mailto:info@benday.com"><em>info@benday.com</em></a><em>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/01/30/slides-from-agile-under-a-waterfall-talk-at-alm-summit-2013/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Strategies for Sharing Code between Windows Phone 8 and Windows 8 Applications</title>
		<link>http://www.benday.com/2013/01/24/strategies-for-sharing-code-between-windows-phone-8-and-windows-8-applications/</link>
		<comments>http://www.benday.com/2013/01/24/strategies-for-sharing-code-between-windows-phone-8-and-windows-8-applications/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 19:19:41 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[Visual Studio 2012]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone 8 (WP8)]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=714</guid>
		<description><![CDATA[<p>(NOTE: A <a href="http://www.benday.com/BlogFiles/CodeSharingBetweenWindowsPhone8AndWindows8/BenDay_ShareCodeBetweenWin8AndWP8.pdf" target="_blank">PDF version of this article is available for download</a>.)</p> <p>Visual Studio 2012 is out and we can write apps for Windows Store and now (finally) we have access to the Windows Phone 8 SDK and Windows Phone 8 devices. We’ve been hearing and reading for a while that the platforms are very similar to code for and after doing some coding for both platforms I only kind of agree. Windows Store applications for Windows 8 are written using C#, XAML, and WinRT. Windows Phone 8 is still basically Silverlight.</p> <p>The real big question on everyone’s mind is just how much code you can actually share between your Windows Store apps and your Windows Phone apps. The [...]]]></description>
				<content:encoded><![CDATA[<p><em>(NOTE: A </em><a href="http://www.benday.com/BlogFiles/CodeSharingBetweenWindowsPhone8AndWindows8/BenDay_ShareCodeBetweenWin8AndWP8.pdf" target="_blank"><em>PDF version of this article is available for download</em></a><em>.)</em></p>
<p>Visual Studio 2012 is out and we can write apps for Windows Store and now (finally) we have access to the Windows Phone 8 SDK and Windows Phone 8 devices. We’ve been hearing and reading for a while that the platforms are very similar to code for and after doing some coding for both platforms I only kind of agree. Windows Store applications for Windows 8 are written using C#, XAML, and WinRT. Windows Phone 8 is still basically Silverlight.</p>
<p>The real big question on everyone’s mind is just how much code you can actually share between your Windows Store apps and your Windows Phone apps. The answer is that you can actually share a lot of code but – get ready to not be surprised – like most things in software, you have to plan for it. That planning will almost definitely require you to abstract away a lot of details and use interface-driven programming.
<p>There are 3 main ways to share code: 1) portable class libraries, 2) multiple projects using linked code, and 3) branching &amp; merging via your source control repository. A Portable Class Library is a project type in Visual Studio 2012 that lets you target multiple frameworks from a single project. In the case of Figure 1 &#8212; Choose the frameworks for a Portable Class Library, you can see that the project targets version 4.5 of the .NET Framework, Silverlight 5, Windows Phone 8, and .NET for Windows Store apps. Basically, what’s going on here is that Visual Studio 2012 now becomes smart enough to know what is the lowest common denominator for all of these frameworks, will tell you what isn’t valid, and will generate an assembly that can be referenced by all these platforms.
<p><a href="http://www.benday.com/wp-content/uploads/2013/01/image.png"><img title="image" style="margin: 0px; display: inline" alt="image" src="http://www.benday.com/wp-content/uploads/2013/01/image_thumb.png" width="385" height="375"></a></p>
<p><em><u>Figure 1</u></em><em> &#8212; Choose the frameworks for a Portable Class Library</em>
<p>The second way of sharing is via linked code. The idea here is that you have two different project files that point to the same classes on disk. Let’s say you have a Windows Phone 8 assembly project and a Windows Store assembly project – respectively, Project A and Project B. You’ll first create a class in Project A and then you’ll go to Project B, choose Add, and then Add An Existing Item. When the Add Existing Item dialog pops up, you select the class file, and then instead of clicking the Add button, you’ll choose Add As Link instead. The Add As Link option isn’t obvious and it’s hidden in a little dropdown menu off of the Add button as shown in Figure 2 &#8212; Add an existing item using Add As Link. Once you’ve created the link, any changes you make to that file in one project is instantly reflected in that same file in the other project.
<p><a href="http://www.benday.com/wp-content/uploads/2013/01/image1.png"><img title="image" style="display: inline" alt="image" src="http://www.benday.com/wp-content/uploads/2013/01/image_thumb1.png" width="624" height="438"></a>
<p><em><u>Figure 2</u> – Add an existing item using Add As Link</em></p>
<p>The third way to share code is using the branching and merging functionality of a source control repository such as Team Foundation Server 2012. This approach is going to look similar to the linked code version of code sharing. You’ll have two different projects (Project A and Project B) that target different platforms and they’ll have similar files in them. The main difference is that you’ll have two separate copies of the shared files on your disk and any changes you make won’t automatically propagate between projects – you’ll need to perform a Merge in source control in order to move files between projects. The blessing here is that you can track exactly what is shared and you can decide when you choose to move sync code between the projects. If you use the linked code approach, changes you make in Project A might work on that platform but break the app in Project B. The curse with the branching and merging approach is that it’s a little cumbersome.
<p>For any of these approaches, there are upsides and downsides. Sharing via branching and merging appeals to my inner control freak but it’s cumbersome and is almost definitely going to put you into the dreaded and labor intensive “cherry pick merge” model. The Linked Code approach has a fair number of downsides, too. First off, it offends my inner Application Lifecycle Management (ALM) Control Freak because changes instantly appear in both projects. Secondly, it’s exactly the same code in both projects – right down to the namespace. So, you’ll have two classes in your solution that have exactly the same namespace and class name. That nags at me because the default namespace for Project A and Project B might not be the same. In Project A it might be TheAwesomeApp.WinPhone.MyClass and in Project B you might want it to TheAwesomeApp.WinStore.MyClass but you’ll be stuck with the original namespace and now the naming convention in Project B won’t match all the other classes in that project. I know that it’s a little OCD of me but clean, well-organized code is easier to maintain.
<p>Sharing using the Portable Class Library approach for sharing feels like it’s the cleanest and most polished way to go. Like the rest of the sharing approaches, you’ll need to write platform agnostic, lowest common denominator, non-partisan code but you don’t have any branch/merge headaches and you’re dealing with literally the same binary for each platform rather than having to think about a similar but not-quite-the-same version. It’s the same binary. Done and done.
<p><b>Finding the Lowest Common Denominator (LCD)</b>
<p>Three quick thoughts on Portable Class Libraries (PCLs) and the Lowest Common Denominator (LCD) problem. Thought #1: if you’re writing a PCL, you have to write code that works on all the platforms targeted by that PCL. That set of code that works on all the platforms is the LCD. Thought #2: platform-specific, non-Portable exe’s and assemblies can reference a PCL but a PCL can only reference another PCL. Thought #3: The big things that are different between the platforms are networking code, data-access code, and which APIs are required to be asynchronous. Those three things govern the shape of your application architecture because of what can reference what and what you need to be abstract.
<p>When I write a XAML-based application with C#, I use a layered architecture that is comprised of the following layers:
<p>1) The XAML user interface layer: this is the platform-specific user interface that targets the Phone or the Windows Store or Silverlight or .NET/WPF. This project generates an EXE or a XAP.
<p>2) The Model-View-ViewModel (MVVM) presentation layer: This project contains my ViewModels. The ViewModels are the code-based abstraction of everything that is displayed on a particular screen. My XAML-based user interfaces are going to have references to instances of the ViewModels and use data binding to move information to and from these classes and the running user interface that the user will manipulate.
<p>3) The Model layer: This project contains the Model classes (aka. the “business objects”) that contain my business logic. These Models are what get saved to and from my database or file system storage or web services.
<p>4) The Data Access layer: This project could also be called the Persistence Layer because it is primarily concerned with persisting (aka. saving) my application data to whatever my persistent store is. A persistent store could be a database or a service or the file system or local storage. Basically, anyplace that I can store data so that that data doesn’t disappear when I pull the plug on my app. The classes in the project commonly use the Repository Pattern and the Adapter Pattern to save and load instances of the Models to/from my persistent store.
<p>5) The Common code layer: This project will contain any common code that can be referenced by any of the other layers. This project contains the C# interfaces that are implemented by my Models, ViewModels, Adapters, and Repositories.
<p>In the simplest form, the user interface references the ViewModels which reference the Models which references the Data Access layer and everything references Common (see Figure 3 &#8212; Layers and their references). When you’re sharing code across platforms, the ViewModels, Models, and Common code are the same and the XAML UIs and the Data Access layers are completely different. This means that the ViewModel, Model, and Common projects are all going to be PCLs and the other projects will be platform-specific.
<p><a href="http://www.benday.com/wp-content/uploads/2013/01/image2.png"><img title="image" style="margin: 0px; display: inline" alt="image" src="http://www.benday.com/wp-content/uploads/2013/01/image_thumb2.png" width="294" height="316"></a></p>
<p><em><u>Figure 3</u> – Layers and their references</em></p>
<p>Remember that thought about what can reference a PCL and what a PCL is allowed to reference? Anything can reference a PCL but a PCL can only reference another PCL. For the XAML UI to the ViewModel the reference will be fine because that’s platform-specific to a PCL. What becomes more difficult is that reference from the Model to Data Access because that’s going from a PCL to a platform-specific DLL and that’s not allowed. (Game over.)
<p>There’s another nifty little detail about PCLs and interfaces and this is why you’re going to care about interface-driven programming if you want to share code between platforms. Let’s say that you define an interface called IPersonDataAccess in a PCL. This interface represents all the operations that your system needs in order to save and retrieve Person model classes. Better yet, let’s say that IPersonDataAccess represents all the operations required to save and retrieve instances of IPerson models. You can now create platform-specific classes that implement IPersonDataAccess. Here’s the cool part – let’s say that your PersonViewModel class depends on IPersonDataAccess to save and retrieve data. As long as PersonViewModel references IPersonDataAccess rather than a platform-specific implementation, you can pass in platform-specific instances of IPersonDataAccess to PersonViewModel and it will be perfectly happy as shown in Figure 5 &#8212; ViewModelLocator that creates an instance of PersonViewModel and passes in a platform-specific instance of IPersonDataAccess.
<p><font face="Courier New">/// &lt;summary&gt;<br />/// Interface for person data access <br />/// defined in a portable class library<br />/// &lt;/summary&gt;<br />public interface IPersonDataAccess<br />{<br />&nbsp;&nbsp;&nbsp; Task&lt;IList&lt;IPerson&gt;&gt; GetAll();<br />&nbsp;&nbsp;&nbsp; Task&lt;IPerson&gt; GetById(int id);<br />&nbsp;&nbsp;&nbsp; Task Save(IPerson saveThis);<br />}</font></p>
<p><font face="Courier New">/// &lt;summary&gt;<br />/// Interface for person model <br />/// defined in a portable class library<br />/// &lt;/summary&gt;<br />public interface IPerson<br />{<br />&nbsp;&nbsp;&nbsp; int Id { get; set; }<br />&nbsp;&nbsp;&nbsp; string FirstName { get; set; }<br />&nbsp;&nbsp;&nbsp; string LastName { get; set; }<br />&nbsp;&nbsp;&nbsp; string EmailAddress { get; set; }<br />}<br /><em></em></font></p>
<p><em><u>Figure 4</u> &#8212; IPersonDataAccess and IPerson interfaces in a PCL</em></p>
<p><font face="Courier New">/// &lt;summary&gt;<br />/// A ViewModelLocator helps keep track of the instances of a <br />/// ViewModel in an application.&nbsp; They can be either PCLs or<br />/// platform-specific.&nbsp; This code represents a platform-specific <br />/// ViewModelLocator.<br />/// &lt;/summary&gt;<br />public class ViewModelLocator<br />{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; public ViewModelLocator()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create an instance of PersonViewModel<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // and pass in an instance of <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // WindowsPhonePersonDataAccess<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_ViewModelInstance = new PersonViewModel(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new WindowsPhonePersonDataAccess());&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; private PersonViewModel m_ViewModelInstance;<br />&nbsp;&nbsp;&nbsp; public PersonViewModel ViewModelInstance<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return m_ViewModelInstance; }<br />&nbsp;&nbsp;&nbsp; }<br />}</font></p>
<p><em><u>Figure 5</u> – ViewModelLocator that creates an instance of PersonViewModel and passes in a platform-specific instance of IPersonDataAccess</em>
<p><font face="Courier New">/// &lt;summary&gt;<br />/// This view model class is defined in a PCL and depends on <br />/// IPersonDataAccess to save and load data.&nbsp; <br />/// &lt;/summary&gt;<br />public class PersonViewModel : INotifyPropertyChanged<br />{<br />&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />&nbsp;&nbsp;&nbsp; /// Constructor that requires an instance of <br />&nbsp;&nbsp;&nbsp; /// the IPersonDataAccess dependency to be &#8220;injected&#8221;<br />&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />&nbsp;&nbsp;&nbsp; /// &lt;param name=&#8221;dataAccess&#8221;&gt;&lt;/param&gt;<br />&nbsp;&nbsp;&nbsp; public PersonViewModel(IPersonDataAccess dataAccess)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_DataAccess = dataAccess;<br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; private IPersonDataAccess m_DataAccess;</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; public async Task LoadById(int id)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // call into the instance of IPersonDataAccess<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // to get some data<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var result = await m_DataAccess.GetById(id);</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do something with the result<br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; // &#8230;</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; public event PropertyChangedEventHandler PropertyChanged;<br />}</font></p>
<p><em><u>Figure 6</u> – the PersonViewModel class depends on IPersonDataAccess and takes an instance of IPersonDataAccess on the constructor</em></p>
<p><font face="Courier New">/// &lt;summary&gt;<br />/// Implementation of IPersonDataAccess that is <br />/// specific to the Windows Phone platform.&nbsp; <br />/// &lt;/summary&gt;<br />public class WindowsPhonePersonDataAccess : IPersonDataAccess<br />{<br />&nbsp;&nbsp;&nbsp; public Task&lt;IList&lt;IPerson&gt;&gt; GetAll()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IList&lt;IPerson&gt; theResults = new List&lt;IPerson&gt;();</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do some work that is specific to Windows Phone </font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Task&lt;IList&lt;IPerson&gt;&gt;(() =&gt; theResults);<br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; public Task&lt;IPerson&gt; GetById(int id)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IPerson theResult = null;</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do some work that is specific to Windows Phone<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Task&lt;IPerson&gt;(() =&gt; theResult);<br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp; public Task Save(IPerson saveThis)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do some work that is specific to Windows Phone</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Task(null);<br />&nbsp;&nbsp;&nbsp; }<br />}</font></p>
<p><em><u>Figure 7</u> – a Windows Phone-specific implementation of IPersonDataAccess</em></p>
<p>This pattern is known as Dependency Injection. If Class A relies on another Class B or Interface B in order to do work, that is known as a dependency. Rather than having Class A internally create an instance of Class B, you create that instance of Class B outside of Class A and then “inject” it into Class A’s constructor. If Class A depends on Interface B, then this means that Class A is interface-driven. Being interface-driven and using Dependency Injection helps us to bridge the divide between the PCLs and the platform-specific projects and re-use code. Remember, our problem in Figure 3 &#8212; Layers and their references was referencing out platform-specific Data Access code from the Models and ViewModels that live in PCLs. If you code against interfaces you can just inject the versions of the classes that are specific to Windows Phone or Windows Store apps.
<p><b>Factoring in Asynchronous Code into your Lowest Common Denominator</b>
<p>Over the last handful of years, asynchronous operations have become more and more common. While we’ve known for a while that we can improve the user experience and performance of our applications by making certain operations asynchronous, this generally wasn’t required until Silverlight and Windows Phone 7 (WP7). In Silverlight and WP7, any networking calls had to be async so if your application needed to read or write data over a network, you needed to adjust your application architecture to work with async. That doesn’t sound like that would cause too much difficulty but, since async network calls returned instantly, that makes using methods with ordinary return values pretty much impossible. Windows Phone 8 (WP8) still has the same requirement that network calls be asynchronous but this now gets a lot easier with async, await, and System.Threading.Tasks. Those sharp and jagged edges of asynchronous coding aren’t nearly as scary anymore.
<p>Enter Windows RT and Windows Store applications for Windows 8. If you’re a XAML and C# programmer, WinRT is going to look very familiar but there is a lot of new stuff. New classes. New methods. New project types. And lots more asynchronous code. Once again, just like in Silverlight and WP8, async, await, and System.Threading.Tasks makes working with this asynchronous code fairly painless but if your goal is to share code between platforms, this is where you need to start paying attention. Assuming that you’re doing interface-driven programming, you’ll need to craft your interfaces so that they can adequately wrap (aka “hide”) the details of the most asynchronous platform that you want to target from your PCLs. If you’re targeting both Windows Phone 8 and Windows Store application for Windows 8, the Windows Store apps are definitely going to require more asynchronous code. As a result, if you have the option to do so, you’ll probably want to write the Windows Store version of your libraries first so that you discover as much of the required async logic as possible.
<p><b>Summary</b>
<p>The good news is that you can definitely share code between the platforms. The bad news is that that sharing won’t happen for free and you’ll need to design your application in order to enable it. Using Portable Class Libraries, interface-driven programming, and Dependency Injection will help you to achieve that sharing. You might be thinking that having to build your application like this is going to be painful or difficult but I think you’ll find that there’s a silver lining for this particular cloud – you’ll be forced to follow some great best practices for application design and you’ll be pleasantly surprised at how it help make your application more maintainable.
<p>&nbsp;</p>
<p>NOTE: A <a href="http://www.benday.com/BlogFiles/CodeSharingBetweenWindowsPhone8AndWindows8/BenDay_ShareCodeBetweenWin8AndWP8.pdf" target="_blank">PDF version of this article is available for download</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/01/24/strategies-for-sharing-code-between-windows-phone-8-and-windows-8-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unit Testing &amp; Test-Driven Development Courseware for Visual Studio 2010</title>
		<link>http://www.benday.com/2013/01/20/unit-testing-test-driven-development-courseware-for-visual-studio-2010/</link>
		<comments>http://www.benday.com/2013/01/20/unit-testing-test-driven-development-courseware-for-visual-studio-2010/#comments</comments>
		<pubDate>Sun, 20 Jan 2013 16:23:00 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Unit Testing / Test-Driven Development (TDD)]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=706</guid>
		<description><![CDATA[<p>Well, like I mentioned in <a href="http://www.benday.com/2012/12/19/lab-refactor-for-testability-using-the-repository-pattern/" target="_blank">my last post</a>, I’m planning to publish a lot of the old courseware that I’ve developed over time.&#160; The idea is to share the materials that I’m no longer using with the good folks on the internet rather than to have it all sitting around collecting virtual dust on my laptop.</p> <p>This time, I’m pushing out the labs and slides for my <a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-CourseDescription.pdf" target="_blank">2-day unit testing &#38; test-driven development (TDD) course for Visual Studio 2010</a>.&#160; A few months ago, I started looking at upgrading the VS2010 course to Visual Studio 2012 and decided that it was actually time for a re-write because I don’t really write tests the same way anymore.&#160;&#160;&#160; </p> [...]]]></description>
				<content:encoded><![CDATA[<p>Well, like I mentioned in <a href="http://www.benday.com/2012/12/19/lab-refactor-for-testability-using-the-repository-pattern/" target="_blank">my last post</a>, I’m planning to publish a lot of the old courseware that I’ve developed over time.&nbsp; The idea is to share the materials that I’m no longer using with the good folks on the internet rather than to have it all sitting around collecting virtual dust on my laptop.</p>
<p>This time, I’m pushing out the labs and slides for my <a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-CourseDescription.pdf" target="_blank">2-day unit testing &amp; test-driven development (TDD) course for Visual Studio 2010</a>.&nbsp; A few months ago, I started looking at upgrading the VS2010 course to Visual Studio 2012 and decided that it was actually time for a re-write because I don’t really write tests the same way anymore.&nbsp;&nbsp;&nbsp; </p>
<p>The labs for this course focus on process and software architecture patterns for how to:</p>
<ul>
<li>Create unit tests for a Deck of Cards using TDD</li>
<li>Unit test the Adapter pattern</li>
<li>Unit test the Repository pattern</li>
<li>Using mock objects to test in isolation</li>
<li>Unit testing a user interface using the Model-View-Presenter (MVP) pattern</li>
</ul>
<p>Here are the materials for the course:</p>
<ul>
<li><a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-CourseDescription.pdf" target="_blank">Course description and syllabus</a></li>
<li><a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-Slides.pdf" target="_blank">Slides in PDF format</a></li>
<li><a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-Slides.pptx" target="_blank">Slides in PowerPoint format</a></li>
<li><a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-Labs.pdf" target="_blank">Labs in PDF format</a></li>
<li><a href="http://www.benday.com/BlogFiles/BenDay-VS2010-Testing/BenDay-VS2010-Testing-Lab-Code.zip" target="_blank">Code for the labs (before and after)</a></li>
</ul>
<p>Enjoy.</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p><em>&#8211; Looking for training for unit testing and test-driven development with Visual Studio 2012?&nbsp; Want a coach to come show your team how to incorporate tests into your existing applications?&nbsp; Drop us a line at </em><a href="mailto:info@benday.com"><em>info@benday.com</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2013/01/20/unit-testing-test-driven-development-courseware-for-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lab: Refactor for testability using the Repository pattern</title>
		<link>http://www.benday.com/2012/12/19/lab-refactor-for-testability-using-the-repository-pattern/</link>
		<comments>http://www.benday.com/2012/12/19/lab-refactor-for-testability-using-the-repository-pattern/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 12:31:59 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[Application Lifecycle Management (ALM)]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Good stuff]]></category>
		<category><![CDATA[Unit Testing / Test-Driven Development (TDD)]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=703</guid>
		<description><![CDATA[<p>I had a long drive yesterday to go visit a customer and while I was driving it occurred to me that I have LOTS of courseware that I’ve written that is just sitting around gathering virtual dust.&#160; Whether they’re parts of classes that never fully came together or they’re for courses that target old versions of Visual Studio, the ideas are still useful and I’d rather share them out than have them just sit around.&#160; </p> <p>A couple of years ago I started working on a software architecture skills course and wrote a lab that walks you through how to refactor an application with tightly coupled data access logic to use the Repository pattern so that the code is more [...]]]></description>
				<content:encoded><![CDATA[<p>I had a long drive yesterday to go visit a customer and while I was driving it occurred to me that I have LOTS of courseware that I’ve written that is just sitting around gathering virtual dust.&nbsp; Whether they’re parts of classes that never fully came together or they’re for courses that target old versions of Visual Studio, the ideas are still useful and I’d rather share them out than have them just sit around.&nbsp; </p>
<p>A couple of years ago I started working on a software architecture skills course and wrote a lab that walks you through how to refactor an application with tightly coupled data access logic to use the Repository pattern so that the code is more testable.&nbsp; Here’s that lab.</p>
<p>The before and after code for this lab targets Visual Studio 2010 but you’re all a bunch of smartypantses so you probably won’t have too much trouble making it work with Visual Studio 2012.&nbsp; The version of the tool is different but the ideas are still absolutely relevant.&nbsp; </p>
<p>Here are the links to the materials:</p>
<ul>
<li><a href="http://benday.com/BlogFiles/CoursewareForVS2010/BenDay-RefactorPersonToRepository-code.zip" target="_blank">Before &amp; After source code for the lab</a>
<li><a href="http://benday.com/BlogFiles/CoursewareForVS2010/RefactorPersonToRepository.htm" target="_blank">HTML version of the Refactor to Repository Pattern lab</a>
<li><a href="http://benday.com/BlogFiles/CoursewareForVS2010/RefactorPersonToRepository.docx" target="_blank">Microsoft Word version of the Refactor to Repository Pattern lab</a></li>
</ul>
<p>Enjoy.</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p><em>&#8211; Want some software architecture training or guidance using Visual Studio 2012?&nbsp; Can’t quite figure out how to unit test that application that you have?&nbsp; We can help.&nbsp; Drop us a line at </em><a href="mailto:info@benday.com"><em>info@benday.com</em></a><em>.&nbsp; </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2012/12/19/lab-refactor-for-testability-using-the-repository-pattern/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deploy a SQL Server Database project&#8217;s *.dacpac with SqlPackage.exe</title>
		<link>http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/</link>
		<comments>http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/#comments</comments>
		<pubDate>Tue, 18 Dec 2012 15:39:36 +0000</pubDate>
		<dc:creator>Ben Day</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Visual Studio 2012]]></category>

		<guid isPermaLink="false">http://www.benday.com/?p=701</guid>
		<description><![CDATA[<p>Are you a big user of the SQL Server database projects?&#160; You know…what used to be known as ”data dude”?&#160; Did you get way into doing command line deployments of your databases <a href="http://www.benday.com/2009/08/22/a-user-interface-for-vsdbcmd-deployimport-your-database-schema-without-installing-visual-studio-2008-database-edition/" target="_blank">using vsdbcmd.exe</a>?&#160; Well, if you are one of those developers and you’ve upgraded to the latest version of the SQL Server Database Projects, then you might be wondering just where vsdbcmd.exe went.&#160; </p> <p>Answer: vsdbcmd.exe has been replaced with <a href="http://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx" target="_blank">SqlPackage.exe</a>.&#160; </p> <p>There were a lot of updates for the VS2012 version of the SQL Server Database Projects so it makes sense that vsdbcmd would get tweeked, too.&#160; Especially, since the outputs of database projects have completely changed.&#160; (Goodbye, *.dbschema files.&#160; Hello, *.dacpac.)</p> <p>For this [...]]]></description>
				<content:encoded><![CDATA[<p>Are you a big user of the SQL Server database projects?&nbsp; You know…what used to be known as ”data dude”?&nbsp; Did you get way into doing command line deployments of your databases <a href="http://www.benday.com/2009/08/22/a-user-interface-for-vsdbcmd-deployimport-your-database-schema-without-installing-visual-studio-2008-database-edition/" target="_blank">using vsdbcmd.exe</a>?&nbsp; Well, if you are one of those developers and you’ve upgraded to the latest version of the SQL Server Database Projects, then you might be wondering just where vsdbcmd.exe went.&nbsp; </p>
<p>Answer: vsdbcmd.exe has been replaced with <a href="http://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx" target="_blank">SqlPackage.exe</a>.&nbsp; </p>
<p>There were a lot of updates for the VS2012 version of the SQL Server Database Projects so it makes sense that vsdbcmd would get tweeked, too.&nbsp; Especially, since the outputs of database projects have completely changed.&nbsp; (Goodbye, *.dbschema files.&nbsp; Hello, *.dacpac.)</p>
<p>For this blog post, let’s assume a very simple SQL Server Database Project called Benday.SampleApp.Database (as shown in Figure 1) that, upon “compile”, generates a dacpac file named “Benday.SampleApp.Database.dacpac”.</p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML12611e2a.png"><img title="SNAGHTML12611e2a" style="display: inline" alt="SNAGHTML12611e2a" src="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML12611e2a_thumb.png" width="455" height="416"></a></p>
<p><em>Figure 1 – The database project</em></p>
<p>Thankfully, IMHO, SqlPackage.exe is about a trillion times easier to work with.&nbsp; If I wanted to deploy this database to an instance of SQL Server named demo2012util, here’s what my command line syntax would be:</p>
<blockquote><p><font face="Courier New">SqlPackage /Action:Publish <br />&nbsp;&nbsp; /SourceFile:&#8221;Benday.SampleApp.Database.dacpac&#8221; <br />&nbsp;&nbsp; /TargetDatabaseName:BendaySampleAppDb <br />&nbsp;&nbsp; /TargetServerName:&#8221;demo2012util&#8221;</font></p>
</blockquote>
<p>Pretty easy, right?&nbsp; Set the /Action to Publish.&nbsp; Specify the /SourceFile and point it to the *.dacpac.&nbsp; Tell it what to name the database using /TargetDatabaseName.&nbsp; Give it the /TargetServerName for the SQL Server instance.&nbsp; Done.&nbsp; </p>
<p>You can make this even easier if you add a “Publish Database” profile to your project.&nbsp; In Figure 2, you can see the two profiles that I created – one for the “dev” environment named Benday.SampleApp.Database.dev.publish.xml and one for the “prod” environment named Benday.SampleApp.Database.prod.publish.xml.&nbsp; These files contain all the configuration values that you’d use to deploy a SQL Server dacpac into a particular environment.&nbsp; </p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML126a1bca.png"><img title="SNAGHTML126a1bca" style="display: inline" alt="SNAGHTML126a1bca" src="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML126a1bca_thumb.png" width="385" height="349"></a><br /><em>Figure 2 – The “Publish Database” profiles in the SQL Server Database Project</em></p>
<p>Since the profile (*.publish.xml) file has all the config values, when you go to deploy the database from the command line using SqlPackage.exe, you don’t have to supply the /TargetDatabaseName or the /TargetServerName anymore and instead you just provide the path to the dacpac using /SourceFile and then specify the profile using the /Profile argument.</p>
<p>Here’s what that command would look like:</p>
<blockquote><p><font face="Courier New">SqlPackage <br />&nbsp;&nbsp; /Action:Publish <br />&nbsp;&nbsp; /SourceFile:&#8221;Benday.SampleApp.Database.dacpac&#8221; <br />&nbsp;&nbsp; /Profile:&#8221;Benday.SampleApp.Database.prod.publish.xml&#8221;</font></p>
</blockquote>
<p>At this point, you’re probably sarcastically thinking “WHOOPTEEDOOO!!! I’ve exchanged 4 command line arguments for 3 command line arguments! Think of all the extra free time I’ll have now!&nbsp; Thanks, Ben!”&nbsp; If your deployment arguments are as simple as server instance and database name then yah…not that impressive.&nbsp; But there are a lot more configuration options available to you on the command line and typing/managing all those values will definitely be an annoying and error-prone process.</p>
<p>Just for giggles, try double-clicking on one of those *.publish.xml files.&nbsp; You should see the Publish Database dialog for that deployment profile as shown in Figure 3.&nbsp; This dialog lets you set the target database connection and the database name.&nbsp; </p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/image.png"><img title="image" style="display: inline" alt="image" src="http://www.benday.com/wp-content/uploads/2012/12/image_thumb.png" width="701" height="357"></a><br /><em>Figure 3 – The Publish Database editor dialog</em></p>
<p>Impressed yet?&nbsp; Not really?&nbsp; Ok. Click the Advanced button.&nbsp; KA-POWWWWWW!&nbsp; Aw snap!&nbsp; You’ve just been pwned!&nbsp; Or whatever the cool kids say in order to indicate that something kinda awesome just happened up.&nbsp; I’m pretty solidly lame.&nbsp; Cut me some slack already.&nbsp; Granddad’s tired.&nbsp; (I’m 38.&nbsp; Practically a senior citizen in the development world.)</p>
<p>ANYWAY!&nbsp; You should now see the Advanced Publish Settings dialog and it should look something like Figure 4.&nbsp; There are a TON of settings that you can…uhmmm…set for your database deployments.&nbsp; </p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/image1.png"><img title="image" style="display: inline" alt="image" src="http://www.benday.com/wp-content/uploads/2012/12/image_thumb1.png" width="535" height="657"></a><br /><em>Figure 4 – The Advanced Publish Settings editor dialog</em></p>
<p>As these settings get complex, it becomes more and more important that these settings aren’t left up to chance and are under version control just like everything else.&nbsp; One of the biggest time savers when it comes to deploying code and databases is having a well-known automated way to deploy where all your config settings are scripted out.&nbsp; If it’s scripted, it’s easy.&nbsp; If it’s under version control, it’s traceable.&nbsp; </p>
<p><strong>Create Your First Database Publish Profile</strong></p>
<p>Ok. How do I create this profile?&nbsp;&nbsp; </p>
<p><u>Step 1</u>: Right-click the database project and choose Publish (Figure 5)</p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML1280ee36.png"><img title="SNAGHTML1280ee36" style="margin: 0px; display: inline" alt="SNAGHTML1280ee36" src="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML1280ee36_thumb.png" width="392" height="413"></a><br /><em>Figure 5 – Right-click the database project and choose publish from the context menu</em></p>
<p><u>Step 2</u>: Populate the values for your settings and click the Create button (Figure 6)</p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/image2.png"><img title="image" style="margin: 0px; display: inline" alt="image" src="http://www.benday.com/wp-content/uploads/2012/12/image_thumb2.png" width="701" height="357"></a><br /><em>Figure 6 – Enter your settings and click Create Profile</em></p>
<p>After you click Create Profile, you should see a new *.publish.xml file in your project (Figure 7).</p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML12840f8b.png"><img title="SNAGHTML12840f8b" style="margin: 0px; display: inline" alt="SNAGHTML12840f8b" src="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML12840f8b_thumb.png" width="417" height="230"></a><br /><em>Figure 7 – The new deployment profile</em></p>
<p><u>Step 3</u>: This step is optional but I think it’s handy.&nbsp; Change the “Copy to Output Directory” setting on the new *.publish.xml file to “Copy Always” (Figure 8).&nbsp; This ensures that when the project is compiled (via the Build command) that the publish profile is copied to the bin directory along with the *.dacpac file.&nbsp; This makes scripting the deploy using SqlPackage.exe easier when you’re deploying from a developer machine and MUCH easier if you’re deploying from an automated build.&nbsp; </p>
<p><a href="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML1285e032.png"><img title="SNAGHTML1285e032" style="margin: 0px; display: inline" alt="SNAGHTML1285e032" src="http://www.benday.com/wp-content/uploads/2012/12/SNAGHTML1285e032_thumb.png" width="431" height="174"></a><br /><em>Figure 8 – Set the Copy to Output Directory to Copy Always</em></p>
<p>&nbsp;</p>
<p>I hope this is helpful and/or useful.</p>
<p>-Ben</p>
<p>&nbsp;</p>
<p><em>&#8211; Want to streamline your database and binary deployment process?&nbsp; Looking for suggestions on how to make all this run smoothly from Team Foundation Server’s automated build?&nbsp; Thinking it might be nice to get some training on how to put your insanely complex database under source control using SQL Server Database Projects?&nbsp; Drop us a line at </em><a href="mailto:info@benday.com"><em>info@benday.com</em></a><em>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
