<?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>Alonso Robles</title>
	<atom:link href="http://alonsorobles.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alonsorobles.com</link>
	<description>technology, academia, and other tidbits from the trenches of a boggled mind</description>
	<lastBuildDate>Wed, 18 Apr 2012 02:48:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>A C# Developer&#8217;s Adventures in Objective-C</title>
		<link>http://alonsorobles.com/2012/04/16/a-c-developers-adventures-in-objective-c/</link>
		<comments>http://alonsorobles.com/2012/04/16/a-c-developers-adventures-in-objective-c/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 00:25:17 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=410</guid>
		<description><![CDATA[The other day, my father asked me how to get started developing for the iPhone and iPad. He is looking for a technical hobby that he can do while he travels in his upcoming retirement. I had no idea really &#8230; <a href="http://alonsorobles.com/2012/04/16/a-c-developers-adventures-in-objective-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day, my father asked me how to get started developing for the iPhone and iPad. He is looking for a technical hobby that he can do while he travels in his upcoming retirement. I had no idea really how to get started so I asked around. I learned quickly that it doesn’t take much to learn if you have an Apple computer.</p>
<p>All that I did is:</p>
<ol>
<li>Download <a href="https://developer.apple.com/xcode/">XCode 4</a> which is a free download from the Mac App Store.</li>
<li>Download the Stanford University <a href="http://itunes.apple.com/itunes-u/ipad-iphone-application-development/id473757255">iPhone and iPad Application Development</a> Collection for <a href="http://www.apple.com/education/itunes-u/">iTunes U</a>.</li>
<li>Watched the first 2 lectures from the course.</li>
<li>Fired up XCode 4.</li>
<li>Attempted the <a href="https://github.com/alonsorobles/ReversePolishNotationCalculator">Reverse Polish Notation Calculator</a> targeting the iPhone described in the second lecture.</li>
</ol>
<p>Of course, this was a very simple iPhone application that was built with only about three ours exposure to <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html">Objective-C</a> (the programming language), <a href="https://developer.apple.com/technologies/ios/cocoa-touch.html">Cocoa Touch</a> (the iOS framework), and XCode (the integrated development environment). It was a fun exercise. However, if you are only familiar with .NET and/or Java there are some uncomfortable moments with the Object-C syntax that you are bound to encounter. Mind you I am a complete novice with the language, the framework, the development environment, and the platform. Nevertheless, these are my experiences.</p>
<p>First things first… The iPhone application makes heavy use of the model-view-controller (MVC) pattern. I like this. I am familiar with the MVC pattern and I can work with that. What was surprising is that the only code I really touched was the model objects and controller objects. The view was entirely created with the visual designer which generated <a href="https://github.com/alonsorobles/ReversePolishNotationCalculator/blob/master/ReversePolishNotationCalculator/en.lproj/MainStoryboard.storyboard">a storyboard file</a> to describe the view. This file is an XML file. This wasn’t difficult to get used to as I only really worked with the native Cocoa view objects. I am curious to find out what the story for creating your own view objects is.</p>
<p>After dragging and dropping controls on the storyboard, I started working with the controller. This experience was mostly clicking and dragging connections from the visual designer to the controller source code and implementing a few properties and methods. Take a moment to review the controller header file:</p>
<div id="gist-2402607" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">#import &lt;UIKit/UIKit.h&gt;</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="k">@interface</span> <span class="nc">CalculatorViewController</span> : <span class="nc">UIViewController</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'><span class="k">@property</span> <span class="p">(</span><span class="n">weak</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="kt">IBOutlet</span> <span class="n">UILabel</span> <span class="o">*</span><span class="n">display</span><span class="p">;</span></div><div class='line' id='LC6'><br/></div><div class='line' id='LC7'><span class="k">@end</span></div><div class='line' id='LC8'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2402607/20dc14d78076ae961637f503db4d461c0faf3a04/CalculatorViewController.h" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2402607#file_calculator_view_controller.h" style="float:right;margin-right:10px;color:#666">CalculatorViewController.h</a>
            <a href="https://gist.github.com/2402607">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Even with some exposure to C and C++ over a decade ago, this header file appeared strange to me. It’s purpose is similar to C or a C++ header file as it serves to declare class, type,  function, and constant declarations.</p>
<p>Now look at the source file:</p>
<div id="gist-2402660" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">#import &quot;CalculatorViewController.h&quot;</span></div><div class='line' id='LC2'><span class="cp">#import &quot;Calculator.h&quot;</span></div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'><span class="k">@interface</span> <span class="nc">CalculatorViewController</span> <span class="p">()</span></div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">)</span> <span class="kt">BOOL</span> <span class="n">userIsEnteringANumber</span><span class="p">;</span></div><div class='line' id='LC7'><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">strong</span><span class="p">)</span> <span class="n">Calculator</span> <span class="o">*</span><span class="n">calculator</span><span class="p">;</span></div><div class='line' id='LC8'><br/></div><div class='line' id='LC9'><span class="k">@end</span></div><div class='line' id='LC10'><br/></div><div class='line' id='LC11'><span class="k">@implementation</span> <span class="nc">CalculatorViewController</span></div><div class='line' id='LC12'><span class="k">@synthesize</span> <span class="n">display</span> <span class="o">=</span> <span class="n">_display</span><span class="p">;</span></div><div class='line' id='LC13'><span class="k">@synthesize</span> <span class="n">userIsEnteringANumber</span> <span class="o">=</span> <span class="n">_userIsEnteringANumber</span><span class="p">;</span></div><div class='line' id='LC14'><span class="k">@synthesize</span> <span class="n">calculator</span> <span class="o">=</span> <span class="n">_calculator</span><span class="p">;</span></div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'><span class="k">-</span> <span class="p">(</span><span class="n">Calculator</span> <span class="o">*</span><span class="p">)</span> <span class="nf">calculator</span> <span class="p">{</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">_calculator</span><span class="p">)</span> <span class="n">_calculator</span> <span class="o">=</span> <span class="p">[[</span><span class="n">Calculator</span> <span class="n">alloc</span><span class="p">]</span> <span class="n">init</span><span class="p">];</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">_calculator</span><span class="p">;</span></div><div class='line' id='LC19'><span class="p">}</span></div><div class='line' id='LC20'><br/></div><div class='line' id='LC21'><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">viewDidLoad</span></div><div class='line' id='LC22'><span class="p">{</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">super</span> <span class="n">viewDidLoad</span><span class="p">];</span></div><div class='line' id='LC24'>	<span class="c1">// Do any additional setup after loading the view, typically from a nib.</span></div><div class='line' id='LC25'><span class="p">}</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">viewDidUnload</span></div><div class='line' id='LC28'><span class="p">{</span></div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span> <span class="nl">setDisplay:</span><span class="nb">nil</span><span class="p">];</span></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">super</span> <span class="n">viewDidUnload</span><span class="p">];</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Release any retained subviews of the main view.</span></div><div class='line' id='LC32'><span class="p">}</span></div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'><span class="k">-</span> <span class="p">(</span><span class="kt">BOOL</span><span class="p">)</span><span class="nf">shouldAutorotateToInterfaceOrientation:</span><span class="p">(</span><span class="n">UIInterfaceOrientation</span><span class="p">)</span><span class="nv">interfaceOrientation</span></div><div class='line' id='LC35'><span class="p">{</span></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="p">(</span><span class="n">interfaceOrientation</span> <span class="o">!=</span> <span class="n">UIInterfaceOrientationPortraitUpsideDown</span><span class="p">);</span></div><div class='line' id='LC37'><span class="p">}</span></div><div class='line' id='LC38'><br/></div><div class='line' id='LC39'><span class="k">-</span> <span class="p">(</span><span class="kt">IBAction</span><span class="p">)</span><span class="nf">digitPressed:</span><span class="p">(</span><span class="n">UIButton</span> <span class="o">*</span><span class="p">)</span><span class="nv">sender</span> <span class="p">{</span></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">NSString</span> <span class="o">*</span><span class="n">digit</span> <span class="o">=</span> <span class="n">sender</span><span class="p">.</span><span class="n">currentTitle</span><span class="p">;</span></div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">userIsEnteringANumber</span><span class="p">)</span> </div><div class='line' id='LC42'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span><span class="p">.</span><span class="n">display</span><span class="p">.</span><span class="n">text</span> <span class="o">=</span> <span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">display</span><span class="p">.</span><span class="n">text</span> <span class="nl">stringByAppendingString:</span><span class="n">digit</span><span class="p">];</span></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">digit</span> <span class="o">!=</span> <span class="s">@&quot;0&quot;</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span><span class="p">.</span><span class="n">display</span><span class="p">.</span><span class="n">text</span> <span class="o">=</span> <span class="n">digit</span><span class="p">;</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span><span class="p">.</span><span class="n">userIsEnteringANumber</span> <span class="o">=</span> <span class="n">YES</span><span class="p">;</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC47'><span class="p">}</span></div><div class='line' id='LC48'><br/></div><div class='line' id='LC49'><span class="k">-</span> <span class="p">(</span><span class="kt">IBAction</span><span class="p">)</span><span class="nf">operandPressed:</span><span class="p">(</span><span class="n">UIButton</span> <span class="o">*</span><span class="p">)</span><span class="nv">sender</span> <span class="p">{</span></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">userIsEnteringANumber</span><span class="p">)</span> <span class="p">[</span><span class="n">self</span> <span class="n">enterPressed</span><span class="p">];</span></div><div class='line' id='LC51'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">double</span> <span class="n">result</span> <span class="o">=</span> <span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">calculator</span> <span class="nl">perform:</span><span class="n">sender</span><span class="p">.</span><span class="n">currentTitle</span><span class="p">];</span></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span><span class="p">.</span><span class="n">display</span><span class="p">.</span><span class="n">text</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nl">stringWithFormat:</span><span class="s">@&quot;%g&quot;</span><span class="p">,</span> <span class="n">result</span><span class="p">];</span></div><div class='line' id='LC53'><span class="p">}</span></div><div class='line' id='LC54'><br/></div><div class='line' id='LC55'><span class="k">-</span> <span class="p">(</span><span class="kt">IBAction</span><span class="p">)</span><span class="nf">enterPressed</span> <span class="p">{</span></div><div class='line' id='LC56'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">calculator</span> <span class="nl">push:</span><span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">display</span><span class="p">.</span><span class="n">text</span> <span class="n">doubleValue</span><span class="p">]];</span></div><div class='line' id='LC57'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span><span class="p">.</span><span class="n">userIsEnteringANumber</span> <span class="o">=</span> <span class="n">NO</span><span class="p">;</span></div><div class='line' id='LC58'><span class="p">}</span></div><div class='line' id='LC59'><br/></div><div class='line' id='LC60'><span class="k">@end</span></div><div class='line' id='LC61'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2402660/f59991c85dd44dc4e4e198ddfa18956ab7784332/CalculatorViewController.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2402660#file_calculator_view_controller.m" style="float:right;margin-right:10px;color:#666">CalculatorViewController.m</a>
            <a href="https://gist.github.com/2402660">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This is the source file which contains the implementation details of the declarations in the header file. There really is a lot going on in both of these files that are needed to compile the view controller.</p>
<p>To be honest, at first glance I was really confused and it took me some time to understand the high level basics of the syntax and what it was doing. The @notation did not make sense. There are many keywords here that don’t translate directly to C#, or Java. I didn’t understand what the dash (-) in front of method declarations and implementations was for. What was the difference between the @interface structure in the header file and source file? I was really lost. The syntax was extremely foreign. Did you notice all the square brackets?</p>
<p>I will summarize what I can here, but really at this point I would recommend looking at a good Objective-C primer like the <a href="https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/_index.html">Learning Objective-C Primer</a> found the <a href="https://developer.apple.com/library/ios/navigation/">iOS Developer Library</a>. By the way, the documentation packaged with XCode 4 and the developer libraries found in the <a href="http://developer.apple.com/">Apple Developer Center</a> are your friends!</p>
<h2>Concepts in the Header File</h2>
<h3></h3>
<h3>#import</h3>
<p>The header file is small and concise and is not too hard to understand. The first think you should notice is the <em>#import</em> directive. This directive is similar to the <em>using</em> keyword in C#. It tells the compiler that you want to include code defined somewhere else in your header. In my header file, I am telling the compiler to include the UIKit header file where the interface of the UIViewController class is declared.</p>
<h3>@interface</h3>
<p>The @ symbol indicates a compiler directive. The interface directive is used to presents the class name (CalculatorViewController) and begins the declaration of the class interface. This should not be confused with the concept of an <em>interface</em> in C#.</p>
<p>It is my understanding that the declarations made in the header file are accessible to other header and source files when they are imported.  So in C# terms, you can think of these declarations to have the <em>public</em> visibility modifier applied to them.</p>
<h3>@property (weak, nonatomic)</h3>
<p>The property directive is a convenient way of declaring a property backed by an instance variable. The closest think I can think of is a the declaration of a property in a C# interface like this (even though it is a really far stretch):</p>
<div id="gist-2403022" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">interface</span> <span class="n">IMyObject</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Object</span> <span class="n">MyProperty</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;}</span></div><div class='line' id='LC4'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2403022/17c956130fa27930215387f55c4a664abe962b17/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2403022#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2403022">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The next thing are the custom options contained in the parenthesis. These options define how the accessor methods behave. If you want to find out more, check out the <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html#//apple_ref/doc/uid/TP30001163-CH17-SW14">declared properties documentation</a>.</p>
<h3>@end</h3>
<p>This directive is used to close other opening directives. In this case, it closes the <em>@interface</em> directive.</p>
<h2>Concepts in the Source File</h2>
<h3>#import</h3>
<p>Here we see the <em>#import</em> directive again. In this file we have two of them. The first is the header file for this source file. The second is the header for a Calculator class that is used in the controller.</p>
<h3>@interface</h3>
<p>Again we see the interface directive. This time it is followed by parenthesis. I have no clue what these are for yet. Again my understanding here is that the declarations in this interface block are only visible to my implementation in this source file (somebody please correct me if this assumption is incorrect). Nothing really new here besides those things I don’t quite get.</p>
<p>Within this interface I declare two more properties and introduce some more custom options. I suppose these would be how you declare private properties in C#. But again it is a really far stretch that is not an accurate translation.</p>
<h3></h3>
<h3>@implementation</h3>
<p>The implementation directive is similarly structured to the interface directive as it begins with the presentation of the class name. The difference is that this directive contains the implementation details of the class. It is closed with the <em>@end</em> directive at the bottom of the page.</p>
<h3>@synthesize</h3>
<p>The synthesize directive the implementation counterpart to the <em>@property</em> directive. This directive tells the compiler to generate the setter and getter methods for the property according to the custom options presented in the interface declaration. In addition, we can also specify the instance variable that backs the property.</p>
<h3>- (ReturnType)methodSignatureKeywords:(ParameterType)parameterName moreMethodSignatureKeywords:(ParameterType)parameterName</h3>
<p>What the heck is this? Tons of stuff going on here. What you have here is the pattern of a method prototype. It starts with a dash (-) or a plus (+). The dash makes it an instance method while the plus makes it a class method (or a static method). In the first parenthesis we present the return type. This is followed by the method name interlaced with parameter types and names. I found this very hard to read at first. But with a little practice you can get some really readable methods.</p>
<p>When declaring a method with in the context of the the <em>@interface</em> directive you would terminate it with a semicolon. By contrast, within the context of the <em>@implementation</em> directive it is followed by an open curly brace, the method body, and terminated with a closing curly brace.</p>
<p>For instance, take a look at this method:</p>
<div id="gist-2403099" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">-</span> <span class="p">(</span><span class="n">Calculator</span> <span class="o">*</span><span class="p">)</span> <span class="nf">calculator</span> <span class="p">{</span></div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">_calculator</span><span class="p">)</span> <span class="n">_calculator</span> <span class="o">=</span> <span class="p">[[</span><span class="n">Calculator</span> <span class="n">alloc</span><span class="p">]</span> <span class="n">init</span><span class="p">];</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">_calculator</span><span class="p">;</span></div><div class='line' id='LC4'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2403099/c4ccf4a1f3baddd0fec7409e47d6979d6b44b628/gistfile1.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2403099#file_gistfile1.m" style="float:right;margin-right:10px;color:#666">gistfile1.m</a>
            <a href="https://gist.github.com/2403099">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This method specifies the getter method for the <em>calculator</em> property. Yes, the compiler would have created a simple getter for the calculator property since I used the property and synthesize directives. But since I implemented the getter, the compiler will only generate the getter method. But moving on to talk about the method. Here I am declaring an instance method that returns pointer to a Calculator object. The method name is “calculator”. This is followed by curly braces that contain the method implementation details.</p>
<p>A loosely translated C# equivalent might look like this:</p>
<div id="gist-2403112" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="n">Calculator</span> <span class="n">Calculator</span> </div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">get</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">_calculator</span> <span class="p">==</span> <span class="k">null</span><span class="p">)</span> <span class="n">_calculator</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Calculator</span><span class="p">();</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">_calculator</span><span class="p">;</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">set</span><span class="p">;</span></div><div class='line' id='LC9'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2403112/1a3c2045f8f69cff739bb0cbe0cf1932a3102aa1/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2403112#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2403112">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>I added the auto setter in the translation to give you an idea of what the <em>@property</em> and <em>@synthesize</em> directives did for me in this source file.</p>
<p>Let’s look at one more method in the source file:</p>
<div id="gist-2403118" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">-</span> <span class="p">(</span><span class="kt">IBAction</span><span class="p">)</span><span class="nf">operandPressed:</span><span class="p">(</span><span class="n">UIButton</span> <span class="o">*</span><span class="p">)</span><span class="nv">sender</span> <span class="p">{</span></div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">userIsEnteringANumber</span><span class="p">)</span> <span class="p">[</span><span class="n">self</span> <span class="n">enterPressed</span><span class="p">];</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">double</span> <span class="n">result</span> <span class="o">=</span> <span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">calculator</span> <span class="nl">perform:</span><span class="n">sender</span><span class="p">.</span><span class="n">currentTitle</span><span class="p">];</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span><span class="p">.</span><span class="n">display</span><span class="p">.</span><span class="n">text</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nl">stringWithFormat:</span><span class="s">@&quot;%g&quot;</span><span class="p">,</span> <span class="n">result</span><span class="p">];</span></div><div class='line' id='LC5'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2403118/824dca162f62ac46dc9b525a9212203e9aca6713/gistfile1.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2403118#file_gistfile1.m" style="float:right;margin-right:10px;color:#666">gistfile1.m</a>
            <a href="https://gist.github.com/2403118">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This example method takes a single parameter. And may be loosely translated to C# like this:</p>
<div id="gist-2403174" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">void</span> <span class="nf">DigitPressed</span><span class="p">(</span><span class="n">UIButton</span> <span class="n">sender</span><span class="p">)</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kt">string</span> <span class="n">digit</span> <span class="p">=</span> <span class="n">sender</span><span class="p">.</span><span class="n">CurrentTitle</span><span class="p">;</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="n">UserIsEnteringANumber</span><span class="p">)</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="n">Display</span><span class="p">.</span><span class="n">Text</span> <span class="p">=</span> <span class="k">this</span><span class="p">.</span><span class="n">Display</span><span class="p">.</span><span class="n">Text</span> <span class="p">+</span> <span class="n">digit</span><span class="p">;</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="nf">if</span> <span class="p">(</span><span class="n">digit</span> <span class="p">==</span> <span class="s">@&quot;0&quot;</span><span class="p">)</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="n">Display</span><span class="p">.</span><span class="n">Text</span> <span class="p">=</span> <span class="n">digit</span><span class="p">;</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="n">UserIsEnteringANumber</span> <span class="p">=</span> <span class="k">true</span><span class="p">;</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC11'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2403174/280a2d7d557925cf1b8e42aad70bca15ff9d1b07/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2403174#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2403174">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>You will notice the return type here is void and that is because the IBAction return type is a constant in the UIKit that the compiler translates down to void. The constant is used for integration between XCode and the Interface Builder tools. I probably don’t have this right either, but it is my understanding at this time (again if I wrong please point it out to me).</p>
<h3>[targetObject methodSignatureKeywords:parameter moreMethodSignatureKeywords:parameter]</h3>
<p>I’m sure you are asking about these now. The brackets are another notation that just did not make sense to me until some discussion in the Stanford lecture discussed them and even then I had to do a little reading in the documentation. The bottom line is this is the syntax for sending a message to an object. You can also think about this notation invoking a method.</p>
<p>So there you have it… my first experience with Objective-C, Cocoa, and XCode. I have much more to learn, but I am really happy that I tried it out. It was fun working with something new. I am still curious about how refactoring will work and I am sure I will miss my <a href="http://www.jetbrains.com/resharper/">ReSharper</a> features (if I do get into this I will probably try <a href="http://www.jetbrains.com/objc/">AppCode</a>). I am also interested to investigate the unit testing options available.</p>
<p><strong>[Update 4/17/2012] </strong>The walkthrough for the iOS calculator is <a href="http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/assignments/Walkthrough%20iOS%205_0.pdf">available in PDF</a> on the <a href="http://www.stanford.edu/class/cs193p/cgi-bin/drupal/">Stanford Course web site</a>.</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/04/16/a-c-developers-adventures-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2012 Arthritis Walk Austin</title>
		<link>http://alonsorobles.com/2012/04/05/2012-arthritis-walk-austin/</link>
		<comments>http://alonsorobles.com/2012/04/05/2012-arthritis-walk-austin/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 01:39:33 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[Other Tidbits]]></category>
		<category><![CDATA[health]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=407</guid>
		<description><![CDATA[My family just registered a family and friends team, Team Robles, for the 2012 Arthritis Walk Austin event. This event has a special place in our heart as we have friends and family who live with arthritis including our son &#8230; <a href="http://alonsorobles.com/2012/04/05/2012-arthritis-walk-austin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My family just registered a family and friends team, <a href="http://austinarthritiswalk.kintera.org/teamrobles">Team Robles</a>, for the <a href="http://austinarthritiswalk.org/">2012 Arthritis Walk Austin</a> event. This event has a special place in our heart as we have friends and family who live with arthritis including our son who was diagnosed four years ago with polyarticular juvenile rheumatoid arthritis. At this time, we are looking for friends and family who would like to support us by either <a href="http://austinarthritiswalk.kintera.org/teamrobles">joining our team and/or making a donation</a> that will go to the <a href="http://www.arthritis.org/">Arthritis Foundation</a> via the <a href="http://lmt.arthritis.org/">Let’s Move Together</a> project.</p>
<p>Thanks in advance for all your support!</p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/04/05/2012-arthritis-walk-austin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RavenDB Document Identifiers and MVC Routes</title>
		<link>http://alonsorobles.com/2012/03/21/ravendb-document-identifiers-and-mvc-routes/</link>
		<comments>http://alonsorobles.com/2012/03/21/ravendb-document-identifiers-and-mvc-routes/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 11:38:39 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[.NET Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[RavenDB]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MVC 3]]></category>
		<category><![CDATA[ravendb]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=353</guid>
		<description><![CDATA[Following my recent post about getting started with RavenDB, I decided to work on a small shopping cart demo application based on the sample depot application that is written in part 2 of Agile Web Development with Rails when I &#8230; <a href="http://alonsorobles.com/2012/03/21/ravendb-document-identifiers-and-mvc-routes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Following my recent post about <a href="http://www.headspring.com/2012/03/getting-started-with-ravendb">getting started with RavenDB</a>, I decided to work on a small shopping cart demo application based on the sample depot application that is written in part 2 of <a href="http://www.amazon.com/gp/product/1934356549/ref=as_li_ss_tl?ie=UTF8&amp;tag=importchaos-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1934356549">Agile Web Development with Rails </a><img style="margin: 0px; border-style: none !important;" src="http://www.assoc-amazon.com/e/ir?t=importchaos-20&amp;l=as2&amp;o=1&amp;a=1934356549" alt="" width="1" height="1" border="0" /> when I started running into some trouble with the RavenDB auto generated document identifiers and the MVC routes. Like any other programmer, I quickly performed a Google search to see what others had done. The search led me to a few Stack Overflow well voted answers all leading me to <a href="http://weblogs.asp.net/shijuvarghese/archive/2010/06/04/how-to-work-ravendb-id-with-asp-net-mvc-routes.aspx">a blog post on this topic</a>. Problem solved right? Not exactly. Two solutions were proposed. But before getting into those, I want to describe the problem a little more.</p>
<h3>The Problem Described</h3>
<p>Take a look at the ASP.NET MVC 3 default route found in the <em>Global.asax.cs</em> file: <div id="gist-2136967" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">public</span> <span class="k">static</span> <span class="k">void</span> <span class="nf">RegisterRoutes</span><span class="p">(</span><span class="n">RouteCollection</span> <span class="n">routes</span><span class="p">)</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">routes</span><span class="p">.</span><span class="n">IgnoreRoute</span><span class="p">(</span><span class="s">&quot;{resource}.axd/{*pathInfo}&quot;</span><span class="p">);</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">routes</span><span class="p">.</span><span class="n">MapRoute</span><span class="p">(</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="s">&quot;Default&quot;</span><span class="p">,</span> <span class="c1">// Route name</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="s">&quot;{controller}/{action}/{id}&quot;</span><span class="p">,</span> <span class="c1">// URL with parameters</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">new</span> <span class="p">{</span> <span class="n">controller</span> <span class="p">=</span> <span class="s">&quot;Home&quot;</span><span class="p">,</span> <span class="n">action</span> <span class="p">=</span> <span class="s">&quot;Index&quot;</span><span class="p">,</span> <span class="n">id</span> <span class="p">=</span> <span class="n">UrlParameter</span><span class="p">.</span><span class="n">Optional</span> <span class="p">}</span> <span class="c1">// Parameter defaults</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">);</span></div><div class='line' id='LC10'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2136967/c084f7d16a710152ca01c1d4d6f643a98f703ea3/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2136967#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2136967">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
</p>
<p>This default route will basically allow you access to a resource using the basic URL convention that may look something this: <em>http://localhost/products/edit/1</em> . However, the default RavenDB auto generated document identifier for the product document ends up looking something like this: p<em>roducts/1</em>. (More information about the RavenDB <a href="http://ravendb.net/docs/client-api/basic-operations/saving-new-document">document identifiers one of the documentation pages</a>. ) So the URL to access that product resource for editing would really have to look like this: <em>http://localhost/products/edit/products/1</em>. Well that doesn’t work for two reasons:</p>
<ol>
<li>The default route will not be matched so the URL will not be routed the correct controller action.</li>
<li>The URL is not SEO friendly.</li>
</ol>
<p>Typically, this can be solved by using a custom route that access this resource by a natural key where the URL would probably end up looking like this: <em>http://localhost/products/product-name/edit</em>. This makes the URL SEO friendly, easy to read, and easy to route. However, there are some situations where the document identifier makes sense and I will continue this post on the assumption that this is the case.</p>
<p>The blog post mentioned above presents two solutions:</p>
<ul>
<li>Solution 1 – Change the identity parts separator convention for the RavenDB document store.</li>
<li>Solution 2 – Modify the ASP.NET default route</li>
</ul>
<h3>Issues with Solution 1</h3>
<p>Let’s look at the first solution. The suggestion is to change the identity separator convention from a slash (/) to a dash (-). The convention is really easy to change during the initialization of the document store object.</p>
<div id="gist-2137105" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="n">documentStore</span> <span class="p">=</span> <span class="k">new</span> <span class="n">DocumentStore</span> <span class="p">{</span> <span class="n">Url</span> <span class="p">=</span> <span class="s">&quot;http://localhost:8080/&quot;</span> <span class="p">};</span></div><div class='line' id='LC2'><span class="n">documentStore</span><span class="p">.</span><span class="n">Initialize</span><span class="p">();</span></div><div class='line' id='LC3'><span class="n">documentStore</span><span class="p">.</span><span class="n">Conventions</span><span class="p">.</span><span class="n">IdentityPartsSeparator</span> <span class="p">=</span> <span class="s">&quot;-&quot;</span><span class="p">;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2137105/c7f32ad41de8d44b30c10c8138edcb12215b3ad9/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2137105#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2137105">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This makes RavenDB generate document identifiers that now look like: <em>products-1</em>. Now we can generate a URL that will match the default route and may look like: <em>http://localhost/products/edit/products-1</em>. I still find some issues this this. Namely, the URL is still not really SEO friendly and not really human readable. I don’t like the idea of exposing an identifier that was forced on me by RavenDB since it essentially has coupled my URL to the RavenDB identifier convention. It just doesn’t feel right.</p>
<h3>Issues with Solution 2</h3>
<p>This solution suggests the change of the default route to something like:</p>
<div id="gist-2137442" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">public</span> <span class="k">static</span> <span class="k">void</span> <span class="nf">RegisterRoutes</span><span class="p">(</span><span class="n">RouteCollection</span> <span class="n">routes</span><span class="p">)</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">routes</span><span class="p">.</span><span class="n">IgnoreRoute</span><span class="p">(</span><span class="s">&quot;{resource}.axd/{*pathInfo}&quot;</span><span class="p">);</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">routes</span><span class="p">.</span><span class="n">MapRoute</span><span class="p">(</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="s">&quot;Default&quot;</span><span class="p">,</span> <span class="c1">// Route name</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="s">&quot;{controller}/{action}/{*id}&quot;</span><span class="p">,</span> <span class="c1">// URL with parameters</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">new</span> <span class="p">{</span> <span class="n">controller</span> <span class="p">=</span> <span class="s">&quot;Home&quot;</span><span class="p">,</span> <span class="n">action</span> <span class="p">=</span> <span class="s">&quot;Index&quot;</span><span class="p">,</span> <span class="n">id</span> <span class="p">=</span> <span class="n">UrlParameter</span><span class="p">.</span><span class="n">Optional</span> <span class="p">}</span> <span class="c1">// Parameter defaults</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">);</span></div><div class='line' id='LC10'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2137442/d2469600b573423dec4dbb7fd4e1153ac431fd34/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2137442#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2137442">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This will allow route to match a URL that looked like the first one: <em>http://localhost/products/edit/products/1</em>. I don’t like this either. While it does allow the default route to match and do its job. The URL is just ugly. It also clobbers the id making the route also match something like this: <em>http://localhost/products/edit/products/more-junk/1</em>. Obviously this is not SEO friendly or human readable. Again, it just doesn’t feel right.</p>
<h3>Another Option</h3>
<p>After some digging and learning about more about the document identity field, identity type converters, custom identifiers with the document key generator convention, I realized there was a pretty simple alternative to the two options above. But to see it and to understand the simplicity, you have to look at the source of the problem.</p>
<p>The reason that MVC routes are choking on the preconfigured RavenDB document identity convention is because our models included a string based identity property. I realized I had done this on purpose to ease the mapping of the RavenDB document identifier and my object identifier. Take a look at my product object definition:</p>
<div id="gist-2205818" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">public</span> <span class="k">class</span> <span class="nc">Product</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">Id</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">Title</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">Description</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">ImageUrl</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">decimal</span> <span class="n">Price</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC8'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2205818/f76935b0b33b0148ca2a67b57078be7a859b3c4f/Product.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2205818#file_product.cs" style="float:right;margin-right:10px;color:#666">Product.cs</a>
            <a href="https://gist.github.com/2205818">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The shopping cart identifier is a string. Why would it be a string? It could have been an integer or a Guid or something else. It could have even been a natural key of some sort. Or even a compound key. It doesn’t have to be a string. Taking another look at the  IDocumentSession interface we can see we have four load methods available.</p>
<div id="gist-2153059" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">namespace</span> <span class="nn">Raven.Client</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;<span class="k">public</span> <span class="k">interface</span> <span class="n">IDocumentSession</span> <span class="p">:</span> <span class="n">IDisposable</span></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ISyncAdvancedSessionOperation</span> <span class="n">Advanced</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">void</span> <span class="n">Delete</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="n">T</span> <span class="n">entity</span><span class="p">);</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">T</span> <span class="n">Load</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="kt">string</span> <span class="n">id</span><span class="p">);</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">T</span><span class="p">[]</span> <span class="n">Load</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="k">params</span> <span class="kt">string</span><span class="p">[]</span> <span class="n">ids</span><span class="p">);</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">T</span><span class="p">[]</span> <span class="n">Load</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="n">IEnumerable</span><span class="p">&lt;</span><span class="kt">string</span><span class="p">&gt;</span> <span class="n">ids</span><span class="p">);</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">T</span> <span class="n">Load</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="n">ValueType</span> <span class="n">id</span><span class="p">);</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IRavenQueryable</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;</span> <span class="n">Query</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="kt">string</span> <span class="n">indexName</span><span class="p">);</span></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IRavenQueryable</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;</span> <span class="n">Query</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;();</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IRavenQueryable</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;</span> <span class="n">Query</span><span class="p">&lt;</span><span class="n">T</span><span class="p">,</span> <span class="n">TIndexCreator</span><span class="p">&gt;()</span> <span class="k">where</span> <span class="n">TIndexCreator</span> <span class="p">:</span> <span class="n">AbstractIndexCreationTask</span><span class="p">,</span> <span class="k">new</span><span class="p">();</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ILoaderWithInclude</span><span class="p">&lt;</span><span class="kt">object</span><span class="p">&gt;</span> <span class="n">Include</span><span class="p">(</span><span class="kt">string</span> <span class="n">path</span><span class="p">);</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ILoaderWithInclude</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;</span> <span class="n">Include</span><span class="p">&lt;</span><span class="n">T</span><span class="p">&gt;(</span><span class="n">Expression</span><span class="p">&lt;</span><span class="n">Func</span><span class="p">&lt;</span><span class="n">T</span><span class="p">,</span> <span class="kt">object</span><span class="p">&gt;&gt;</span> <span class="n">path</span><span class="p">);</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">void</span> <span class="nf">SaveChanges</span><span class="p">();</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">void</span> <span class="nf">Store</span><span class="p">(</span><span class="kt">object</span> <span class="n">entity</span><span class="p">,</span> <span class="n">Guid</span> <span class="n">etag</span><span class="p">);</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">void</span> <span class="nf">Store</span><span class="p">(</span><span class="kt">object</span> <span class="n">entity</span><span class="p">,</span> <span class="n">Guid</span> <span class="n">etag</span><span class="p">,</span> <span class="kt">string</span> <span class="n">id</span><span class="p">);</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">void</span> <span class="nf">Store</span><span class="p">(</span><span class="kt">object</span> <span class="n">entity</span><span class="p">);</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">void</span> <span class="nf">Store</span><span class="p">(</span><span class="kt">object</span> <span class="n">entity</span><span class="p">,</span> <span class="kt">string</span> <span class="n">id</span><span class="p">);</span></div><div class='line' id='LC21'>&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC22'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2153059/64fbb98ab03ac0e3fc1f07fb5f07d4851a1c7e5c/gistfile1.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2153059#file_gistfile1.cs" style="float:right;margin-right:10px;color:#666">gistfile1.cs</a>
            <a href="https://gist.github.com/2153059">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>After thinking about the difference between the method that accepts a string identifier and the one that accepts a value type identifier, I realized that all I had to do was change my identifier type from a string to a value type and I’m done. No fancy mapping or parsing the document identifier from RavenDB to the web browser and back. No changes to the default MVC route. No changes to the default identity separator convention. It just worked. My URLs are SEO friendly and more readable.</p>
<p>All I had to do was change the object identifier type.</p>
<div id="gist-2205829" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">public</span> <span class="k">class</span> <span class="nc">Product</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">int</span> <span class="n">Id</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">Title</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">Description</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">string</span> <span class="n">ImageUrl</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="kt">decimal</span> <span class="n">Price</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class='line' id='LC8'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2205829/dec0f6ca4b6fc6c058955333b789496725191f02/Product.cs" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2205829#file_product.cs" style="float:right;margin-right:10px;color:#666">Product.cs</a>
            <a href="https://gist.github.com/2205829">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>That was easy.</p>
<p>Of course this doesn’t solve everything. What if I really do need a string based identifier? This will probably require tweaking the behavior of the RavenDB client. I also don’t have an answer for compound keys and other natural keys which may not be a value type. Some of these may require more thought from both the RavenDB side and the MVC side of my project. But that is another problem to think about some other time.</p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/03/21/ravendb-document-identifiers-and-mvc-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TODO: When Creating a New ASP.NET MVC Project</title>
		<link>http://alonsorobles.com/2012/03/20/todo-when-creating-a-new-asp-net-mvc-project/</link>
		<comments>http://alonsorobles.com/2012/03/20/todo-when-creating-a-new-asp-net-mvc-project/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 14:30:00 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MVC 3]]></category>
		<category><![CDATA[TODO]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=346</guid>
		<description><![CDATA[Michael Kennedy put this great little blog post together outlining 9 things we can do when starting a new ASP.NET MVC 3 project. It’s a good starting point since the MVC 3 web application template is already out of date &#8230; <a href="http://alonsorobles.com/2012/03/20/todo-when-creating-a-new-asp-net-mvc-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Michael Kennedy put this great little blog post together outlining <a href="http://blog.michaelckennedy.net/2012/03/07/9-ways-your-brand-new-mvc-project-can-be-better/">9 things we can do when starting a new ASP.NET MVC 3 project</a>. It’s a good starting point since the MVC 3 web application template is already out of date with many things. Here is a quick run down of the things I do and don’t in comparison to his list:</p>
<ol>
<li>Remove the <em>MicrosoftMvc*.js</em> AJAX and validation scripts.</li>
<li>Update NuGet packages… I do things a little differently here. I completely remove the <em>EntityFramework</em> package (I may add it or another ORM back in later, but that ends up usually in a persistence specific project and it is usually a micro ORM). I also remove <em>jQuery Visual Studio 2010 Intellisense</em> package since the contents are bundled with the updated the other jQuery packages anyway. I remove the <em>jQuery UI</em> package (and add it back when I need it). Update the remaining jQuery and Modernizr packages.</li>
<li>Create my own <em>JavaScripts</em> directory to avoid overwrites when updating or installing other JavaScript based packages.</li>
<li>Love this tip! Who doesn’t like intellisense?</li>
<li>Already did this in step 2.</li>
<li>I’m not the sharpest tool in the shed when it comes to CSS. But this tip sounds like a good idea. Wonder if there is a NuGet package for Eric Meyer’s <em>reset.css</em> file?</li>
<li>I skip this step. In my opinion, the only models in my MVC project are view models anyway. So I leave the <em>Models</em> folder in my MVC project alone. If my project requires business models, they get placed in a business logic project. If I have persistence models, they get placed in my persistence project.</li>
<li>Another area where I am not the sharpest tool in the shed. But I do like fast loading pages, so I am going to try this tip out and put all the JavaScript files that I can at the bottom. Just remember that some do need to go at the top.</li>
<li>And yet another tip that I haven’t tried, but plan.</li>
</ol>
<p>As a recap, tips 1, 3, and 4 make perfect sense. Tip 2 also makes sense, but I tweak it to fit my needs and I suggest you do to. I glaze over tip 5 and skip tip 7 because it was either previously addressed or doesn’t fit my needs. Tips 6, 8, and 9 sound like good ideas and I need to try them out.</p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/03/20/todo-when-creating-a-new-asp-net-mvc-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Couple of eBooks From Los Techies</title>
		<link>http://alonsorobles.com/2012/03/19/couple-of-ebooks-from-los-techies/</link>
		<comments>http://alonsorobles.com/2012/03/19/couple-of-ebooks-from-los-techies/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 14:30:19 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[Other Tidbits]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[solid]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=342</guid>
		<description><![CDATA[Los Techies is a blog maintained by a number of contributors who share and discuss various technical ideas. I happen to have met a few of the folks who contribute there and they seem like pretty okay people. At any &#8230; <a href="http://alonsorobles.com/2012/03/19/couple-of-ebooks-from-los-techies/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://lostechies.com/">Los Techies</a> is a blog maintained by a number of contributors who share and discuss various technical ideas. I happen to have met a few of the folks who contribute there and they seem like pretty okay people.</p>
<p>At any rate, I was perusing some blog posts there this morning when I came across a <a href="http://lostechies.com/e-books/">couple of e-books</a> they have. One talks about the <a href="http://lostechies.com/wp-content/uploads/2011/03/pablos_solid_ebook.pdf">SOLID principles</a> and the other discusses <a href="http://lostechies.com/wp-content/uploads/2011/03/31DaysRefactoring.pdf">refactoring</a>. Both are important skills to be familiar with as a programmer. I personally like to read various sources on both of these topics when I get a chance since I like to continuously improve those skill sets. I encourage you to do the same. </p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/03/19/couple-of-ebooks-from-los-techies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Few Web Development Resources</title>
		<link>http://alonsorobles.com/2012/03/15/a-few-web-development-resources/</link>
		<comments>http://alonsorobles.com/2012/03/15/a-few-web-development-resources/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 15:30:04 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=340</guid>
		<description><![CDATA[This morning at work, I walked past Tim Thomas&#8217; desk and noticed he was doing some fancy wire framing with Balsamiq. On his other monitor, I saw the development version of the wire frame implementation and was impressed with the &#8230; <a href="http://alonsorobles.com/2012/03/15/a-few-web-development-resources/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This morning at work, I walked past <a href="http://www.timgthomas.com/">Tim Thomas&#8217;</a> desk and noticed he was doing some fancy wire framing with <a href="http://www.balsamiq.com/">Balsamiq</a>. On his other monitor, I saw the development version of the wire frame implementation and was impressed with the look and feel. More specifically, the smoothness of the user interface and how nicely the colors fit together. He quickly pointed me at some resources he uses to do make this magic happen. Here they are:</p>
<ul>
<li><a href="http://nerdi.net/">Nerdi</a> - A collection of web development resources. From toolkits, to frameworks, to documentation, and all sorts of goodness.</li>
<li><a href="http://fortawesome.github.com/Font-Awesome/">Font Awesome</a> - An iconic font.</li>
<li><a href="http://kuler.adobe.com/">kuler</a> - A color scheme generator.</li>
</ul>
<p>More stuff for me to play with. It&#8217;s times like these I wish I had a more innate ability to work with colors and design. It reminds me of the time I attempted to use <a href="http://colorschemedesigner.com/">another color scheme generator</a> and quickly learned that the tool alone would not help my bad design. It only color coordinated it.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/03/15/a-few-web-development-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joining Headspring</title>
		<link>http://alonsorobles.com/2012/03/14/joining-headspring/</link>
		<comments>http://alonsorobles.com/2012/03/14/joining-headspring/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 17:12:25 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[Other Tidbits]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=336</guid>
		<description><![CDATA[In December, I accepted an employment offer from Headspring and began a new chapter in my career. Honestly, I was not planning on blogging about this change. I even took down the “about me” page on this blog because it &#8230; <a href="http://alonsorobles.com/2012/03/14/joining-headspring/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In December, I accepted an employment offer from <a href="http://www.headspring.com/">Headspring</a> and began a new chapter in my career. Honestly, I was not planning on blogging about this change. I even took down the “about me” page on this blog because it was out of date and I didn’t feel like updating it. However, this experience has been and continues to be amazing. Let me tell you why.</p>
<p>As I started my employment, I learned about their core values and was intrigued by the operational transparency. I was skeptical. My life experiences had taught me that core values were ideals which were just printed on paper and available on internal and external company websites. I had also heard the buzz of transparent management but never saw it practiced. Over the past three months, my skepticism has been erased. </p>
<p>Today, I believe in what I do. I am proud of how I do it. There is a different vibe here that I haven’t experienced before. I am surrounded by folks who are driven by a common belief of finding a better way to do business, a better way to build software, and a better way to run a company. </p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/03/14/joining-headspring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NoSQL, Big Data, Polyglot Persistence&#8230; A New Era</title>
		<link>http://alonsorobles.com/2012/01/10/nosql-big-data-polyglot-persistence-a-new-era/</link>
		<comments>http://alonsorobles.com/2012/01/10/nosql-big-data-polyglot-persistence-a-new-era/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 20:00:24 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[big data]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[polyglot persistence]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=328</guid>
		<description><![CDATA[I have recently stumbled on a couple posts from Martin Fowler related to a NoSQL Distilled joint book authoring effort. The book announcement excites me as I am looking forward to reading it for a several reasons. Primarily because I have &#8230; <a href="http://alonsorobles.com/2012/01/10/nosql-big-data-polyglot-persistence-a-new-era/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>I have recently stumbled on a couple posts from <a href="http://martinfowler.com">Martin Fowler</a> related to a <a href="http://martinfowler.com/bliki/NosqlDistilled.html">NoSQL Distilled</a> joint book authoring effort. The book announcement excites me as I am looking forward to reading it for a several reasons. Primarily because I have been like a overindulged my inner geek this past year &#8211; playing and getting a taste of what I call modern persistence systems. Learning and thinking about <a href="http://www.julianbrowne.com/article/viewer/brewers-cap-theorem">Brewer&#8217;s CAP theorem</a> and its implications while setting up and trying a few things out with <a href="http://cassandra.apache.org/">Cassandra</a> and <a href="http://hbase.apache.org/">Hbase</a> has been very fun to say the least. However, one thing has bothered me&#8230; what do we call this new era of persistence methods?</div>
<div></div>
<div>Today, I came across <a href="http://martinfowler.com/bliki/NosqlDefinition.html">another post from Fowler</a> where he discussed the term &#8220;<a href="http://en.wikipedia.org/wiki/Nosql">NoSQL</a>&#8220;, what it means in today&#8217;s persistence movements, and how he will be using it in his new book. This made me think about all the terms I have heard recently other than NoSQL. Here are a few others:</div>
<ul>
<li><a href="http://martinfowler.com/bliki/PolyglotPersistence.html">Polyglot Persistence</a> &#8211; Another term I learned from reading Flower&#8217;s Bliki at least six months ago or more.</li>
<li><a href="http://en.wikipedia.org/wiki/Big_data">Big Data</a> - Which is typically used to describe the problem of large data sets which cannot typically be accommodated by today&#8217;s traditional relational database systems due to cost, performance, and/or other operational concerns.</li>
</ul>
<p>Another interesting discussion point, is the interest in other data store models some of which academic circles have previously explored. The recent interest, in my opinion is probably due to the changes in computers and networks since the time when the RDBMS became the preferred standard for data persistence many years ago. <a href="http://ayende.com">Ayende Rahien</a> talks about this on <a href="http://ayende.com/blog/152707/embracing-ravendb">a blog post</a>. Some of different store models available (or in development) current NoSQL systems include:</p>
<ul>
<li>Document oriented stores (<a href="http://couchdb.apache.org/">CouchDB</a>, <a href="http://aws.amazon.com/simpledb/">SimpleDB</a>, <a href="http://ravendb.net/">RavenDB</a>, <a href="http://wiki.basho.com/Riak.html">Riak</a>)</li>
<li>Key-Value stores (<a href="http://redis.io/">Redis</a>, <a href="http://project-voldemort.com/">Voldemort</a>)</li>
<li>Tabular or Column oriented stores (<a href="http://cassandra.apache.org/">Cassandra</a>, <a href="http://hbase.apache.org/">Hbase</a>)</li>
</ul>
<p>There are many more discussions taking place in today challenging how we think about persistence. Even traditional physical persistence mechanism is in question. A few years ago the idea of using anything other than a hard disk or a SAN for persistent storage would have been absurd. However, a physically distributed in-memory non-relational database is a viable option (most likely this option will be geographically distributed).  Other topics of discussion include:</p>
<ul>
<li>Clustering techniques</li>
<li>Distributed systems</li>
</ul>
<p>Truth is I don&#8217;t know what to call this current persistence movement. To me it seems obvious that terms like &#8220;NoSQL&#8221;, &#8220;Big data&#8221;, and even &#8220;Polyglot Persistence&#8221; are insufficient. We are definitely now in a different era  where a new persistence paradigm has begun. The relational database management systems no longer the only option. While those systems continue to have their place in today&#8217;s computing era, their market share is starting to shrink. Relational databases may even evolve to take advantage of the advancements made in this area.</p>
<p>The development, discussion, and research of new persistence solutions is happening now! Challenges issued to older traditional persistence systems are inspiring the revitalization, evolution, and enhancement of the existing software. Some of the old and new will survive, a few will thrive, and many will die. These are exciting times!</p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2012/01/10/nosql-big-data-polyglot-persistence-a-new-era/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Clean Coder</title>
		<link>http://alonsorobles.com/2011/11/28/the-clean-coder/</link>
		<comments>http://alonsorobles.com/2011/11/28/the-clean-coder/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 18:08:43 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=324</guid>
		<description><![CDATA[I love long breaks from work! Don&#8217;t get me wrong, I also love being a software developer and I am very passionate about creating software. However, long breaks give me an opportunity to spend more time exploring technologies which I &#8230; <a href="http://alonsorobles.com/2011/11/28/the-clean-coder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 123px"><a href="http://www.amazon.com/gp/product/0137081073/ref=as_li_ss_il?ie=UTF8&amp;tag=importchaos-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0137081073"><img style="border-style: initial; border-color: initial; border-width: 0px;" title="The Clean Coder" src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;Format=_SL160_&amp;ASIN=0137081073&amp;MarketPlace=US&amp;ID=AsinImage&amp;WS=1&amp;tag=importchaos-20&amp;ServiceVersion=20070822" alt="The Clean Coder: A Code of Conduct for Professional Programmers" width="123" height="160" border="0" /></a><p class="wp-caption-text">The Clean Coder</p></div>
<p><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=importchaos-20&amp;l=as2&amp;o=1&amp;a=0137081073&amp;camp=217145&amp;creative=399373" alt="" width="1" height="1" border="0" /></p>
<p>I love long breaks from work! Don&#8217;t get me wrong, I also love being a software developer and I am very passionate about creating software. However, long breaks give me an opportunity to spend more time exploring technologies which I don&#8217;t use day-to-day at my current job. Long breaks also offer a chance to read a little more than usual. This Thanksgiving break was no different. When I wasn&#8217;t preoccupied with the family and other holiday activities, I sat down and read <a href="https://twitter.com/unclebobmartin">Uncle Bob&#8217;s</a> <a href="http://www.amazon.com/gp/product/0137081073/ref=as_li_ss_tl?ie=UTF8&amp;tag=importchaos-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0137081073">The Clean Coder: A Code of Conduct for Professional Programmers</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=importchaos-20&amp;l=as2&amp;o=1&amp;a=0137081073&amp;camp=217145&amp;creative=399373" alt="" width="1" height="1" border="0" />.</p>
<p>It really was refreshing reading another person&#8217;s thoughts on what makes a software programmer a professional. In many ways, this topic is tough as it is very subjective. Several published books tackle the topic of software craftsmanship, but not many really dive into professionalism. Throughout the chapters, there is discussion about responsible communication, estimation, and making commitments. Important topics such as practicing, learning, and personal commitments for self-improvement are also covered. Overall, the book is pleasing and easy to read as the author shares plenty of his life experience to illustrate his points.</p>
<p>I think there are some areas where the book falls short. For example, the chapter of estimation discusses our responsibility to communicate honest estimates and suggests including confidence factors to allow the product folk and project managers to do their duties. However, you won&#8217;t find detailed discourse on estimation techniques. In the books defense, it is not a book about estimation techniques and perhaps detailed discourse on such techniques is out of scope. In my opinion, the author would have overcome this by including more references to material where the reader can acquire or develop those skills.</p>
<p>On the other hand, other chapters (like the one on practicing) did give enough reference material to satisfy my wish for more information. I also found the Appendix filled with lots of goodies to help expand your exposure to reading material and tools.</p>
<p>Bottom line &#8211; I recommend this book to any software programmer who is passionate about self-improvement in the professional sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2011/11/28/the-clean-coder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geek Video: Building a Scalable Geospatial Database on top of Apache Cassandra</title>
		<link>http://alonsorobles.com/2011/08/19/geek-video-building-a-scalable-geospatial-database-on-top-of-apache-cassandra/</link>
		<comments>http://alonsorobles.com/2011/08/19/geek-video-building-a-scalable-geospatial-database-on-top-of-apache-cassandra/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 17:14:15 +0000</pubDate>
		<dc:creator>Alonso Robles</dc:creator>
				<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[big data]]></category>
		<category><![CDATA[cassandra]]></category>

		<guid isPermaLink="false">http://alonsorobles.com/?p=316</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe width="640" height="510" src="http://www.youtube.com/embed/7J61pPG9j90" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://alonsorobles.com/2011/08/19/geek-video-building-a-scalable-geospatial-database-on-top-of-apache-cassandra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

