<?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>Pathfinder Software &#187; Jason Pearl</title>
	<atom:link href="http://pathfindersoftware.com/author/jason-pearl/feed/" rel="self" type="application/rss+xml" />
	<link>http://pathfindersoftware.com</link>
	<description>The Fastest Way to Launch Successful Software</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:31:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simple Permissions without Authentication / Authorization</title>
		<link>http://pathfindersoftware.com/2010/11/simple-permissions-authentication-authorization/</link>
		<comments>http://pathfindersoftware.com/2010/11/simple-permissions-authentication-authorization/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 12:30:32 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=6065</guid>
		<description><![CDATA[I recently worked on a Rails application where a user needs edit capabilities on a resource, but would like to share a view to this resource with others and not worry about them messing with it. Typically this would entail an Authorization system to provide the proper permissions. Then we&#8217;ll need an Authentication system to ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I recently worked on a Rails application where a user needs edit capabilities on a resource, but would like to share a view to this resource with others and not worry about them messing with it.  Typically this would entail an Authorization system to provide the proper permissions.  Then we&#8217;ll need an Authentication system to register a user, and identify them within the system.</p>
<p>Mind you, this is a bit of toy app, and this seemed like a really overblown solution for a simple problem.  Lots to configure, and lots of user interaction.  In short, way too many moving pieces.  Luckily there is a simple solution.  Use you some Tokens!</p>
<p>Add private_token and public_token strings via a migration and throw the following in your model:</p>
<pre lang="ruby">
  # my_model.rb
  def self.find_by_token(token)
    mymodel = MyModel.where('private_token = ? or public_token = ?',
      token, token).first || raise(ActiveRecord::RecordNotFound)
    @edit_disabled = mymodel.public_token == token
    mymodel
  end

  def can_edit?
    @edit_disabled
  end

  # ...
  private

  def generate_tokens
    self[:public_token] = generate_token
    self[:private_token] = generate_token
  end
  def generate_token
    SecureRandom.base64(10).tr('+/=', '-_ ').strip.delete("\n")
  end
</pre>
<p>Now in your controller actions you can assume that the id coming in is now your token, so go ahead and use your new finder to get the trip.</p>
<pre lang="ruby">
  # my_model_controller.rb
  def show
    @mymodel = MyModel.find_by_token(params[:id])
  end
</pre>
<p>Now these two links point to the same resource, and we can conditionally do things based on the value of @mymodel.can_edit?<br />
http://mysite.com/mymodel/yl45gikaH2sDKA <= public<br />
http://mysite.com/mymodel/2s9GyIrykREPGg < = private</p>
<p>Obviously this is not a hard core security mechanism, but it&#8217;s pretty good at providing basic security with very little work.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;linkname=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F11%2Fsimple-permissions-authentication-authorization%2F&amp;title=Simple%20Permissions%20without%20Authentication%20%2F%20Authorization" id="wpa2a_2">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2010/11/simple-permissions-authentication-authorization/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Heroku Intro</title>
		<link>http://pathfindersoftware.com/2010/10/heroku-intro/</link>
		<comments>http://pathfindersoftware.com/2010/10/heroku-intro/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 19:37:18 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=5963</guid>
		<description><![CDATA[If you&#8217;re building Ruby web apps (Rails, Sinatra, Padrino, &#8230;) and you haven&#8217;t tried out Heroku, please do so. Immediately. You can run on the base package, which is more than adequate for a toy or even small business app, for free. It&#8217;s great for trying things out. No need to dork around with Apache, ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://pathfindersoftware.com/wp-content/uploads/original.jpg" alt="original" title="original" width="368" height="106" style="float:right;" />If you&#8217;re building Ruby web apps (Rails, Sinatra, Padrino, &#8230;) and you haven&#8217;t tried out Heroku, please do so.  Immediately. You can run on the base package, which is more than adequate for a toy or even small business app, for free.  It&#8217;s great for trying things out.</p>
<p>No need to dork around with Apache, Nginx, Mongrel, Passenger, etc, etc etc&#8230;  Just a &#8220;git push&#8221; is all you need.  Heroku has basically taken all the mundane crap that just gets in the way and lets you build your app.<br />
<!-- more --><br />
First go sign up at <a href="http://heroku.com">http://heroku.com</a>.  Also make sure you&#8217;ve got an ssh key created for your machine.  Github&#8217;s got some good instructions if you need them <a href="http://help.github.com/key-setup-redirect">here</a>.</p>
<pre lang="rb">gem install heroku</pre>
<p>This will get you rolling.  Just type &#8220;heroku&#8221; for a nice synopsis of what&#8217;s available.  It will instruct you how to create your project:</p>
<pre lang="rb">heroku keys:add</pre>
<p>This will add your public key so that heroku knows who you are.</p>
<pre lang="rb">
rails myapp
cd myapp
git init
git add .
git commit -m "my new app"
heroku create "myawesomeappname"
git push heroku master
</pre>
<p>Now go visit your http://myawesomeappname.heroku.com.  Isn&#8217;t that cool?  Have you ever deployed a web app that quickly before?  Now go build something, commit, and git push.</p>
<h2>So what&#8217;s the catch?</h2>
<p>It&#8217;s a bit more expensive than other cloud platforms like Rackspace or straight EC2 (which heroku is built upon).  For me, and some Pathfinder clients its a worthy tradeoff since we save money on system administration tasks, and gain so much in speed.  Also, your first &#8220;dyno&#8221; is free, which negates some of the cost as well.  I feel like most apps (not Twitter, not Groupon) can build to a reasonable size on Heroku and concentrate on the PRODUCT.  Once you&#8217;re big enough that heroku pricing is a pain, worry about saving some cash.  (Let us know if you&#8217;ve got this problem, we&#8217;ll be happy to help)</p>
<p>You are at heroku&#8217;s whim when they&#8217;re down.  I&#8217;ve had an application in production for almost a year now and I&#8217;ve only had a handful of short down periods.  When heroku is down though, it can be a little rough.  There is currently no way to display a branded error page.  Your visitors see a cryptic &#8220;Ouchie Guy&#8221; graphic with some random Japanese text on it.  But in sum total I&#8217;ve probably experienced 2-3 hours of outages in a year.  That&#8217;s pretty darn good.</p>
<p>By default you&#8217;re on postgresql.  Arguably a really nice database, but maybe not one that you&#8217;re used to, or interested in.  You&#8217;ve got options though, as you can connect to Amazon RDS or a multitude of other services.</p>
<h2>Use it</h2>
<p>These guys have built a brilliant deployment platform.  It enables ruby developers, and soon node.js developers to roll out new apps as fast as you can type.  All those ideas you&#8217;ve got kicking around in your head can be built and deployed with little hassle.  Let us know what you build.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;linkname=Heroku%20Intro" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F10%2Fheroku-intro%2F&amp;title=Heroku%20Intro" id="wpa2a_4">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2010/10/heroku-intro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git is for Playing</title>
		<link>http://pathfindersoftware.com/2010/09/git-playing/</link>
		<comments>http://pathfindersoftware.com/2010/09/git-playing/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 22:15:25 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=5859</guid>
		<description><![CDATA[photo credit: Felix Francier I&#8217;ve been using Git for close to a year now, and I cannot remember what I did before it. I literally forget the process involved in doing certain things with subversion, cvs, and (shudder) vss. At first it was a bit of a struggle sure. The gui tools are somewhat lacking, ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="float:right;padding:10px"><a title="Stripped bombax tree silhouette" href="http://www.flickr.com/photos/felixfrancier/356715278" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/356715278_0e0cfe107c_m.jpg" border="0" alt="Stripped bombax tree silhouette" /></a><br />
<small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/cc74.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="Felix Francier" href="http://www.flickr.com/photos/felixfrancier/" target="_blank">Felix Francier</a></small></div>
<p>I&#8217;ve been using <a href='http://git-scm.com/'>Git</a> for close to a year now, and I cannot remember what I did before it.  I literally forget the process involved in doing certain things with subversion, cvs, and (shudder) vss.  At first it was a bit of a struggle sure.  The gui tools are somewhat lacking, but what is there is decent enough.  I like <a href='http://gitx.frim.nl/'>Gitx</a> a lot for what it does, but mainly I use it for partial commits, and visualization of a source tree.  Being from windows land, and having used tortoise svn (a very very nice subversion client), it took me a bit to master the intricacies of the git command line interface.  I still get into a little trouble from time to time.  But it is all so very much worth it!
<pre>git branch my_new_toy</pre>
<p>Seriously?  That&#8217;s it?  And it took less than a second?  Why would I not branch ALL THE TIME.  Wanna try something out?  Branch it!  Unsure that you&#8217;ll finish a feature in time for iteration end?  Branch it!  My pet project has 5 branches going right, all for little experiments and features that I&#8217;ve been slowly working on.</p>
<p>Feature branches have changed my workflow entirely. Every new feature I build, I create a branch for it. If it takes a while I merge from master to make sure I&#8217;m up to date.</p>
<pre>git merge master</pre>
<p>If we balk at the feature, or I want to go a different route with it, I can chuck it. If all goes which (which of course it always does), I merge it to master or whatever branch represents the latest greatest code.</p>
<pre>git checkout master
git merge my_feature_branch</pre>
<p>Once you get the hang of it you realize how simple and powerful it is. Every day I use it I&#8217;m continually amazed and thankful of how well it works and how drastically it improves my teams workflow.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;linkname=Git%20is%20for%20Playing" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F09%2Fgit-playing%2F&amp;title=Git%20is%20for%20Playing" id="wpa2a_6">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2010/09/git-playing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Authorization with CanCan</title>
		<link>http://pathfindersoftware.com/2010/07/authorization-cancan/</link>
		<comments>http://pathfindersoftware.com/2010/07/authorization-cancan/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 11:30:40 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails authorization cancan ruby]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=5313</guid>
		<description><![CDATA[Having using Acl9 for some time, it was refreshing to see RailsCast&#8217;s Ryan Bate&#8217;s take on authorization: CanCan.  Ryan put together a webcast for CanCan that you can checkout here.  There have been some nice additons since this initial release so do checkout the latest documentation on GitHub.  I won&#8217;t go into what I dislike ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="float:right;padding:10px"><a title="Locks" href="http://www.flickr.com/photos/lwr/863297155/" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/863297155_17b9031799_m.jpg" border="0" alt="Locks" /></a></div>
<p>Having using Acl9 for some time, it was refreshing to see RailsCast&#8217;s Ryan Bate&#8217;s take on authorization: <a title="CanCan on GitHub" href="http://github.com/ryanb/cancan" target="_blank">CanCan</a>.  Ryan put together a webcast for CanCan that you can checkout <a title="RailsCast 192 Authorization with CanCan" href="http://railscasts.com/episodes/192-authorization-with-cancan" target="_blank">here</a>.  There have been some nice additons since this initial release so do checkout the latest documentation on GitHub.  I won&#8217;t go into what I dislike about Acl9.  It&#8217;s a good system, with a nice DSL for defining permissions.  I&#8217;ll just talk about some of the things I&#8217;ve enjoyed about CanCan.  If you haven&#8217;t explored the library, you should.<br />
<span id="more-5313"></span></p>
<h3>Lightweight</h3>
<p>There is very little setup involved.  In fact, nothing by default is kept in the database.  <strong>You</strong> decide how permissions are assigned.  It can be as simple as a flag on a user on up to a complex role based setup.  For example, let&#8217;s say my system had some fairly unsophisticated requirements.  You&#8217;re either an admin, or you&#8217;re a normal everyday user.  Slap an admin flag on the user model, and be on your way.  Typically, permissions are defined inside a model named Ability.</p>
<pre lang="ruby">class Ability
  include CanCan::Ability

  def initialize(user)
    if user.admin?
      can :create, User
    end
  end
end</pre>
<p><strong>Index authorization</strong></p>
<p>This is a big one.  Since CanCan 1.1, we&#8217;ve been able to define abilities that can be used for lookups.  It&#8217;s one thing to determine if we do or do not have permissions on an object that we&#8217;ve already been handed.  It&#8217;s another animal entirely to be able to retrieve the records that a particular user has permissions to.  CanCan makes this dead simple.  We just need to add a conditions hash when defining the ability.</p>
<pre lang="ruby">can :read, Widget, :user_id =&gt; user.id, :active =&gt; true</pre>
<p>Now all we need to do in our controller to retrieve only what our user should have access to read:</p>
<pre lang="ruby">@widgets = Widgets.accessible_by(current_ability)</pre>
<p>How awesome is that??!?  <strong>AND</strong> it&#8217;s an Active Record scope, so we can chain other scopes onto it!</p>
<p><strong>Easy controller integration</strong></p>
<p>Ryan&#8217;s provided a nice method (load_and_authorize_resource) we can call inside of our controllers to both load and authorize the resource for the requested action.</p>
<pre lang="ruby">class WidgetsController &lt; ApplicationController
  load_and_authorize_resource

  def show
    # We've already retrieved @widget and
    # authorized the current user for the show action!
  end
end</pre>
<p>This will work for all 7 restful actions.  If you need to do something fancy with your model prior to the load_and_authorize call, you can use a before filter.  It will play nice and skip the load portion if it sees that you&#8217;ve already taken care of business.</p>
<p>There&#8217;s a good deal more to CanCan, this is just a little taste.  Hopefully it&#8217;s been enough to wet your whistle and go explore a little further.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;linkname=Authorization%20with%20CanCan" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F07%2Fauthorization-cancan%2F&amp;title=Authorization%20with%20CanCan" id="wpa2a_8">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2010/07/authorization-cancan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration on Multiple Ruby Versions with RVM and Hudson</title>
		<link>http://pathfindersoftware.com/2010/05/continuous-integration-multiple-ruby-versions-rvm-hudson/</link>
		<comments>http://pathfindersoftware.com/2010/05/continuous-integration-multiple-ruby-versions-rvm-hudson/#comments</comments>
		<pubDate>Wed, 05 May 2010 01:06:46 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[1.9.1]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=5144</guid>
		<description><![CDATA[NOTICE: We&#8217;ve run into some snags still with the hudson daemon recognizing the proper environment vars.  We are working on some solutions after speaking with Wayne Seguin, and we&#8217;ll keep you updated.  So basically, the following is possibly interesting, but not yet entirely correctly implemented. We&#8217;ve recently moved to Ruby 1.9.1 on a current Rails ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="float: right;padding: 10px"><img src="http://pathfindersoftware.com/wp-content/uploads/hudson_ruby1.png" alt="hudson_ruby" width="96" height="96" /></div>
<p><span style="color: #ff0000">NOTICE:</span> We&#8217;ve run into some snags still with the hudson daemon recognizing the proper environment vars.  We are working on some solutions after speaking with <span><span>Wayne Seguin, and we&#8217;ll keep you updated.  So basically, the following is possibly interesting, but not yet entirely correctly implemented.<br />
</span></span></p>
<p>We&#8217;ve recently moved to Ruby 1.9.1 on a current Rails project.  Since we&#8217;re still working on other projects using older ruby versions, all developers are up and running on <a href="http://rvm.beginrescueend.com/">RVM</a>.  This allows us to easily switch back and forth between different versions of Ruby.  There&#8217;s a railscasts episode on <a href="http://railscasts.com/episodes/200-rails-3-beta-and-rvm">RVM and Rails 3</a> if you&#8217;d like to learn up, but Rails 3 is NOT a requirement for RVM.  We&#8217;ve seen a HUGE speed improvement running our test suite, as well as on the application itself.  We&#8217;ve also upgraded the production environment to Ruby 1.9.1 to match.  The problem we were now faced with is our continuous integration server, Hudson, is still running on ruby enterprise (1.8.6).  We needed to run each project build on whichever ruby version was most appropriate.</p>
<p><strong>RVM to the rescue!</strong></p>
<p>So here&#8217;s how we did it.  On the build server, as the user the server runs as, we installed RVM.  We also made sure to &#8216;rvm system &#8211;default&#8217; to make sure we didn&#8217;t mess with anything that was already relying on the current version. Next up was setting the environment up correctly for Hudson to recognize RVM.  We added the same line RVM prompts you to add to .bashrc and .bash_profile to our hudson startup script start_hudson.sh:</p>
<blockquote><p>if [[ -s /home/hudson/.rvm/scripts/rvm ]] ; then source /home/hudson/.rvm/scripts/rvm ; fi</p></blockquote>
<p>The rake plugin that lets us run our tests, migrations, coverage, etc&#8230; also allows us to create and assign ruby versions for each rake task.  So in Hudson&#8217;s system configuration we created entries for our rubies:</p>
<p><img class="aligncenter size-full wp-image-5145" src="http://pathfindersoftware.com/wp-content/uploads/Screen-shot-2010-05-04-at-7.02.45-PM1.png" alt="Screen shot 2010-05-04 at 7.02.45 PM" width="573" height="271" /></p>
<p>Then we can assign each rake task to the proper ruby, in this case 1.9.1.</p>
<p>One last snag: some things STILL appeared to be running from the default ruby, so we added two execute tasks to bookend the process.  The first &#8216;rvm 1.9.1 &#8211;default&#8217;, and the last &#8216;rvm system &#8211;default&#8217;.  This ensures everything runs via the proper ruby version, and we reset it when we&#8217;re finished.  Is this the best process for managing CI with mutiple versions of ruby? I&#8217;m not sure, but it works!
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;linkname=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2010%2F05%2Fcontinuous-integration-multiple-ruby-versions-rvm-hudson%2F&amp;title=Continuous%20Integration%20on%20Multiple%20Ruby%20Versions%20with%20RVM%20and%20Hudson" id="wpa2a_10">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2010/05/continuous-integration-multiple-ruby-versions-rvm-hudson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Documentation (It ain&#039;t that hard)</title>
		<link>http://pathfindersoftware.com/2009/10/documentation-hard/</link>
		<comments>http://pathfindersoftware.com/2009/10/documentation-hard/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 18:14:59 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[c# documentation ndoc sandcastle]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=3260</guid>
		<description><![CDATA[On a recent project after months and months and hundreds of files worth of work, we were asked to provide documentation for the code. This request could have gone one of two ways depending upon how well we adhered to some basic documentation rules. The C# compiler itself is setup to extract documentation which can ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>On a recent project after months and months and hundreds of files worth of work, we were asked to provide documentation for the code.  This request could have gone one of two ways depending upon how well we adhered to some basic documentation rules.</p>
<p>The C# compiler itself is setup to extract documentation which can then be piped through one of a number of documentation generation apps.  My preference is a new(ish) project called SandCastle from Microsoft, which aims to provide much of the featureset that NDoc once did.  Unfortunately this application provides no GUI.  A fine gentleman named Eric Woodruff stepped in to wrap this application in an easy to use GUI for us aptly named <a href="http://www.codeplex.com/SHFB">Sandcastle Help File Builder</a>.  Through the use of good comments written WHILE we wrote the code, we were able to pop out some documentation for every bit of code we wrote in a matter of minutes.  Add to this the nice information we get when using our code via intellisense, and it simply doesn&#8217;t make sense not to strictly enforce documentation standards on your project.</p>
<p>I often see code written with little or no attention paid to comments.  Sometimes the comments are fairly haphazard and appear to follow no standards whatsoever.  By following documentation standards, you too can auto generate documentation instead of wasting hours or days going back through and trying to remember what your code does. <span id="more-3260"></span>The following are some of the more important tags available for C# documentation, presented in a roughly organized fashion.  You can find a more complete list <a href="http://msdn.microsoft.com/en-us/library/5ast78ax(VS.85).aspx">here</a>.</p>
<p><strong>Method/Type Description:</strong><br />
summary &#8211; To describe a type or type member<br />
param name=&#8217;name&#8217; &#8211; To describe a parameter of a method<br />
example &#8211; To show an example of code usage<br />
returns &#8211; To describe the data to be returned from the method</p>
<p><strong>Formatting:</strong><br />
code &#8211; Denotes what is contained is code<br />
c &#8211; Similar to &#8216;code&#8217; but used within comments<br />
para &#8211; Usually nested in another tag, allows formatted text</p>
<p><strong>References:</strong><br />
see cref=&#8217;member&#8217; &#8211; To specify a link to another type<br />
seealso cref=&#8217;member&#8217; &#8211; To specify text that may appear in a &#8220;See Also section&#8221; (I honestly have no clue what that means)<br />
paramref name=&#8217;name&#8217; &#8211; To reference a parameter in comments</p>
<p>There are other tags available, but with these in your arsenal, you should be able to build some nice documentation.  Here&#8217;s an example of what I would consider well commented code:</p>
<pre lang="c#">///
<summary>
/// This is a class description
/// </summary>

public class MyClass
{
  ///
<summary>
  /// This method gets something
  /// </summary>

  ///
<param name="number">An integer input</param>
  /// <returns>Returns a <see cref="string"> based on the provided
  /// number
  /// </returns>
  public string GetSomething(int number)
  {
    ...
  }
</pre>
<p>That&#8217;s not that painful is it?
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;linkname=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F10%2Fdocumentation-hard%2F&amp;title=C%23%20Documentation%20%28It%20ain%26%23039%3Bt%20that%20hard%29" id="wpa2a_12">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/10/documentation-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Development on a Mac</title>
		<link>http://pathfindersoftware.com/2009/07/windows-development-on-a-mac/</link>
		<comments>http://pathfindersoftware.com/2009/07/windows-development-on-a-mac/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 16:58:39 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=3230</guid>
		<description><![CDATA[I&#8217;ve been in just about the same cycle for almost 15 years now. Install Windows. Install the software I need on top of it. Wait about 6 months to a year until I can no longer take the gunk slowing down my system (&#8220;Windows Disease&#8221;). Backup my data. Format my drive. Rinse and repeat. Do ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div class="right"><img class="alignright size-full wp-image-3234" title="app_win1" src="http://pathfindersoftware.com/wp-content/uploads/app_win11.png" alt="app_win1" width="133" height="146" /></div>
<p>I&#8217;ve been in just about the same cycle for almost 15 years now.  Install Windows.  Install the software I need on top of it. Wait about 6 months to a year until I can no longer take the gunk slowing down my system (&#8220;Windows Disease&#8221;). Backup my data. Format my drive.  Rinse and repeat.  Do this maybe 3 or 4 times, and then upgrade my hardware.  Sound familiar?</p>
<p>So I got smarter.  I started making images using <a href="http://www.symantec.com/norton/ghost">Ghost</a>.  This has worked fairly well.  I get a new system, I set it up as pristine and fully featured as possible, then I take an image of it.  This way the install step takes a couple button presses, leaving me to do more useful things with my time.  Like blog or something.</p>
<p>Fast forward a couple years.  Processors are way faster and have more cores.  Virtualization is no longer a toy, and can now be used not just for enterprise purposes, but on the desktop.  Sure I&#8217;m mostly a Windows developer, but that doesn&#8217;t mean I don&#8217;t want to write iPhone / Mac applications.  So after cursing my previous laptop up and down on a daily basis, I&#8217;ve upgraded to a MacBook Pro.  It&#8217;s tiny, it&#8217;s fast, and it runs OS X <em>and</em> WINDOWS via <a href="http://www.vmware.com/products/fusion/">VMWare Fusion</a>.  Windows runs spectacularly on my MacBook.  The most beautiful part is, as far as I can tell, there is no parallel (no pun intended) to &#8220;Windows Disease&#8221; on a Mac.  It has continued to run as fresh and fast as the day I installed the OS.  Now with my backed up copy of my Windows virtual machine, starting from scratch on Windows is as simple as taking a fresh copy and spinning up the backup VM.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;linkname=Windows%20Development%20on%20a%20Mac" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwindows-development-on-a-mac%2F&amp;title=Windows%20Development%20on%20a%20Mac" id="wpa2a_14">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/07/windows-development-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UI Testing is easy with MVP</title>
		<link>http://pathfindersoftware.com/2009/04/ui-testing-is-easy-with-mvp/</link>
		<comments>http://pathfindersoftware.com/2009/04/ui-testing-is-easy-with-mvp/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 20:48:34 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2219</guid>
		<description><![CDATA[photo credit: FireChickenTA99 Developing an application with WinForms can lead to difficult testing scenarios.  There are a ton of  automated UI testing toolkits that essentially record workflows and replay them.  This can work, but leads to unwieldy tests, and makes it difficult to integrate them into automated tests and builds.  I recommend using the Model ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="padding:10px;float:right"><a title="Easy Money" href="http://www.flickr.com/photos/73186496@N00/3479600161/" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/3479600161_67d3c9a7b6_m.jpg" border="0" alt="Easy Money" /></a><br />
<small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/cc6.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="FireChickenTA99" href="http://www.flickr.com/photos/73186496@N00/3479600161/" target="_blank">FireChickenTA99</a></small></div>
<p>Developing an application with WinForms can lead to difficult testing scenarios.  There are a ton of  automated UI testing toolkits that essentially record workflows and replay them.  This can work, but leads to unwieldy tests, and makes it difficult to integrate them into automated tests and builds.  I recommend using the Model View Presenter (MVP) pattern for your application architecture to relieve this pain point.  Todd  Snyder from Infragistics has a nice blog entry explaining the<a href="http://blogs.infragistics.com/blogs/todd_snyder/archive/2007/10/17/mvc-or-mvp-pattern-whats-the-difference.aspx"> differences between MVC and MVP patterns</a>.  The gist is: you have a coordinating  Presenter that communicates with the View via its interface, and orchestrates the interaction between the View and the Model.  The important piece here is the View  interface.  This view interface can allow you to stub or mock the view in testing scenarios, to completely eliminate the need for any UI interaction.  As long as your UI code is used as a shell that does nothing but pass messages, this makes testing REALLY easy.</p>
<p>We recently built a project around the MVP architecture.  Eventually we wound up creating a test harness providing us simple methods such as:<br />
<code>public void MouseUp(IDocumentPresenter presenter, int x, int y)</code><br />
This simulated a mouse up event without actually requiring an input device or the UI that it acts upon.  With simple method like these, you can build up some pretty complex tests that run quickly and don&#8217;t require any special libraries to run.</p>
<p>Before embarking on your next GUI framework based application, be it WinForms or other, evaluate the MVP pattern and the ease of testing that it can provide.  It&#8217;s worked really well for us.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;linkname=UI%20Testing%20is%20easy%20with%20MVP" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fui-testing-is-easy-with-mvp%2F&amp;title=UI%20Testing%20is%20easy%20with%20MVP" id="wpa2a_16">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/04/ui-testing-is-easy-with-mvp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pairing Remotely for Fun and Profit</title>
		<link>http://pathfindersoftware.com/2009/03/pairing-remotely-for-fun-and-profit/</link>
		<comments>http://pathfindersoftware.com/2009/03/pairing-remotely-for-fun-and-profit/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 12:30:38 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[Pair Programming]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1583</guid>
		<description><![CDATA[Love it or hate it, pair programming is a large component of many agile development methodologies.  I&#8217;ve become a firm believer in the benefits of pairing, and very rarely write code nowadays without some degree of collaboration with a second (or third) developer.  The benefits have been vast.  The code is better thought out because ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="size-full wp-image-1586 alignright" style="float:right;padding:10px" src="http://pathfindersoftware.com/wp-content/uploads/471300085_0fb942a10f_m1.jpg" alt="471300085_0fb942a10f_m" width="154" height="120" />Love it or hate it, pair programming is a large component of many agile development methodologies.  I&#8217;ve become a firm believer in the benefits of pairing, and very rarely write code nowadays without some degree of collaboration with a second (or third) developer.  The benefits have been vast.  The code is better thought out because a pairing session always starts with a discussion of the approach to be taken.  Fat-fingered mistakes are headed off at the pass because a second set of eyes is closely watching what&#8217;s being typed.  Less time is wasted checking email, taking calls from the in-laws, and just generally doing things that would annoy the second member of the pair.  Above all, it allows developers to analyze and quickly debate the approach being taken,  and adjust and improve that approach throughout the development cycle.</p>
<p>It all sounds great doesn&#8217;t it?  Well it is <em>when executed correctly</em>.  In my experience there are two general principals that if not adhered to, will turn a productive pairing session into a developer writing some mediocre code sitting next to a developer who might as well have taken the day off.   These principals are: <em>developers must remain engaged</em>, and <em>developers like their own space</em>.</p>
<p><span id="more-1583"></span></p>
<p>VNC (Virtual Network Computing) is a  platform independent desktop sharing system that&#8217;s been around for close to 10 years.  While any desktop sharing approach should work, I&#8217;ve found VNC, or more specifically <a href="http://www.tightvnc.com/">TightVNC</a> to be solid and stable, and more importantly FREE!   As a team, we&#8217;ve started using TightVNC for pairing.  One developer loads up the server, and one loads the client.  Our desks are all close  so chatting isn&#8217;t an issue, but we&#8217;ve used the same approach while working remotely using a headset and skype.  You won&#8217;t need to tote your laptop around, and you don&#8217;t need to rearrange anything to accommodate another developer staring at your already meager amount of screen real estate.  It allows for easier &#8220;tag-teaming&#8221; as nobody has to move to pass the keyboard.  You simply stop typing and let the other developer have at it.  The simple fact that a developer can easily see and participate in the coding process leads to a higher degree of engagement and more ownership of the code being produced.  As a added benefit, this process works well for a sick co-worker that may have forced themselves to come into work, infecting your whole team with some dreaded illness.</p>
<p>Give remote pairing a chance, and see if it helps you overcome the annoyances that may have stopped you from embracing the practice fully.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;linkname=Pairing%20Remotely%20for%20Fun%20and%20Profit" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fpairing-remotely-for-fun-and-profit%2F&amp;title=Pairing%20Remotely%20for%20Fun%20and%20Profit" id="wpa2a_18">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/03/pairing-remotely-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINQ to My Domain</title>
		<link>http://pathfindersoftware.com/2008/07/linq-to-my-domain/</link>
		<comments>http://pathfindersoftware.com/2008/07/linq-to-my-domain/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 02:04:08 +0000</pubDate>
		<dc:creator>Jason Pearl</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1073</guid>
		<description><![CDATA[I&#8217;ve begun my foray into the world of LINQ, and in my investigation I&#8217;ve seen a lot of work based on the LINQ to SQL &#8220;design surface&#8221; available in Visual Studio 2008. It&#8217;s a neat tool. I point it to my database, drag some tables over, and it infers my domain structure and relationships from ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://pathfindersoftware.com/wp-content/uploads/linq_designer21.jpg"><img class="alignright size-thumbnail wp-image-1076" style="float:right; padding: 10px" src="http://pathfindersoftware.com/wp-content/uploads/linq_designer21.jpg" alt="Design Surface" width="150" height="125" /></a>I&#8217;ve begun my foray into the world of LINQ, and in my investigation I&#8217;ve seen a lot of work based on the LINQ to SQL &#8220;design surface&#8221; available in Visual Studio 2008.  It&#8217;s a neat tool.  I point it to my database, drag some tables over, and it infers my domain structure and relationships from the databases fields and keys.  That&#8217;s all well and good for a simple domain model that is <strong>directly</strong> related to the database schema.  I could see using this for a quick prototype, or a really small application.  I see three files created by the designer:</p>
<p><strong>MyClasses.dbml</strong> &#8211; This looks like any ORM frameworks mapping file.  It associates classes with tables, maps fields to object properties, and defines relationships.</p>
<pre lang="xml">
<table border="0"></table>
</pre>
<p><strong> MyClasses.dbml.layout</strong> &#8211; This looks to be specific to the layout of the design surface and appears to serve no purpose outside of this design.</p>
<p><strong> MyClasses.designer.cs</strong> &#8211; This is the beast that I&#8217;m looking to replace.  It contains the class definitions and attribute based mappings to bring my database schema into my application, and ready it for use by LINQ.</p>
<p>So this leaves me with a couple questions.  One,  why are attributes used to specify mappings?  Can this be done strictly via XML?  More importantly two, can I use my own domain model, and if so how do I map it to the database?</p>
<p>My goal would be to design a layered system, separating the underlying data store from the repositories required to push and pull my domain objects from these data stores.  This would allow in memory implementations of the data store, and would make unit testing (and developing) a whole lot easier.  I will be digging into this in the coming days and will report back soon.  Stay tuned!
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;linkname=LINQ%20to%20My%20Domain" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Flinq-to-my-domain%2F&amp;title=LINQ%20to%20My%20Domain" id="wpa2a_20">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2008/07/linq-to-my-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (User agent is rejected)
Page Caching using memcached (User agent is rejected)

Served from: pathfindersoftware.com @ 2012-02-09 18:31:38 -->
