<?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</title>
	<atom:link href="http://orthocoders.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://orthocoders.com</link>
	<description>U can code it, we can help</description>
	<lastBuildDate>Thu, 22 Jul 2010 20:14:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASP.NET MVC CONF 2010</title>
		<link>http://orthocoders.com/2010/07/22/asp-net-mvc-conf-2010/</link>
		<comments>http://orthocoders.com/2010/07/22/asp-net-mvc-conf-2010/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:14:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=194</guid>
		<description><![CDATA[Just finished my presentation about BDD for the ASP.NET MVC virtual conference!
It was fun to have a virtual audience.
I uploaded the code and slides to the presentations page.
Any feedback would be appreciated! Feel free to ask any questions.
Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>Just finished my presentation about BDD for the ASP.NET MVC virtual conference!</p>
<p>It was fun to have a virtual audience.</p>
<p>I uploaded the code and slides to the <a title="Presentations page" href="wordpress/presentations">presentations</a> page.</p>
<p>Any feedback would be appreciated! Feel free to ask any questions.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/07/22/asp-net-mvc-conf-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real world BDD introduction</title>
		<link>http://orthocoders.com/2010/05/26/real-world-bdd-introduction/</link>
		<comments>http://orthocoders.com/2010/05/26/real-world-bdd-introduction/#comments</comments>
		<pubDate>Thu, 27 May 2010 02:58:40 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[BDD]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[PrairieDevCon]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=162</guid>
		<description><![CDATA[Getting ready for PrairieDevCon
Next week I’ll be presenting at the PrairieDevCon in Regina and one of my presentations is about Behavior Driven Development, how to apply it using .NET tools like SpecFlow, Nunit, Watin, Cassini, MbUnit, etc.
Because is a Dojo/Code with me presentation I’m planning to do a BDD exercise with all the attendees to [...]]]></description>
			<content:encoded><![CDATA[<h3>Getting ready for PrairieDevCon</h3>
<p>Next week I’ll be presenting at the <a href="http://www.prairiedevcon.com" target="_blank">PrairieDevCon</a> in Regina and one of my presentations is about Behavior Driven Development, how to apply it using .NET tools like SpecFlow, Nunit, Watin, Cassini, MbUnit, etc.</p>
<p>Because is a Dojo/Code with me presentation I’m planning to do a BDD exercise with all the attendees to show them how to describe a new feature using BDD and implement it together.</p>
<p>We will start with a project that has one feature implemented, and will code together the second feature using full BDD and TDD.</p>
<p>So, what should I use to illustrate BDD? No other than my old friend the MediaLibrary example that I used quite a few times, but now including a full BDD implementation.</p>
<h3>MediaLibrary</h3>
<p>The MediaLibrary project is a web application that  allows the user to register and catalog his collection of movies, books, games, etc.</p>
<p>I’m using GitHub to publish the code we are going to use in the Dojo. Right now the latest version represents the code that I’m going to start with.</p>
<p>If you would like to check out the code I’m going to use please go to the <a href="http://orthocoders.com/prairiedevcon/" target="_blank">PrairieDevCon page</a> on my blog and get the code from <a href="http://github.com/amirci/Media-Library-Demo-PrairieDevCon-2010" target="_blank">GitHub</a>, read the README file to verify you have the requirements installed and the application is working.</p>
<p>Do you have everything installed? Did you read the README file? Cool, open the solution and let’s move on!</p>
<h3>Using BDD</h3>
<p>Behavior Driven Development is a term used to describe (in our case) development that starts by writing the feature (or user story) that we want to implement. Once we have the feature, we will use a “story runner” that will run the feature we just wrote and show if the story is actually implemented as we wanted or not yet. If it is, good, everything should be “green”. If not, we get a “red”, and we have to add code and implement more functionality to make it pass.</p>
<p>To write the user story we are going to use a particular syntax from the Gherkin language. The Gherkin language has very few rules, please read the introduction for Cucumber from <a title="http://wiki.github.com/aslakhellesoy/cucumber/gherkin" href="http://wiki.github.com/aslakhellesoy/cucumber">Aslak Hellesoy</a>.</p>
<p>Let’s see the feature that it’s implemented in the code, <em>Browse Movies:</em></p>
<pre class="code"><span style="color: blue;">Feature: </span>Browse Movies
    As a User
    I want to Browse Movies
    So I can see the contents of the library

    <span style="color: blue;">Scenario: </span>Browse available movies
        <span style="color: blue;">Given </span><span style="color: green;">I have the following movies:
          </span>| title           |
          | Blazing Saddles |
          | Space Balls     |
        <span style="color: blue;">When </span><span style="color: green;">I go to </span><span style="color: red;">Movies
        </span><span style="color: blue;">Then </span><span style="color: green;">I should see in the listing:
          </span>| title             |
          | Blazing Saddles   |
          | Space Balls       |</pre>
<p>What is most important here is to look at the scenario. The scenario is describing that if you have movies A, B and C in the library, when you browse you should see the same movies on the <em>Movies</em> page.</p>
<p>Now if we want to check the feature manually, what would we do? Something like this:</p>
<ol>
<li>Add the movies to the storage</li>
<li>Start the web application</li>
<li>Launch the browser</li>
<li>Go to the movies page</li>
<li>Check that all the movies in the storage are listed in the browser</li>
</ol>
<p>The thing is that I don’t want to validate each feature (with many scenarios) manually, I’d like the scenario/feature runner to do that for me, add the movies, launch the browser and check, everything automated following the steps I wrote in my scenario.</p>
<p>Probable we could manage to write code that will do that for us, now, the question is how the scenario runner translates this feature into actual code? If we were using rails we could use <em>Cucumber, </em>but luckily for the .NET world we can use <a href="http://www.specflow.org">SpecFlow</a> (<em><a href="http://ironruby.net/download">IronRuby</a></em> too, but that’s another post).</p>
<h3>Given That I have the following movies</h3>
<p>Specflow is a tool that understands <a href="http://wiki.github.com/aslakhellesoy/cucumber/gherkin">Gherkin</a> and generates an <a href="http://nunit.org/">NUnit</a> test for every feature that we use. Being an NUnit test, simplifies how we going to run the specification. Just run the NUnit test with your favorite test runner: <a href="http://www.jetbrains.com/resharper/">ReSharper</a>, NUnit (console or GUI), <a href="http://www.gallio.org">MbUnit</a>, etc.</p>
<p>Each scenario is composed by a series of steps, each step is identified by a Gherkin keyword, in our feature we found <em>Given, When</em> and <em>Then.</em></p>
<p>The NUnit test has code for each scenario and will invoke the steps indicated in the scenario.</p>
<p>In order to do so, Specflow uses the text that we write in the step, to match the code.</p>
<p>Let’s look at our first step “Given I have the following movies:”. In order to implement the step, in the code, you will find a method that looks like:</p>
<pre class="code">[<span style="color: #2b91af;">Given</span>(<span style="color: #a31515;">@"I have the following movies:"</span>)]
<span style="color: blue;">public void </span>AddMovies(<span style="color: #2b91af;">Table </span>movies)
{
    movies.Rows.ForEach(row =&gt; AddMovieToStorage(row[<span style="color: #a31515;">"title"</span>]));
}</pre>
<p>The <em>Given</em> attribute is used to match the text we wrote in the scenario, to indicate the the method <em>AddMovies</em> should be called when the step is invoked.</p>
<p>The step in the scenario indicates that the method receives a series of rows should be passed as parameter (first row is the title, every column separated by “|”), that is why it receives a <em>Table</em>.</p>
<p>In the implementation for each movie in the table, the title will be added to the storage. Check the method <em>AddMoviesToStorage</em> for more details.</p>
<p>Now that we setup our storage we are ready to move on and launch the browser.</p>
<h3>When I go to Movies</h3>
<p>The next step to implement implies opening the browser and going to the <em>Movies </em>page to see the listing<em>.</em></p>
<p>Now, to do so we need two things, first the web application running and then to launch a browser to go the actual page.</p>
<p>To run the application I’m going to use <a href="http://www.asp.net/downloads/archived-v11/cassini">Cassini</a> web server. The setup of the features will start the web server and stop it when it’s not needed any more. We can see the implementation in the <em>Browser </em>class under Utililty.</p>
<pre class="code"><span style="color: blue;">static </span>Browser()
{
    WebServer = <span style="color: blue;">new </span><span style="color: #2b91af;">Server</span>(Port, <span style="color: #a31515;">"/"</span>, GetPhysicalPath());
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>With the server running, we now need to launch the browser and automate the checking for all the movies.</p>
<p>For that we are going to use<em> </em>Watin. <a href="http://watin.sourceforge.net/">Watin</a> (Web automation test in .NET) is a library that helps us to manipulate the browser (based on <a href="http://watir.com/">Watir</a>) and also give us all the HTML for the page we are visiting.</p>
<p>We can see the use of the <em>IE </em>instance in the <em>Browser</em> class:</p>
<pre class="code"><span style="color: blue;">public static void </span>InitializeBrowser()
{
    WebServer.Start();

    Instance = <span style="color: blue;">new </span><span style="color: #2b91af;">IE</span>(ApplicationURL);
}

<span style="color: blue;">public static void </span>ShutdownBrowser()
{
    Instance.Close();

    WebServer.Stop();
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Now that we have our server running, and our <em>IE</em> instance, we only need to go to the right path. In this case we want to go to “/Movies”. For that let’s look at the <em>NavigationSteps class:</em></p>
<pre class="code">[<span style="color: #2b91af;">When</span>(<span style="color: #a31515;">@"I go to (.*)"</span>)]
<span style="color: blue;">public void </span>WhenIGoToPage(<span style="color: blue;">string </span>pageName)
{
    <span style="color: #2b91af;">Browser</span>.GoTo(PathFor(pageName));
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The step uses the browser to navigate to the right page. The page is passed as a parameter that we can see in the attribute as a regular expression.</p>
<p>So far, so good. Now, our last step is to check for the movies in the page to make sure that all of them are in the list.</p>
<h3>Then I should see in the listing</h3>
<p>To implement the last step in our scenario we are going to use the following implementation:</p>
<pre class="code">[<span style="color: #2b91af;">Then</span>(<span style="color: #a31515;">@"I should see in the listing:"</span>)]
<span style="color: blue;">public void </span>AssertListingContains(<span style="color: #2b91af;">Table </span>movies)
{
    <span style="color: blue;">var </span>expected = movies.Rows.Select(row =&gt; row[<span style="color: #a31515;">"title"</span>]);

    <span style="color: blue;">var </span>listing = <span style="color: blue;">this</span>.Page.Listing;

    listing.Should().Have.SameSequenceAs(expected);
}</pre>
<p>Again we are using a step that takes a table as parameter, so we iterate thru the table and get the titles of all the movies that should be in the page.</p>
<p>The code has no mysteries except the <em>Page</em> property.</p>
<pre class="code"><span style="color: blue;">public </span>ListingSteps()
{
    <span style="color: blue;">this</span>.Page = <span style="color: blue;">new </span><span style="color: #2b91af;">BrowseMoviesPage</span>();
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The <em>Page</em> property is initialized in the constructor and the goal of the <em>BrowseMoviesPage</em> is to abstract the internals of how the movies are listed in the page. For example, right now the view that implements the listing of movies uses a table for each movie, however it could use a <em>DIV</em> or some other tag. Here is the implementation:</p>
<pre class="code"><span style="color: blue;">public </span><span style="color: #2b91af;">IEnumerable</span>&lt;<span style="color: blue;">string</span>&gt; Listing
{
    <span style="color: blue;">get
    </span>{
        <span style="color: blue;">var </span>elements = <span style="color: #2b91af;">Browser</span>.Instance.TableCells.Where(cell =&gt; cell.ClassName == <span style="color: #a31515;">"title"</span>);

        <span style="color: blue;">return </span>elements.Select(e =&gt; e.InnerHtml.Trim());
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>As we can see, the code is getting all the table cells where the <em>CSS</em> class is <em>title</em> and then getting the inner html and trimming it.</p>
<p>If we would have to use this code every time we want to check the listing we would have code duplication, plus if the implementation of the view changes, we would have to modify each piece of code that refers to this page. Using the <em>PageObject</em> pattern we avoid code duplication and it’s easy to change the implementation.</p>
<p>And voila! We got all our steps implemented.</p>
<h3>What’s next?</h3>
<p>If you join me next week on the Prairie Dev Con, we will implement the next feature together “<em>Add Movies”.</em></p>
<p>What’s so cool about BDD? Please go ahead and run “rake test:features” on the command line, and you’ll see that the steps for the second feature are still pending, that means that they are not implemented yet.</p>
<p>Writing the feature first we manage to describe what we want, and implementing step by step we make sure that we are working towards make the feature pass. BDD on the outside and TDD on the inside.</p>
<p>Hope to see you all next week in the conference!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/05/26/real-world-bdd-introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>.NET Dependency Management</title>
		<link>http://orthocoders.com/2010/05/08/net-dependency-management/</link>
		<comments>http://orthocoders.com/2010/05/08/net-dependency-management/#comments</comments>
		<pubDate>Sat, 08 May 2010 23:29:13 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Build Tools]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[MSbuild]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=150</guid>
		<description><![CDATA[The problem
One of the features that I miss when I work in .net is a tool to retrieve my dependencies (i.e. assemblies, tools) from a centralized server to avoid copying them again and again from project to project.
In the java world Maven does that (and much more) for you, and in the Rails world a [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem</h3>
<p>One of the features that I miss when I work in .net is a tool to retrieve my dependencies (i.e. assemblies, tools) from a centralized server to avoid copying them again and again from project to project.</p>
<p>In the java world <a href="http://maven.apache.org/" target="_blank">Maven</a> does that (and much more) for you, and in the Rails world a utility called <a href="http://rubygems.org/" target="_blank">Gems</a> (a gem is a ruby library) exists that will download and install the dependencies of your project for you.</p>
<p>To illustrate the point, let’s look at the <a href="http://nmedia.codeplex.com/" target="_blank">.NET Media Library</a> project. The project file structure looks something like this:</p>
<p>+—Media Library</p>
<p style="padding-left: 30px;">+—Main: main source, all the projects are in here.</p>
<p style="padding-left: 30px;">+—Test: Testing source, all the testing projects are in here.</p>
<p style="padding-left: 30px;">+—Lib: Dependencies for the projects.</p>
<p style="padding-left: 30px;">+—Tools: Tools to be used to build, test, deploy, etc.</p>
<p>I have to potential candidates to store external resources (actually I’m using SVN externals, but is giving me lots of grief), <em>lib </em>and<em> tools.</em></p>
<p>Under <em>lib</em> I have the libraries like:</p>
<ul>
<li><a href="http://www.castleproject.org/castle/download.html" target="_blank">Castle Core</a></li>
<li><a href="http://www.castleproject.org/castle/download.html" target="_blank">Castle Windsor</a></li>
<li><a href="http://trac.caffeine-it.com/openrasta/wiki/Doc" target="_blank">Open Rasta</a></li>
<li><a href="http://maventcommons.codeplex.com/" target="_blank">MavenThought Commons</a></li>
<li><a href="http://maventcommons.codeplex.com/" target="_blank">MavenThought Testing</a></li>
<li><a href="http://sharptestex.codeplex.com/" target="_blank">SharpTestEx</a></li>
<li><a href="http://sourceforge.net/projects/nhibernate/" target="_blank">NHibernate</a></li>
<li><a href="http://www.sqlite.org/" target="_blank">SQLite</a></li>
</ul>
<p>And under <em>tools</em> I have</p>
<ul>
<li><a href="http://svn.collab.net/" target="_blank">SVN</a></li>
<li><a href="msbuildtasks.tigris.org" target="_blank">MsBuild Community Tasks</a></li>
<li><a href="http://gallio.org/" target="_blank">Gallio</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx" target="_blank">FxCop</a></li>
<li><a href="http://code.msdn.microsoft.com/sourceanalysis" target="_blank">StyleCop</a></li>
</ul>
<p>Every library and every tool has a particular version, even some of them have dependencies on their own that I have to compile, store and copy every single time I start a project or I want to upgrade.</p>
<p>What to do? What to do indeed….</p>
<h3>A new project is born</h3>
<p>What to do? Create my own, of course.</p>
<p>Disclaimer: I don’t want to reinvent the wheel, so, if you know of a similar project, please let me know ASAP!</p>
<p>My goal is to build a tool that will use a configuration file in which I can declare my dependencies and will download them from a known host.</p>
<p>Similar to Gems I’d like to use a DSL (Domain Specific Language) to be declarative and have a clear syntax to describe, versions, sources, targets, aliases, etc.</p>
<p>However, I’d like to take advantage of another language that I can build on top, to have lots of features out of the box that otherwise I need to implement on my own.</p>
<h3>Don’t be scared, BOO is here!</h3>
<p>What better candidate than Boo? Quoting the site:</p>
<blockquote><p><a href="http://boo.codehaus.org/" target="_blank">Boo</a> Boo is a new object oriented statically typed programming language for the <a href="http://boo.codehaus.org/Common+Language+Infrastructure">Common Language Infrastructure</a> with a <a href="http://www.python.org">python</a> inspired syntax and a special focus on language and compiler extensibility.</p></blockquote>
<p>After using <a href="http://ayende.com/Blog/archive/2006/09/16/IntroductingBinsorTheBooDSLForWindsor.aspx" target="_blank">Binsor</a> in a few projects I was convinced that Boo is an excellent choice to build the tool. So my first step was to buy the book <a href="http://www.manning.com/rahien/" target="_blank">DSLs in Boo: Domain-Specific Languages in .NET</a>, and start reading.</p>
<h3>First Draft DSL Syntax</h3>
<p>Let’s imagine that we want to declare dependencies for the .NET Media Library, here is my idea so far:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:9fd4abe9-586d-48c9-bab7-3af215e37063" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: ruby;">lib_folder lib
source http://MavenThought.com/nass

# Testing libraries
lib MavenThought.Commons, 0.2
lib MavenThought.Testing, 0.2
lib nunit, 2.5
lib SharpTestEx, 1.0
lib SpecFlow, 1.2

# Castle Stack
lib Castle.Core, 1.1
lib Castle.Windsor, 2.0

# ORM
lib NHibernate, 2.1
lib SQLite, 2.1

# Web framework
lib OpenRasta, 2.0.3
lib JSon.NET, 3.5</pre>
</div>
<p>The <em>lib keyword </em>declares the dependency and the version and we can see at the top the configuration for the destination folder and the source to get the dependencies. Because we are using Boo we can use the comments, etc…</p>
<p>Any feedback?</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/05/08/net-dependency-management/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RoR Course Content</title>
		<link>http://orthocoders.com/2010/05/08/ror-course-content-and-sessions/</link>
		<comments>http://orthocoders.com/2010/05/08/ror-course-content-and-sessions/#comments</comments>
		<pubDate>Sat, 08 May 2010 22:44:07 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://orthocoders.com/2010/05/08/ror-course-content-and-sessions/</guid>
		<description><![CDATA[I'm giving a RoR training course at NMM on June 14th to 18th, the content includes...]]></description>
			<content:encoded><![CDATA[<p>Here is the content that I’m going to cover in the RoR course I’m giving on June 14th – to 18th at <a href="http://newmediamanitoba.com">NMM</a>:</p>
<h3>Ruby content</h3>
<ul>
<li>Introduction to scripting languages</li>
<li>Introduction to unit testing, functional testing, BDD</li>
<li>Great Ruby and Rails free resources</li>
<li>Basic git usage (distribute version control system), github</li>
<li>IRB, rubygems</li>
<li>Basic Ruby syntax</li>
<li>Classes and inheritance in Ruby</li>
<li>Ruby blocks, closures, iterators, examples of use</li>
<li>Basic usage of Ruby standard library</li>
<li>Modules, mixins, multiple inheritance in Ruby</li>
<li>RSpec, Cucumber</li>
</ul>
<h3>Ruby on Rails content</h3>
<ul>
<li>Introduction to MVC for web frameworks, Rails history, comparison with other frameworks</li>
<li>Serving static content</li>
<li>Rails ORM (ActiveRecord), migrations, database backends Joins, validations, associations, named_scopes</li>
<li>Controllers, information sharing, filters, permissions Helpers, idioms, code smells</li>
<li>Routing, REST, nested resources Login, logout, sessions, attachments</li>
<li>Gem management, plugins, git submodules</li>
<li>Advanced forms, custom form builders haml, sass will_paginate, paperclip, authlogic, formtastic</li>
<li>Rspec-rails, cucumber-rails, other test gems</li>
<li>Rails console, Rails runner Scripted deployment</li>
<li>Testing web applications, modern Rails testing</li>
</ul>
<p>Each day will consist of an explanation of the subjects, practical examples illustrating the concepts and hands on time to implement a series of exercises using the topics presented during the day.</p>
<p>Any questions please contact me!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/05/08/ror-course-content-and-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby On Rails Training</title>
		<link>http://orthocoders.com/2010/05/07/ruby-on-rails-training/</link>
		<comments>http://orthocoders.com/2010/05/07/ruby-on-rails-training/#comments</comments>
		<pubDate>Fri, 07 May 2010 18:35:29 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[RubyOnRails]]></category>

		<guid isPermaLink="false">http://orthocoders.com/2010/05/07/ruby-on-rails-training/</guid>
		<description><![CDATA[I'm giving a Ruby On Rails course on June 14th - 18th at NewMediaManitoba]]></description>
			<content:encoded><![CDATA[<p>On June 14th to 18th I’ll be giving my first formal RoR training here in Winnipeg.</p>
<p>The course would take place at <a href="http://www.newmediamanitoba.com">New Media Manitoba</a> and if you’d like to attend here is the link to <a href="http://www.newmediamanitoba.com/component/option,com_dtregister/Itemid,46/">register.</a></p>
<h3>Why you should attend?</h3>
<p>RoR is a full MVC web development framework that would show you that developing web applications can be intuitive, professional, secure, easy and fun!</p>
<p>What is so great about Rails? Here are some reasons:</p>
<ul>
<li>It’s based on ruby, so you get all the power of a dynamic language.</li>
<li>Automatic dependencies and library management using Gems</li>
<li>Automatic relational mapping to databases</li>
<li>Behaviour Driven Development</li>
<li>Test Driven Development</li>
<li>Database versioning, migrations and seeding</li>
<li>Automatic REST implementation</li>
<li>Rake DSL</li>
<li>Support for multiple view engines (like haml)</li>
<li>Huge base of libraries (gems) and users around the world</li>
</ul>
<h3>Who should attend?</h3>
<p>Any developer with basic knowledge of a programming language can learn RoR.</p>
<h3>What do I get?</h3>
<p>In this course you will build the confidence and real hands on knowledge to start developing high quality RoR applications. You will learn:</p>
<ul>
<li>Ruby scripting</li>
<li>Rails MVC architecture.</li>
<li>Package management with Gems.</li>
<li>How to apply Behaviour Driven Development, and Test Driven Development.</li>
<li>Persistence mapping with ActiveRecord.</li>
<li>RESTful services.</li>
<li>Manage source versioning with Git.</li>
<li>Automated deployment with Capistrano.</li>
</ul>
<h3>Are you sure it’s a course for me?</h3>
<p>Of course, it does not matter if you are a .NET, Java or Eiffel developer, RoR would open your mind to new concepts, technologies and tools that would complement and improve your daily tasks.</p>
<p>Any more questions, please contact me at <a href="mailto:amir@barylko.com">amir@barylko.com</a>.</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/05/07/ruby-on-rails-training/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prairie Development Conference</title>
		<link>http://orthocoders.com/2010/05/03/prairie-development-conference/</link>
		<comments>http://orthocoders.com/2010/05/03/prairie-development-conference/#comments</comments>
		<pubDate>Tue, 04 May 2010 03:14:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[BDD]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Mocking]]></category>
		<category><![CDATA[SOLID]]></category>

		<guid isPermaLink="false">http://orthocoders.com/2010/05/03/prairie-development-conference/</guid>
		<description><![CDATA[On Jun 2nd and 3rd I’ll be speaking at the PrairieDevCon 2010 in Regina!!!

You can read about it at http://www.prairiedevcon.com/. It would be two complete days of sessions with four tracks and many cool speakers!!!!
I will do two presentations:
 
Real World Behaviour Driven Development
Behaviour Driven Development drives you process towards keeping the focus on the [...]]]></description>
			<content:encoded><![CDATA[<p>On Jun 2nd and 3rd I’ll be speaking at the <strong>PrairieDevCon</strong> 2010 in Regina!!!</p>
<p><a href="http://orthocoders.com/wp-content/uploads/2010/05/Prairie_Dev_Con_Presenter.gif"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Prairie_Dev_Con_Presenter" src="http://orthocoders.com/wp-content/uploads/2010/05/Prairie_Dev_Con_Presenter_thumb.gif" border="0" alt="Prairie_Dev_Con_Presenter" width="225" height="123" /></a></p>
<p>You can read about it at <a href="http://www.prairiedevcon.com/">http://www.prairiedevcon.com/</a>. It would be two complete days of sessions with four tracks and many cool speakers!!!!</p>
<p>I will do two presentations:</p>
<p><strong> </strong></p>
<h5>Real World Behaviour Driven Development</h5>
<p>Behaviour Driven Development drives you process towards keeping the focus on the stakeholder’s goals while discovering new features to achieve those goals.<br />
But&#8230; what does it mean in a .NET project to use BDD? What do I have to change? What tools are available? Can I use it for project with actual deadlines? How the quality will be improved?<br />
We are going to see a real world example from start to finish using BDD and TDD while answering all those questions. After the session you will have the foundation to apply BDD with confidence on any .NET project.<br />
<strong>Track:</strong> Developer Foundation<br />
<strong>Style:</strong> Dojo (Bring your laptop and code with me!)</p>
<h5>Test Driven Development Patterns for .NET Developers</h5>
<p>Test Driven Development is a methodology that will help us to discover our model while improving the quality of our software.<br />
We are going to see different patterns to help us deal with day to day problems like constructor initialization, exception testing, combinatorial tests, database testing, and many others.<br />
<strong>Track:</strong> Developer Foundation<br />
<strong>Style:</strong> Lecture</p>
<p>Hope to see you there!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/05/03/prairie-development-conference/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snapping Strategy Part II</title>
		<link>http://orthocoders.com/2010/04/13/snapping-strategy-part-2/</link>
		<comments>http://orthocoders.com/2010/04/13/snapping-strategy-part-2/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 04:26:07 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[SOLID]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=115</guid>
		<description><![CDATA[After my first post about implementing a snapping strategy, I got feedback, and a new implementation was suggested: Use Chain-of-Responsibility instead of Composite.]]></description>
			<content:encoded><![CDATA[<h3>New inspiration</h3>
<p>One of many great things about blogging is that you get feedback from other developers. My good friend Sebastian (@paraseba) suggested to use a <em>Chain-of-Responsibility</em> instead of a <em>Composite</em> to find the an active snapping strategy. If u have no idea what I&#8217;m talking about, please read the previous post about &#8220;<a href="http://orthocoders.com/2010/04/13/snapping-strategy/" target="_blank">Implementing a Snapping Strategy</a>&#8220;.</p>
<h3>CoR Pattern</h3>
<p>In the Design Patterns book, the authors describe the Chain of Responsibility pattern like this:</p>
<blockquote><p>Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.</p></blockquote>
<p>In our case this means that we should give the opportunity to each strategy to do the snapping and if no snapping is available should call the “chained” strategy to see if the point should be snapped.</p>
<p>The solution it&#8217;s working, good time to refactor (Red, Green, Refactor) to add more flexibility to our strategies.</p>
<p>Let’s explore what changes do we need to do in order to be able to chain the strategies.</p>
<h3>Chained Strategies</h3>
<p>I don’t think we should modify the interface, no one needs to know which pattern are we implemented, so I am going to create a new abstract class called <em>ChainedSnappingStrategy</em>.</p>
<p>This class will be the base implementation for all the other strategies with two responsibilities:</p>
<ul>
<li>Call the next strategy in the chain if no snapping was applied</li>
<li>If it’s the end of the chain, return the same point.</li>
</ul>
<p>Our hierarchy updated will look something like this:</p>
<p><a href="http://orthocoders.com/wp-content/uploads/2010/04/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://orthocoders.com/wp-content/uploads/2010/04/image_thumb4.png" border="0" alt="image" width="580" height="306" /></a></p>
<p>I added a new abstract method called <em>SnapImpl</em> to implement in each concrete class the snapping (same as we have now).</p>
<p>The <em>Snap</em> method should call the implementation first and then check if the point was snapped or not, if not should go to the next strategy. Here is the code:</p>
<div id="codeSnippetWrapper">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">abstract</span> <span style="color: #0000ff">class</span> ChainedSnappingStrategy : ISnappingStrategy</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">public</span> ISnappingStrategy Next { get; set; }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060">   4:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">public</span> Point Snap(Point point, IDrawingContext context)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060">   6:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060">   7:</span>         var result = <span style="color: #0000ff">this</span>.SnapImpl(point, context);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060">   8:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060">   9:</span>         <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.Next != <span style="color: #0000ff">null</span> &amp;&amp; result == point)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060">  10:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060">  11:</span>             result = <span style="color: #0000ff">this</span>.Next.Snap(point, context);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060">  12:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060">  13:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060">  14:</span>         <span style="color: #0000ff">return</span> result;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060">  15:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060">  16:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060">  17:</span>     <span style="color: #0000ff">protected</span> <span style="color: #0000ff">abstract</span> Point SnapImpl(Point point, IDrawingContext context);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060">  18:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>And voila, our strategies are chained!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/04/13/snapping-strategy-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snapping Strategy</title>
		<link>http://orthocoders.com/2010/04/13/snapping-strategy/</link>
		<comments>http://orthocoders.com/2010/04/13/snapping-strategy/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 15:16:04 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[SOLID]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=92</guid>
		<description><![CDATA[Strategies are an excellent way of abstracting algorithms to achieve particular tasks. The snapping strategy helped me to apply different snapping to the DrawingTool in my application]]></description>
			<content:encoded><![CDATA[<h3>The application</h3>
<p>For the past eight months I’ve been working on a WPF  desktop application that has a tool to draw. Very similar to most drawing application, you select the Drawing tool in the ribbon/toolbox and then you are able to draw on the canvas until you close the shape or cancel the tool.</p>
<h3>The new requirement</h3>
<p>Now, we need to draw using snapping. Snapping means that when you are drawing close to a particular point (considering a distance) the mouse will move but the drawing line not, will stay snapped to the point.</p>
<p>In this case we need to consider three cases:</p>
<ol>
<li>Snapping on the X axis (horizontal axis)</li>
<li>Snapping on the Y axis (vertical axis)</li>
<li>Snapping when the line has an 90 degree angle with the previous line</li>
</ol>
<h3>The solution</h3>
<h4>Where should I add the snapping?</h4>
<p>So I started by writing a test  (Yes, full TDD) that checks when I’m close to the X axis (3 pixels or less) then the drawing tool should snap. My test failed gloriously and I was ready to start my implementation in order to make the test pass… now… the question is… who is responsible for snapping?</p>
<h4>The Drawing Tool</h4>
<p>Let’s review the drawing tool interaction to understand how it works using MVVM.</p>
<ul>
<li>The <em>Canvas </em>receives a mouse move event and passes that information to the <em>DrawingTool</em></li>
<li>The <em>DrawingTool</em> raises a <em>LineMoved</em> event</li>
<li>The view model receives the event and notifies the view</li>
<li>The view shows the line ending on the new point</li>
</ul>
<p>A sequence diagram should look something like this:</p>
<p><a href="http://orthocoders.com/wp-content/uploads/2010/04/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://orthocoders.com/wp-content/uploads/2010/04/image_thumb.png" border="0" alt="image" width="568" height="213" /></a></p>
<h4>Who is responsible for snapping?</h4>
<p>The <em>DrawingTool</em> does not know about snapping, but it should, because is raising the event… However considering the SRP (single responsibility principle) makes more sense to delegate this decision to another class, behold the <em>ISnappingStrategy</em>.</p>
<p>I decided to inject the strategy into the <em>DrawingTool</em> constructor (via IoC) and the <em>DrawingTool</em> will query the strategy for each point before raising the event, thus the event will contain the point decided by the strategy.</p>
<p>Let’s look at the new sequence diagram with the strategy added to the interaction:</p>
<h4>Why a strategy? Is that the GOF pattern?</h4>
<p>Indeed it is, why? Because I wanted to encapsulate the algorithm I’m going to use to snap, snapping to X axis has different rules than snapping to the previous line when having a 90 degree angle. Please refer to the GOF book “Design Patterns” or Google for more examples and diagrams.</p>
<h4>Snapping Strategy Hierarchy</h4>
<p>I have so far one interface <em>ISnappingStrategy</em> and three concrete strategies that implement the interface:</p>
<p><span style="font-size: 13.3333px;"> </span></p>
<ol><span style="font-size: 13.3333px;"><a href="http://orthocoders.com/wp-content/uploads/2010/04/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" src="http://orthocoders.com/wp-content/uploads/2010/04/image_thumb1.png" border="0" alt="image" width="569" height="256" /></a></span></ol>
<p>Each strategy when called will return the snapped point or, if no snapping is required the same point.</p>
<p>So far, so good…. now I have implemented them, and each one passes the unit tests. However I don’t want to use just one of the them, I want to use all of them combined. I’d like to use first <em>SnapToX</em> and if does not snap, then <em>SnapToY, etc, etc</em>.</p>
<h4>Enters the Composite Strategy</h4>
<p>The Composite pattern is another GOF pattern and the goal is to treat a group of objects like they where a single instance. In this case, I want to use multiple snapping strategies like they were just one strategy.</p>
<p>Here is the idea, let’s create the Composite with a collection of strategies, and when called the Composite will iterate thru them until it finds a new snapping point or, if no snapping should happen, return the same point.</p>
<p>So, with the Composite, the new hierarchy looks like:</p>
<p><a href="http://orthocoders.com/wp-content/uploads/2010/04/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://orthocoders.com/wp-content/uploads/2010/04/image_thumb2.png" border="0" alt="image" width="755" height="202" /></a></p>
<p>And the code for the composite snapping would be:</p>
<div id="codeSnippetWrapper">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> Point Snap(Point point, IDrawingContext context)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060">   3:</span>     var found = <span style="color: #0000ff">this</span>._strategies.Find(s =&gt; s.Snap(point, context) != point);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060">   4:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">return</span> found == <span style="color: #0000ff">null</span> ? point : found.Snap(point, context);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060">   6:</span> }</pre>
<p><!--CRLF--></div>
</div>
<h3>The cherry on top</h3>
<p>Now we need to configure all this, luckily we can use Binsor to configure our Windsor container and it will look something like this:</p>
<div id="codeSnippetWrapper">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060">   1:</span> component <span style="color: #006080">"SnapToX"</span>, ISnappingStrategy, VectorSnappingStrategy:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060">   2:</span>   x = 1</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060">   3:</span>   y = 0</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060">   4:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060">   5:</span> component <span style="color: #006080">"SnapToY"</span>, ISnappingStrategy, VectorSnappingStrategy:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060">   6:</span>   x = 0</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060">   7:</span>   y = 1</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060">   8:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060">   9:</span> component <span style="color: #006080">"SnapToPrevious"</span>, ISnappingStrategy, PreviousLineSnappingStrategy</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060">  10:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060">  11:</span> component <span style="color: #006080">"SnappingStrategy"</span>, ISnappingStrategy, CompositeSnappingStrategy:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060">  12:</span>   strategies = [@SnapToX, @SnapToY, @SnapToPrevious]</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060">  13:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060">  14:</span> component <span style="color: #006080">"DrawTool"</span>, IDrawTool, DrawTool:</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060">  15:</span>   snapping = @SnappingStrategy</pre>
<p><!--CRLF--></div>
</div>
<p>Neat eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/04/13/snapping-strategy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Winnipeg Code Camp 2010</title>
		<link>http://orthocoders.com/2010/02/26/winnipeg-code-camp-2010/</link>
		<comments>http://orthocoders.com/2010/02/26/winnipeg-code-camp-2010/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 05:13:47 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://orthocoders.com/2010/02/26/winnipeg-code-camp-2010/</guid>
		<description><![CDATA[Winnipeg Code Camp 2010! I'll present two presentations, BDD and TeamCity, don't miss it....]]></description>
			<content:encoded><![CDATA[<p>Tomorrow I’ll be presenting at the <a href="http://winnipegcodecamp.com" target="_blank">Winnipeg Code Camp 2010</a>!</p>
<p>I’m super excited! This year I have two presentations:</p>
<ol>
<li>Real World BDD for .NET developers</li>
<li> Intro to TeamCity</li>
</ol>
<p>I just finished the last changes to the presentations, enjoy!</p>
<p><a href="http://orthocoders.com/wp-content/uploads/2010/02/2010-02-27-Code-Camp.zip">2010-02-27 Code Camp</a></p>
<p>See u tomorrow!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2010/02/26/winnipeg-code-camp-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code and presentation for .NET UG Automocking</title>
		<link>http://orthocoders.com/2009/11/19/code-and-presentation-for-net-ug-automocking/</link>
		<comments>http://orthocoders.com/2009/11/19/code-and-presentation-for-net-ug-automocking/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 06:27:14 +0000</pubDate>
		<dc:creator>Amir Barylko</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[Automocking]]></category>

		<guid isPermaLink="false">http://orthocoders.com/?p=75</guid>
		<description><![CDATA[Here is the source code and presentation I&#8217;m going to use tomorrow.
Presentation Automocking PPT
Source Code AutoMocking Src
Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>Here is the source code and presentation I&#8217;m going to use tomorrow.</p>
<p>Presentation <a href="http://orthocoders.com/wp-content/uploads/2009/11/Automocking.zip">Automocking PPT</a></p>
<p>Source Code <a href="http://orthocoders.com/wp-content/uploads/2009/11/AutoMocking.zip">AutoMocking Src</a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://orthocoders.com/2009/11/19/code-and-presentation-for-net-ug-automocking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
