<?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>ORTHOcoders &#187; Presentation</title>
	<atom:link href="http://orthocoders.com/tag/presentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://orthocoders.com</link>
	<description>U can code it, we can help</description>
	<lastBuildDate>Fri, 13 Jan 2012 07:16:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WPF MVVM demystified</title>
		<link>http://orthocoders.com/2011/12/02/wpf-mvvm-demistified/</link>
		<comments>http://orthocoders.com/2011/12/02/wpf-mvvm-demistified/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 22:13:37 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=499</guid>
		<description><![CDATA[Why using MVVM as a presentation pattern is a good idea? What does that mean? What is the difference with MVP or MVC?]]></description>
			<content:encoded><![CDATA[<h2>Motivation</h2>
<p>Lately I have been hearing a few discussion about using MVVM as a pattern to work with desktop apps when using .NET and WPF.</p>
<p>The first question usually is about justifying the use of the pattern compared to MVC or MVP. It&#8217;s all about responsibilities and how the data and logic is organized.</p>
<p>While I&#8217;m not going to describe all the differences I want to highlight some important aspects of the pattern when working with WPF applications.</p>
<p><em>First</em> Highlight: WPF is not WinForms. Why? <strong>NO CODE BEHIND</strong>!</p>
<p>Second Highlight: What are the benefits of it? <strong>BINDING</strong>!</p>
<p><em>Third</em> Highlight: Is binding important when using WPF? <strong>ESSENTIAL</strong>!</p>
<p><em>Fourth</em> Highlight: What about generating the M &#8211; V &#8211; VM? <strong>NOT ENCOURAGED, BE CAREFUL</strong>!</p>
<h2>The good old days with no binding</h2>
<p>Before using WPF there was WinForms.</p>
<p>The &#8220;idiomatic&#8221; way of making the views update in WinForms was either using code behind or letting the controller manipulate the view by knowing which view (or interface) was using, thus creating a dependency between them.</p>
<p>The problem with that approach is that we are breaking encapsulation and assigning multiple responsibilities to classes that should be dedicated to only one of them. Remember, one source multiple views, and all that jazz. We should be able to create new views with no additional pain.</p>
<p>I remember clearly wondering about :</p>
<blockquote><p>&#8220;Wouldn&#8217;t be great to have a way to <em>bind</em> my view to some kind of class so I don&#8217;t have to keep having controllers that update the text field view when the text changes, etc?&#8221;</p></blockquote>
<p>So I decided to create my collection of <em>binders</em> to make my life easier and look what happened next&#8230;</p>
<h2>Binding as a first citizen</h2>
<p>The next iteration of MS desktop tools brought <strong>WPF </strong>and the idiomatic way of building views was using <strong>Binding</strong>! Yay!</p>
<p>Why is so good? Because the views use reflection to know when your source has changed!</p>
<p>What&#8217;s the tradeoff you ask? You need to implement a protocol to notify when change happens. Either using <em>INotifyPropertyChanged </em>interface or dependency properties.</p>
<p>&#8220;Awesome!&#8221; &#8211; You say.</p>
<p>&#8220;Now I can just grab my models and add the notification, and no more controllers, and&#8230;&#8221; &#8211; STOP!</p>
<p>Wow, slow down&#8230;.. take a deep breath, sit down&#8230; keep reading.</p>
<h2>Modelling, abstraction and everything nice</h2>
<p>We have clear responsibilities assigned between view and model.</p>
<p><em>View</em> is in charge of displaying what the <em>Model</em> represents.</p>
<p>Now, because we want to use WPF we should not litter our classes with other responsibilities. Imagine tomorrow we have a different framework, what are we going to do? Change them again?</p>
<p>And here is why the <em>ViewModel</em> makes so much sense.</p>
<p>The class that matches with a <em>ViewModel</em> will provide all the necessary binding fields so they can be displayed in that view or any other view. Multiples views, same <em>ViewModel. </em>Is just binding after all.</p>
<h2>No rule, to rule them all</h2>
<p>Now, would that mean the we are going to have always an association one to one between <em>Model</em>, <em>View</em> and <em>ViewModel</em>?</p>
<p>Even more, would that mean that all my &#8220;Models&#8221; are entities populated from an ORM?</p>
<p>Not at all! There&#8217;s no <em>rule</em>, just good design and modelling practices.</p>
<p>A <em>ViewModel</em> may use multiple entities, or no entities at all! The fact that the name is <em>Model</em> does not imply necessarily that is a particular kind of class.</p>
<p>Remember, is a pattern, so we identify the components of the pattern and named them accordingly. However patterns overlap, collaborate and some times use each other (sounds promiscuous, I know).</p>
<p>So be careful! Code generation in my experience will bring you more sorrow than happy days!</p>
<p>What classes are you going to generate anyways? How can you be sure before hand what all the models, etc, look like?</p>
<p>Forcing all the objects to inherit base classes because they are all &#8220;ViewModels&#8221; or &#8220;Models&#8221; may produce the same result.</p>
<p>There&#8217;s no magic bullet or pill you can take.</p>
<p>So what to do? Use binding, will save you lots of time, write some nice code (with tests to add confidence), and then when you have a very clear idea of what are you building and you can justify it, abstract, refactor and generate code or create base classes if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2011/12/02/wpf-mvvm-demistified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TDD presentation @ Winnipeg .NET User Group</title>
		<link>http://orthocoders.com/2009/02/17/tdd-presentation-winnipeg-net-user-group/</link>
		<comments>http://orthocoders.com/2009/02/17/tdd-presentation-winnipeg-net-user-group/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 09:00:04 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=15</guid>
		<description><![CDATA[I&#8217;m about to do the presentation for the .NET User Group. You can download the presentation with the following links. PPT: TDD Presentation &#38; TDD Movie Library Demo PDF: TDD Presentation &#38; TDD Movie Library Demo Here is a video I made with the presentation. Comments are welcome!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m about to do the presentation for the .NET User Group.</p>
<p>You can download the presentation with the following links.</p>
<p>PPT: <a href="http://orthocoders.com/wp-content/uploads/2009/02/tdd-presentation-ppt.zip">TDD Presentation</a> &amp; <a href="http://orthocoders.com/wp-content/uploads/2009/02/tdd-presentation-mld-ppt.zip">TDD Movie Library Demo</a><br />
PDF: <a href="http://orthocoders.com/wp-content/uploads/2009/02/tdd-presentation-v2.pdf">TDD Presentation</a> &amp; <a href="http://orthocoders.com/wp-content/uploads/2009/02/tdd-presentation-v2-mld.pdf">TDD Movie Library Demo </a></p>
<p>Here is a <a title="TDD presentation Video" href="http://orthocoders.com/wp-content/uploads/2009/02/TDD_presentation_17_Feb_2009.wmv" target="_blank">video</a> I made with the presentation.</p>
<p>Comments are welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2009/02/17/tdd-presentation-winnipeg-net-user-group/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://orthocoders.com/wp-content/uploads/2009/02/TDD_presentation_17_Feb_2009.wmv" length="64164978" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>TDD @ the Winnipeg .NET User Group</title>
		<link>http://orthocoders.com/2009/01/31/tdd-the-winnipeg-net-user-group/</link>
		<comments>http://orthocoders.com/2009/01/31/tdd-the-winnipeg-net-user-group/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 07:00:54 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[.NET User Group]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=13</guid>
		<description><![CDATA[On Feb 17th I&#8217;m going to do a presentation about TDD with the Winnipeg .NET user group. The presentation will explain the benefits of using TDD and how to start. I&#8217;m planning to talk about code coverage, mocking, which tools are available and how they make our testing easier. I&#8217;ll post the presentation as soon [...]]]></description>
			<content:encoded><![CDATA[<p>On Feb 17th I&#8217;m going to do a presentation about TDD with the Winnipeg .NET user group.</p>
<p>The presentation will explain the benefits of using TDD and how to start.</p>
<p>I&#8217;m planning to talk about code coverage, mocking, which tools are available and how they make our testing easier.</p>
<p>I&#8217;ll post the presentation as soon I have it ready. Here is the information about the <a title="Winnipeg .NET User Group" href="http://www.dotnetwired.com/" target="_blank">event</a>.</p>
<p>See u there!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2009/01/31/tdd-the-winnipeg-net-user-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

