<?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>Brian Genisio&#039;s House of Bilz</title>
	<atom:link href="http://houseofbilz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://houseofbilz.com</link>
	<description>Func&#60;E&#62; Thoughts on Software</description>
	<lastBuildDate>Sat, 20 Apr 2013 23:47:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>There and Back Again &#8212; Thoughts on SPAs</title>
		<link>http://houseofbilz.com/archives/2013/04/17/there-and-back-again-thoughts-on-spas/</link>
		<comments>http://houseofbilz.com/archives/2013/04/17/there-and-back-again-thoughts-on-spas/#comments</comments>
		<pubDate>Wed, 17 Apr 2013 14:27:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=438</guid>
		<description><![CDATA[I&#8217;ve been doing this software thing for quite a while now. My first software job was in web development back in 1998. Since then, I&#8217;ve traveled through Simulation Systems, Embedded Systems, Tooling, Desktop Applications, Rich Internet Applications (RIA), some mobile and today I am back where I started, developing Web Applications. Productivity Highs with RIA [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing this software thing for quite a while now.  My first software job was in web development back in 1998.  Since then, I&#8217;ve traveled through Simulation Systems, Embedded Systems, Tooling, Desktop Applications, Rich Internet Applications (RIA), some mobile and today I am back where I started, developing Web Applications.</p>
<h3>Productivity Highs with RIA Frameworks</h3>
<p>After traveling out and back, I see everything from a different perspective.  Web applications, today, are incredibly different from the way they were in the 90s.  The biggest difference, from my perspective, is the way we develop them.  Coming from the RIA perspective, using Silverlight and Flex, I am accustomed to a certain productivity that I pine for now that I am developing for the web again.</p>
<p>If you know me, you know that I was a big fan of Silverlight and Flex.  They were frameworks which let me develop amazing desktop experiences in the browser.  I was doing things in 2007 that to this day is still impossible to do with HTML5 today.  Those frameworks had one flaw, however.  They required plug-ins to run.</p>
<h3>Death to the Plug-In</h3>
<p>I&#8217;ve never been much of an apologist for plug-ins. I saw them as a necessary evil.  An evil that became unsustainable in this brave new world of mobile computing.  When Apple, Microsoft and Adobe killed Silverlight and Flex, I wasn&#8217;t sad because I loved those platforms.  I was sad because I knew I couldn&#8217;t be as productive writing the same kinds of applications in HTML/JavaScript/CSS.</p>
<h3>First Generation SPA Frameworks</h3>
<p>This is where the Single-Paged Application (SPA) frameworks came to my aid.  There are too many to count, but from my vantage point, it has felt like Backbone.js and Knockout.js have been the primary options in the SPA market.    I landed on Backbone.js as my go-to choice because it was a more complete solution than Knockout.js with its client-side route handling and model synchronization.  I found myself at home with building SPAs because they were so similar to RIAs.</p>
<p>Unfortunately, my productivity never came close to that of the plug-in frameworks.  Backbone.js and Knockout.js simply aren&#8217;t high enough of an abstraction for them to provide the same abilities to me.  They are the first generation of SPA tools and with that brings the pains of a first-generation technology.</p>
<h3>Filling in the Gaps</h3>
<p>We&#8217;re starting to see some pretty nice add-ons to our first-generation tools.  These add-ons fill the gaps that the frameworks leave by attempting to make you more productive.  Specifically, Backbone.js has a poor view abstraction, making things like collection views and deeply nested views difficult.  Marionette.js builds upon Backbone.js to provide more structure, guidance and capabilities.  Using Marionette.js boosted my productivity significantly by taking care of much of the boiler-plate code that I found myself writing with Backbone.js alone.  It is still not ideal, mostly because the abstractions are not extremely strong.  They are strongER, but nothing compared to the capabilities I pine for.  Knockout.js has a similar packaging called Hot Towel.  Hot Towel fills in the holes that Knockout.js left by providing model synchronization, route handling and child view handling.</p>
<p>Unfortunately, these approaches only take us as far as the base technologies allow us to.  Without a strong abstraction to begin with, these add-ons can only ever takes us to generation 1.5.</p>
<h3>Second Generation SPA Frameworks</h3>
<p>At the same time, the second generation of the SPA frameworks are coming forward.  They come from a higher level of abstraction and the code you write demonstrates it by being significantly less (half or less).  These frameworks (Angular.js and Ember.js) provide everything we wanted from our first generation tools but they also bring more capabilities like convention-based development paradigms and dependency injection.  What&#8217;s more, we are starting to see tooling (such as Batarang) built around these abstractions which let our development lifecycle be that much smoother.</p>
<p>I am focusing my efforts on these second-generation tool sets for now.  I am not abandoning my Backbone.js/Marionette.js tools completely, but I am not planning to invest much more time in them.  Instead of patching the holes that the first generation tools created, I am choosing to spend my time using (and recommending) the next generation of tools.  Specifically, I am focusing my efforts on Angular.js.  It fits my development style better and I feel like the abstractions make more sense to me.  I&#8217;m not knocking on Ember.js in any way.  It is a fine choice, in my opinion.</p>
<h3>The Future of SPA Development</h3>
<p>But this isn&#8217;t where we are settling.  I think it will require a third generation of tools before the SPA space really takes off.  I have no idea what these frameworks will be, but I expect they will approach the productivity that I grew accustomed to with Silverlight and Flex.  The levels of abstractions will be higher and the tooling will be richer.  I expect that we will start to approach similar developer/designer workflows that were so amazing in the SPA days.  I expect we will see multiple language integration, including debugging and profiling tools built around these frameworks.  They will feel much less like a web framework and more like a desktop development framework.  The user experiences we create will be comparable to the experiences we created with Flex and Silverlight.</p>
<h3>Paying Back the Debt</h3>
<p>The funny thing is that we will have taken 5 years to get there.  It will be 5 years of stepping out of the plug-ins and into the browser so that we can achieve the same quality of application that we were already producing.  In some ways, it feels like a regression, but we have to realize that the plug-ins were really just a disguised form of technical debt.  They provided a one-off environment so that we were able to do things that weren&#8217;t possible in the browser, but they did so by not investing in the browser.  Ultimately, the browser is the platform we were headed towards so we incurred debt.  We just have to pay it off before we can really innovate again.</p>
<h3>Conclusion</h3>
<p>I&#8217;m excited to see where the future of front-end development goes.  I&#8217;m excited to see that great strides are being made and I am happy to be at the front of the wave.  The community is starting to get excited too.  Here in Ann Arbor, we will be kicking off a JavaScript user group very soon which will give us a place to discuss these technologies and approaches.  I look forward to chatting it up!</p>
<h3>On a personal note</h3>
<p>This is my last blog post written for SRT Solutions.  I am moving on to something new.  More on that soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2013/04/17/there-and-back-again-thoughts-on-spas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Choose Your Own Application</title>
		<link>http://houseofbilz.com/archives/2013/02/05/choose-your-own-application/</link>
		<comments>http://houseofbilz.com/archives/2013/02/05/choose-your-own-application/#comments</comments>
		<pubDate>Tue, 05 Feb 2013 11:31:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=422</guid>
		<description><![CDATA[It has been a while since I&#8217;ve posted. I&#8217;ve been neck-deep in Single-Page Application work for the past year and haven&#8217;t had much time to come up for air. I wanted to show what my latest side project is. Choose Your Own Application is a tutorial site for learning Single-Page Application stacks. We help you [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a while since I&#8217;ve posted.  I&#8217;ve been neck-deep in Single-Page Application work for the past year and haven&#8217;t had much time to come up for air.  I wanted to show what my latest side project is.  <a href="http://chooseyourownapplication.com">Choose Your Own Application</a> is a tutorial site for learning Single-Page Application stacks.  We help you build an application using your choice of technology.  You get to make choices as you go and you earn achievements as you try different things.  It is a ton of fun!</p>
<p>Dennis Burton and I worked on this with several other SRT colleagues and we are very proud of it.  We presented it as a half-day CodeMash session last month and the room was overflowing with over 100 participants, all heads-down and hacking out code. Since then, we&#8217;ve picked up another 300 or so users who have gone through the 22 different possible paths in the site.</p>
<p><center><a href="http://chooseyourownapplication.com"><img width="500" src="https://s3.amazonaws.com/chooseyourownapp/Splash_Graphic_Launch.gif" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2013/02/05/choose-your-own-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hosting the Todos example on Heroku</title>
		<link>http://houseofbilz.com/archives/2011/11/30/hosting-the-todos-example-on-heroku/</link>
		<comments>http://houseofbilz.com/archives/2011/11/30/hosting-the-todos-example-on-heroku/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 20:40:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=407</guid>
		<description><![CDATA[Series Overview &#60;&#60; An Example Backbone/Parse.com App The Todos example was extremely easy to get up and running with Heroku.&#160; Even though this is a CoffeeScript based server running with Node.js, Heroku can support the application.&#160; I won’t go over the install process for the pre-requisites (Git and Heroku) because it is easy to find [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/">Series Overview</a></p>
<p><a href="http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/">&lt;&lt; An Example Backbone/Parse.com App</a></p>
<p>The Todos example was extremely easy to get up and running with Heroku.&#160; Even though this is a CoffeeScript based server running with Node.js, Heroku can support the application.&#160; I won’t go over the install process for the pre-requisites (Git and Heroku) because it is easy to <a href="http://www.jamesward.com/2011/06/21/getting-started-with-node-js-on-the-cloud/">find on the web</a>.&#160; Assuming they are installed, deploy the app like this:</p>
<h3>Pull down the Todos example</h3>
<p> 
<p><font size="3" face="Courier New"><strong>&gt; git clone git@github.com:BrianGenisio/todos-parseback.git</strong></font></p>
<h3>Create the Heroku app</h3>
<p> 
<p><font face="Courier New"><font size="3"><strong>&gt; heroku create -s cedar yourappname          <br /></strong></font><font color="#333333">Creating yourappname&#8230; done, stack is cedar        <br /></font></font><font color="#333333" face="Courier New">http://yourappname.herokuapp.com/</font><font color="#333333" face="Courier New"> | git@heroku.com:yourappname.git      <br />Git remote heroku added</font></p>
<h3>Create file: package.json</h3>
<p> 
<pre class="brush: js; ruler: true; toolbar: false; smart-tabs: false;">{
  &quot;name&quot;: &quot;yourappname&quot;,
  &quot;version&quot;: &quot;0.0.1&quot;,
  &quot;dependencies&quot;: {
    &quot;express&quot;: &quot;2.5.0&quot;,
    &quot;coffee-script&quot;: &quot;1.1.3&quot;,
    &quot;restler&quot;: &quot;0.2.1&quot;
  }
}</pre>
<h3>Install the packages locally (for testing)</h3>
<p></p>
<p><font size="3" face="Courier New"><strong>&gt; npm install</strong></font></p>
<h3>Configure and test the app</h3>
<p></p>
<p><font size="3" face="Courier New"><strong>&gt; cp config.coffee.example config.coffee</strong></font></p>
<p>Edit <strong>config.coffee</strong> per the steps in the previous article and run it:</p>
<p><font size="3"><strong>&gt; coffee proxy.coffee</strong></font></p>
<p>Point your browser to <a href="http://localhost:3001">http://localhost:3001</a> and play.&#160; Everything should be working right now locally.&#160; Next, lets get it up on Heroku.</p>
<h3>Create file: run.js</h3>
<p></p>
<pre class="brush: coffeescript; ruler: true; toolbar: false; smart-tabs: false;"># Necessary because Heroku can’t run CoffeeScript directly
require(&quot;coffee-script&quot;);
require(&quot;./proxy.coffee&quot;);</pre>
<h3>Create file: Procfile</h3>
<p><font face="Courier New">web: node run.js</font></p>
<h3>Deploy to Heroku (via git)</h3>
<p></p>
<p><font face="Courier New"><strong><font size="3">&gt; git add .<br />
        <br />&gt; git commit -m &quot;Adding Heroku files&quot;</p>
<p></font></strong><font color="#333333" size="2">[master 0154577] Adding Heroku files<br />
      <br /> 3 files changed, 12 insertions(+), 0 deletions(-)</p>
<p> create mode 100644 Procfile</p>
<p> create mode 100644 package.json</p>
<p> create mode 100644 run.js</font></font></p>
<p><font face="Courier New"><strong><font size="3">&gt; git push heroku master<br />
        <br /></font></strong><font color="#333333">Counting objects: 23, done.<br />
      <br />Delta compression using up to 4 threads.</p>
<p>Compressing objects: 100% (21/21), done.</p>
<p>Writing objects: 100% (23/23), 102.20 KiB, done.</p>
<p>Total 23 (delta 1), reused 17 (delta 0)</font></font></p>
<p><font color="#333333" face="Courier New">&#8212;&#8211;&gt; Heroku receiving push<br />
    <br />&#8212;&#8211;&gt; Node.js app detected</p>
<p>&#8212;&#8211;&gt; Fetching Node.js binaries</p>
<p>&#8212;&#8211;&gt; Vendoring node 0.4.7</p>
<p>&#8212;&#8211;&gt; Installing dependencies with npm 1.0.94</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; restler@0.2.1 ./node_modules/restler </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; coffee-script@1.1.3 ./node_modules/coffee-script </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; express@2.5.0 ./node_modules/express </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; ├── mkdirp@0.0.7</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; ├── mime@1.2.4</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; ├── qs@0.3.2</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; └── connect@1.7.3</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; Dependencies installed</p>
<p>&#8212;&#8211;&gt; Discovering process types</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; Procfile declares types -&gt; web</p>
<p>&#8212;&#8211;&gt; Compiled slug size is 3.4MB</p>
<p>&#8212;&#8211;&gt; Launching&#8230; done, v4</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; </font><a href="http://yourappname.herokuapp.com"><font color="#333333" face="Courier New">http://yourappname.herokuapp.com</font></a><font color="#333333" face="Courier New"> deployed to Heroku</font></p>
<p><font color="#333333" face="Courier New">To git@heroku.com:yourappname.git<br />
    <br /> * [new branch]&#160;&#160;&#160;&#160;&#160; master –&gt; master</font></p>
<h3>Try it out</h3>
<p></p>
<p><font face="Courier New"><font size="3"><strong>&gt; heroku open<br />
        <br /></strong></font><font color="#333333">Opening </font></font><a href="http://yourappname.herokuapp.com/"><font color="#333333" face="Courier New">http://yourappname.herokuapp.com/</font></a></p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/f0dd85a2-2d24-43c6-bb73-1319e835105a/2011-11-30_14-22-43.png" width="345" height="450" /></p>
<h3>That’s it!</h3>
<p></p>
<p>Seriously.&#160; That was easy.&#160; Now the app is hosted.&#160; Heroku and Parse.com do all the dirty work for you.</p>
<p><font color="#333333" face="Courier New"><br />
    <br /></font></p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/11/30/hosting-the-todos-example-on-heroku/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>An Example Backbone/Parse.com App</title>
		<link>http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/</link>
		<comments>http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 20:02:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Parse.com]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=396</guid>
		<description><![CDATA[Series Overview &#60;&#60; Working with Backbone.js and the Parse.com Proxy&#160;&#160;&#160;&#160;Hosting the Todos example on Heroku &#62;&#62; This is the post where I put it all together.&#160; I showed how to create a proxy to use Parse.com as your data store.&#160; I also showed how to modify Backbone.js to use Parse.com.&#160; Now, I will show how [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/">Series Overview</a></p>
<p><a href="http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/">&lt;&lt; Working with Backbone.js and the Parse.com Proxy</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://houseofbilz.com/archives/2011/11/30/hosting-the-todos-example-on-heroku/">Hosting the Todos example on Heroku &gt;&gt;</a></p>
<p>This is the post where I put it all together.&#160; I showed how to create a proxy to <a href="http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/">use Parse.com as your data store</a>.&#160; I also showed how to <a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">modify Backbone.js to use Parse.com</a>.&#160; Now, I will show how easy it is to use Backbone.js models and collections with a service like Parse.com.&#160; Note that Parse.com is not the only service out there that does this.&#160; StackMob is another example of a “place to put your stuff” service.&#160; There are others.</p>
<p>In this app, I will borrow from the default <a href="http://documentcloud.github.com/backbone/">Backbone.js</a> example: Todos.&#160; <a href="http://documentcloud.github.com/backbone/#examples-todos">Todos</a> is a simple to-do list, which uses the browser’s local storage to save data.&#160; <br /><img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/f0dd85a2-2d24-43c6-bb73-1319e835105a/2011-11-30_14-22-43.png" width="313" height="409" /></p>
<p>I will adapt it to be hosted by the Parse.com proxy that I showed in my previous post.&#160; Instead of storing locally, the app will put push to Parse.com.&#160; Want to play with it?&#160; I have hosted everything on Heroku: <a href="http://todos-parsepack.herokuapp.com/">http://todos-parsepack.herokuapp.com/</a></p>
<p>There are only a few tiny steps to make this work:</p>
<ol>
<li>Replace localstorage.js with parse.com.js</li>
<li>Modify the model and collection to use Parse.com instead of local storage</li>
<li>Configure the proxy</li>
<li>Run the proxy</li>
</ol>
<p>&#160;</p>
<h3>1. Modify index.html</h3>
<p>The example given with Backbone.js uses the “localstorage” override for Backbone.sync.&#160; We want to use the default REST version Backbone.sync so we remove it.&#160; We also want to use the base prototypes to adapt Parse.com to Backbone.</p>
<p><font face="Courier New"><strike>&lt;script src=&quot;backbone-localstorage.js&quot;&gt;&lt;/script&gt;<br />
      <br /></strike>&lt;script src=”parse.com.js&quot;&gt;&lt;/script&gt;</font></p>
<h3>2a. Modify the model</h3>
<p></p>
<p>The example uses a vanilla Backbone.Model.&#160; Instead, change it to Backbone.ParseModel and give it the location of the data.</p>
<p><font face="Courier New"><strike>window.Todo = Backbone.Model.extend({<br />
      <br /></strike>window.Todo = Backbone.ParseModel.extend({ </p>
<p>&#160;&#160;&#160; urlRoot: &quot;/data/Todos&quot;,</font></p>
<h3>2b. Modify the Collection</h3>
<p></p>
<p>The example uses a Backbone.Collection.&#160; Instead, change it to Backbone.ParseCollection and give it the location of the data.</p>
<p><font face="Courier New"><strike>window.TodoList = Backbone.Collection.extend({<br />
      <br /></strike>window.TodoList = Backbone.ParseCollection.extend({ </p>
<p>&#160;&#160;&#160; url: &quot;/data/Todos&quot;,</font></p>
<p>Also, since we aren’t using local storage, remove the localStore details.</p>
<p><font face="Courier New"><strike>localStorage: new Store(&quot;todos&quot;),</strike></font></p>
<h3>3. Configure the App</h3>
<p></p>
<p>That is all you need to do in order to modify the app.&#160; Everything else is exactly the same.&#160; You do, however, need to create an App at Parse.com.<br />
  </p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/829dc2f5-dca8-48b9-8c0a-0b59879a0504/2011-11-30_14-34-18.png" width="393" height="226" /><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/60446bb8-193a-4be8-a359-e5ab433f6213/2011-11-30_14-35-47.png" width="329" height="226" /></p>
<p>Use the Application ID and Master Key and edit the config.coffee file:</p>
<pre class="brush: coffeescript; ruler: true; toolbar: false; smart-tabs: false;">applicationID: 'APPLICATION ID'
masterKey:    'MASTER KEY'
apiPath:  '/data/'
port:     3001</pre>
<h3>4. Run the proxy:</h3>
<p><font face="Courier New">&gt; coffee proxy.coffee</font></p>
<h3>Test the app</h3>
<p></p>
<p>Add items to your list.<br />
  </p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/f1e9ed51-045a-43a2-8afa-ae00514650a0/2011-11-30_14-40-41.png" /></p>
<p>&#160;</p>
<p>See them show up in your data store.<br />
  </p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/51f7e2c9-2191-4bde-9c6f-952bb816519e/2011-11-30_14-44-14.png" width="711" height="301" /></p>
<h3>Conclusion</h3>
<p></p>
<p>That was insanely easy.&#160; You just need to tell you models and collections to go to the server instead of local storage, configure the proxy and run it.&#160; This solution installs well on Heroku as you can see.&#160; This app wasn’t built with any type of user models, so everyone in the world gets to share Todos in this example… that can also be done with Parse.com, but I that is a different post ☺.</p>
<p>If anyone finds this useful, I would be curious to know if it helps.&#160;  If you want the source code for this project, take a look at <a href="https://github.com/BrianGenisio/todos-parseback">the GitHub project</a> </p>
<p>As a bonus, I wrote up the modifications I needed to make in order to <a href="http://houseofbilz.com/archives/2011/11/30/hosting-the-todos-example-on-heroku/">host the Parse-backed Todos example on Heroku</a>.  It was really easy and worth the writeup. </p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Working with Backbone.js and the Parse.com Proxy</title>
		<link>http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/</link>
		<comments>http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 11:32:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Parse.com]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=381</guid>
		<description><![CDATA[Series Overview &#60;&#60; Making Backbone.js Work with Parse.com&#160;&#160;&#160;&#160;&#160;An Example Backbone/Parse.com App &#62;&#62; In the last post, I presented some base prototypes for Backbone.js models and collections that play nicely with Parse.com Next, I will put all the pieces together and show how to use Backbone.js with Parse.com.&#160; All of the code is available on GitHub. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/">Series Overview</a> </p>
<p><a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">&lt;&lt; Making Backbone.js Work with Parse.com</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/">An Example Backbone/Parse.com App &gt;&gt;</a></p>
<p>In the <a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">last post</a>, I presented some base prototypes for Backbone.js models and collections that play nicely with Parse.com</p>
<p>Next, I will put all the pieces together and show how to use Backbone.js with Parse.com.&#160; All of the code is available on GitHub. <a href="https://github.com/BrianGenisio/Parseback/tree/parse.com-proxy-with-backbone.js">https://github.com/BrianGenisio/Parseback/tree/parse.com-proxy-with-backbone.js</a></p>
<h3>Create an “App” on Parse.com called “MyPeeps”</h3>
<p>Once you crate the App, you will be given an <strong>Application Id</strong> and a <strong>Master Key</strong> which are essentially your user/password authentication for the site.</p>
<p></p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/ae906ffa-2f27-4317-a88f-7ff710850645/2011-11-04_22-10-11.png" width="344" height="218" /><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/ec1bf2af-ed3d-4792-9bec-ea0ca1e71839/2011-11-04_22-10-47.png" width="381" height="287" /></p>
<h3>Set the ApplicationID and MasterKey in the <font style="font-weight: bold">config.coffee </font>file</h3>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/e2e751c7-91a1-41f1-9254-9036979675ac/2011-11-09_05-41-33.png" /></p>
<h3>Create the model and collections (<font style="font-weight: bold">people.coffee</font>)</h3>
<p>The model and collection extends from <strong>ParseModel</strong> and <strong>ParseCollection</strong> described in the <a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">last post</a>.</p>
<pre class="brush: coffeescript; ruler: true; toolbar: false; smart-tabs: false;">window.app =
  models: {}
  collections: {}

class app.models.Person extends Backbone.ParseModel
  urlRoot: &quot;/data/People&quot;

class app.collections.People extends Backbone.ParseCollection
  model: app.models.Person
  url: &quot;/data/People&quot;</pre>
<h3>Create <font style="font-weight: bold">index.html</font></h3>
<pre class="brush: xml; ruler: true; toolbar: false; smart-tabs: false;">&lt;html&gt;
&lt;head&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;/vendor/jquery-1.6.2.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;/vendor/underscore-1.1.7.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;/vendor/backbone-0.5.3.js&quot;&gt;&lt;/script&gt;

  &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  Use the developer tools in your browser to play
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Run the <a href="http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/">proxy server</a></h3>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/8321bda4-3108-41b1-a228-62d255f2de75/2011-11-09_05-47-46.png" /></p>
<h3>Point your browser to <a href="http://localhost:3001">http://localhost:3001</a>. Open your console and start playing</h3>
<p>Use your developer tools to create and work with your backbone models (created in <strong>people.coffee</strong>).</p>
<h3>Create</h3>
<p>Create a new <strong>Person</strong> model with the attributes you want and <strong>save</strong> it.&#160; The “People” class will get created on Parse.com and the attributes will get populated. Everything is schema-less so it gets created on demand.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/c4cc99a6-e50b-4ae3-930c-99f4e6db6bf4/2011-11-06_19-40-09.png" /></p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/a6bdfdb6-3f3c-4a9d-9786-90faf656dd06/2011-11-06_19-37-32.png" width="769" height="335" /></p>
<h3>List</h3>
<p>Create a new <strong>People</strong> collection and <strong>fetch</strong> the items.&#160; When the server responds, you will see your new item in the collection with the attributes you set.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/e2ca54e4-2b77-4a25-b8ca-e6f403451f13/2011-11-06_19-41-19.png" /></p>
<h3>Update</h3>
<p>When you update the attributes on your <strong>Person</strong> model and save it, the updates will go back to Parse.com.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/eb144cc0-ec82-47c9-8372-04889b828e08/2011-11-06_19-42-56.png" /><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/7f640dff-9d2d-4687-b879-607aae7b7ebd/2011-11-06_19-43-17.png" width="736" height="142" /></p>
<h3>Show</h3>
<p>If you create a new <strong>Person</strong> model with a known id, you can <strong>fetch</strong> it from Parse.com</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/b2fa1cab-8ca6-48ca-a90b-8668264139c3/2011-11-06_19-45-05.png" /></p>
<h3>Delete</h3>
<p>If you don’t want your object anymore, you can <strong>destroy</strong> it.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/e0925b52-a9a1-4f75-9aa8-21f4b1834a04/2011-11-06_19-45-50.png" /><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/12b4faae-523e-49c9-83a1-ef7f2dd51e9b/2011-11-06_19-46-07.png" width="747" height="198" /></p>
<h3>Querying</h3>
<p>A very useful feature of the Parse.com API is the ability to query data.&#160; To illustrate this, let’s populate the database with three <strong>Person</strong> models: Brian Genisio, Eli Genisio and Jon Doe.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/c78d171d-37e6-480b-93f2-76f2329692f5/2011-11-06_19-57-58.png" /></p>
<p>I can pass a query parameter into the <strong>fetch</strong> function because <strong>Person</strong> derives from <strong>ParseModel</strong>.&#160; Here, I am querying for any object in the database with a <strong>last</strong> attribute of “Genisio”.&#160; Note that I only receive the two and Jon Doe is not retrieved.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/27fe7baa-aa3d-43db-9a04-afd576fdded4/2011-11-06_19-57-58.png" /></p>
<p>Queries can be <a href="https://www.parse.com/docs/rest#data-querying">more complex</a>.&#160; Here is a similar query asking for all objects who’s <strong>last</strong> name attribute is not “Doe”.</p>
<p><img src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/e58cc32d-228c-43c8-9bcd-46f21195929d/2011-11-06_19-59-13.png" /></p>
<h3>Conclusion</h3>
<p>I’ve illustrated how easy it is to use Backbone.js to work with the Parse.com backend.&#160; Everything available in the REST API is abstracted with the <strong>Model</strong> and <strong>Collection</strong> paradigm that Backbone provides.&#160; By placing a small proxy between your HTML client and Parse.com, you can quickly build single-paged applications and forget about the back-end. (For data-centric apps)</p>
<p>In my next post, I will give an <a href="http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/">example of a single-paged application that uses Parse.com as the back-end.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Making Backbone.js Work with Parse.com</title>
		<link>http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/</link>
		<comments>http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 20:40:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Parse.com]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=374</guid>
		<description><![CDATA[Series Overview &#60;&#60; A Proxy Server for Parse.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Working with Backbone.js and the Parse.com proxy &#62;&#62; In the previous post, I showed how you can create a minimal server that proxies requests on to Parse.com for back-end data storage. Next, I need to consider the Backbone.js side of things.&#160; Backbone gives a really great way [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/">Series Overview</a>     <br /><a href="http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/">&lt;&lt; A Proxy Server for Parse.com</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/">Working with Backbone.js and the Parse.com proxy &gt;&gt;</a></p>
<p>In the previous post, I showed how you can create a minimal server that proxies requests on to <a href="http://parse.com">Parse.com</a> for back-end data storage.</p>
<p>Next, I need to consider the <a href="http://documentcloud.github.com/backbone/">Backbone.js</a> side of things.&#160; Backbone gives a really great way of describing models and collections as long as the data conforms to its REST flavor.&#160; Unfortunately, Parse.com does things a little bit differently.&#160; I have encapsulated this code into some base prototypes that can be used later.&#160; </p>
<p><strong>parse.com.coffee</strong></p>
<pre class="brush: coffeescript; ruler: true; toolbar: false; smart-tabs: false;">class Backbone.ParseCollection extends Backbone.Collection
  parse: (resp, xhr) -&gt;
    data = super
    data.results

  fetch: (options) -&gt;
    if options?.query?
      options.data = &quot;where=&quot; + JSON.stringify options.query
      delete options.query
    super

class Backbone.ParseModel extends Backbone.Model
  setId: (data) -&gt;
    data.id = data.objectId unless data.id
    data

  constructor: (model) -&gt;
    @setId model
    super

  parse: (resp, xhr) -&gt;
    @setId super

  toJSON: () -&gt;
    result = super
    delete result.createdAt
    delete result.updatedAt
    result</pre>
<p>These base classes help me to adapt the data and behavior of Parse.com:</p>
<h3>Collection Fetching</h3>
<p></p>
<p>Backbone wants a JSON array from the server.&#160; Parse.com gives you a JSON object with an array called “results” inside the root object.&#160; The code overrides Backbone.Collection.parse to return the array property from the Parse.com response.</p>
<h3>Collection Queries</h3>
<p></p>
<p>You can make server-side queries via the query parameters in the Parse.com API.&#160; The code overrides Backbone.Collection.fetch to take a “query” option.&#160; Mutate it to the format that Parse.com wants in the API.&#160; I’ll discuss this more in the next post.</p>
<h3>Model IDs</h3>
<p></p>
<p>Parse.com IDs have the name of “objectId” but Backbone expects the IDs to be named “id”.&#160; The code overrides the Backbone.Model.parse and Backbone.Model.constructor functions to set the ID based on the “objectID” that comes from Parse.com.&#160; This will be used later when updating or deleting the object.</p>
<h3>Model Metadata</h3>
<p></p>
<p>Parse.com includes two metadata fields: “createdAt” and “updatedAt”.&#160; While they may be useful, Parse.com fails if you send these fields via a PUT request.&#160; The code overrides Backbone.Model.toJSON to remove these items from the serialization, thus keeping them from being sent to Parse.com as well.</p>
<p>We now have base prototypes that allow us to communicate with the server.&#160; Instead of extending Backbone.Model and Backbone.Collection, you should make your models extend Backbone.ParseModel and Backbone.ParseCollection.&#160; </p>
<p>In the next post, I will show how to do this and we will play in the browser a bit in order to show <a href="http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/">how Backbone.js models and collections interact with the proxy server</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A Proxy Server for Parse.com</title>
		<link>http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/</link>
		<comments>http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 11:41:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Parse.com]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=366</guid>
		<description><![CDATA[&#60;&#60; See the full series of posts&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Making Backbone.js work with Parse.com &#62;&#62; In my previous post, I asked the question: “Is there any reason why can’t we use a service like [Parse.com] in an HTML5/Javascript single-paged app?”&#160; The answer is “yes”. The reason: the same origin policy.&#160; The browser won’t let you request Parse.com [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/">&lt;&lt; See the full series of posts</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">Making Backbone.js work with Parse.com &gt;&gt;</a></p>
<p>In my <a href="http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/">previous post</a>, I asked the question: “Is there any reason why can’t we use a service like [<a href="https://www.parse.com/">Parse.com</a>] in an HTML5/Javascript single-paged app?”&#160; The answer is “yes”.</p>
<p>The reason: <a href="http://en.wikipedia.org/wiki/Same_origin_policy">the same origin policy</a>.&#160; The browser won’t let you request Parse.com data from a different domain.&#160; There are certainly tricks you can play if you just want to GET the data (like JSONP for example), but there is no good way to make POST/PUT/DELETE requests.&#160; You have to stay on your own domain if you want to use all that a REST API has to offer.</p>
<p>Using my newfound <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> skills, I came up with this proxy server based on <a href="http://nodejs.org/">Node.js</a> with <a href="http://expressjs.com/">Express</a> and <a href="https://github.com/danwrong/restler">Restler</a>.&#160; While I’m at it, the server can return my index.html and all other assets (images, Javascript, CSS and HTML templates). </p>
<p>Here is the code (full code for this post is available on GitHub <a href="https://github.com/BrianGenisio/Parseback/tree/parse.com-proxy-with-readme">https://github.com/BrianGenisio/Parseback/tree/parse.com-proxy-with-readme</a>):</p>
<p><strong>proxy.coffee</strong></p>
<pre class="brush: coffeescript; toolbar: false;">express = require 'express'
restler = require 'restler'
config = require './config'

app = express.createServer()
app.use express.bodyParser()

app.get &quot;/&quot;, (req, res) =&gt;
  res.sendfile &quot;#{__dirname}/index.html&quot;

app.all &quot;#{config.apiPath}*&quot;, (req, res) =&gt;
  console.log &quot;REQUEST: &quot;, req.url, req.body || &quot;no body&quot;

  data = JSON.stringify(req.body)

  restOptions =
    username:  config.applicationID
    password:  config.masterKey
    data:      data
    method:    req.method.toLowerCase()
    headers:
      'Content-Type':  'application/json'
      'Content-Length': data?.length || 0

  complete = (data) =&gt;
    console.log &quot;COMPLETE: &quot;, data
    res.json JSON.parse(data)

  error = (data, res) =&gt;
    console.log &quot;FAILURE: &quot;, data, res

  restler.request(&quot;https://api.parse.com/1/classes/#{req.url.replace(config.apiPath, '')}&quot;, restOptions)
    .on(&quot;complete&quot;, complete)
    .on(&quot;error&quot;, error)

app.get &quot;/*&quot;, (req, res) =&gt;
  res.sendfile &quot;#{__dirname}#{req.url}&quot;

app.listen config.port

console.log &quot;Server started on #{config.port}&quot;</pre>
<p>This light-weight proxy will open a port and listen to requests.&#160; If you request “/” or any other file, it will dump it back.&#160; If you request “/data/*”, it will proxy your request off to Parse.com and return the result back.&#160; It will handle all of the GET/POST/PUT/DELETE requests that Parse.com supports.</p>
<p>This proxy server loads a config file:</p>
<p><strong>config.coffee</strong></p>
<pre class="brush: coffeescript; ruler: true; toolbar: false; smart-tabs: false;">module.exports =
  applicationID: 'Your Parse.com Application ID'
  masterKey:     'Your Parse.com Master Key'
  apiPath:  '/data/'
  port:     3001</pre>
<p>The first two configuration options are provided to you by Parse.com when you create a new “App” with them.&#160; All of your entities for that “App” will have the same Application ID and Master Key.</p>
<p>Next is the path you want the proxy to use when passing data requests on.&#160; In this example, <a href="http://mydomain.com/data/People">http://mydomain.com/data/People</a> would proxy off to <a href="http://api.parse.com/1/classes/People">http://api.parse.com/1/classes/People</a>.</p>
<p>Finally you can specify the port to run the proxy on.&#160; This is self explanatory.</p>
<p>Now all I can run my server: <font face="Courier New">coffee proxy.coffee</font></p>
<p>Using curl, I can test all of the actions that my new server supports:</p>
<h3>Create</h3>
<p><font face="Courier New">&gt; curl -X POST -H &quot;Content-Type: application/json&quot; \ </p>
<p>&gt; -d &#8216;{&quot;first&quot;: &quot;Brian&quot;, &quot;last&quot;: &quot;Genisio&quot;}&#8217; \</font></p>
<p>&gt; </p>
<p>  <a href="http://localhost:3001/data/People"><font face="Courier New">http://localhost:3001/data/People</font></a><font face="Courier New"> </p>
<p>{&quot;createdAt&quot;:&quot;2011-11-05T19:11:25.873Z&quot;,&quot;objectId&quot;:&quot;fiIMd53m0j&quot;}&#160; </font></p>
<h3>List&#160; </h3>
<p><font face="Courier New">&gt; curl -X GET </font><a href="http://localhost:3001/data/People"><font face="Courier New">http://localhost:3001/data/People</font></a><font face="Courier New"> </p>
<p>{&quot;results&quot;:[{&quot;updatedAt&quot;:&quot;2011-11-05T19:11:25.873Z&quot;,&quot;last&quot;:&quot;Genisio&quot;,&quot;createdAt&quot;:&quot;2011-11-05T19:11:25.873Z&quot;,&quot;first&quot;:&quot;Brian&quot;,&quot;objectId&quot;:&quot;fiIMd53m0j&quot;}]}&#160; </font></p>
<h3>Update&#160; </h3>
<p><font face="Courier New">&gt; curl -X PUT -H &quot;Content-Type: application/json&quot; \&#160; <br />&gt; -d &#8216;{&quot;middle&quot;: &quot;Michael&quot;}&#8217; \&#160; <br />&gt; </font><a href="http://localhost:3001/data/People/fiIMd53m0j"><font face="Courier New">http://localhost:3001/data/People/fiIMd53m0j</font></a><font face="Courier New"> </p>
<p>{&quot;updatedAt&quot;:&quot;2011-11-05T19:15:25.122Z&quot;}&#160; </font></p>
<h3>Show&#160; </h3>
<p><font face="Courier New">&gt; curl -X GET </font><a href="http://localhost:3001/data/People/fiIMd53m0j"><font face="Courier New">http://localhost:3001/data/People/fiIMd53m0j</font></a><font face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />{&quot;middle&quot;:&quot;Michael&quot;,&quot;updatedAt&quot;:&quot;2011-11-05T19:15:25.122Z&quot;,&quot;last&quot;:&quot;Genisio&quot;,&quot;createdAt&quot;:&quot;2011-11-05T19:11:25.873Z&quot;,&quot;first&quot;:&quot;Brian&quot;,&quot;objectId&quot;:&quot;fiIMd53m0j&quot;}&#160;&#160; </font></p>
<h3>Delete&#160; </h3>
<p><font face="Courier New">&gt; curl -X DELETE </font><a href="http://localhost:3001/data/People/fiIMd53m0j"><font face="Courier New">http://localhost:3001/data/People/fiIMd53m0j</font></a><font face="Courier New"> </p>
<p>{}</font>&#160;</p>
<h3>Index.html</h3>
<p><font face="Courier New">&gt; curl </font><a href="http://localhost:3001"><font face="Courier New">http://localhost:3001</font></a><font face="Courier New"> </p>
<p>I AM AN HTML FILE</font></p>
<h3>Other assets</h3>
<p><font face="Courier New">&gt; curl </font><a href="http://localhost:3001/foo.bar"><font face="Courier New">http://localhost:3001/foo.bar</font></a><font face="Courier New"> </p>
<p>I AM A TEXT FILE</font></p>
<p>Considering my entire server is less than 50 lines of code, I am happy with this compromise.&#160; My technology (the browser) does not allow me to go completely server-less but this gets me pretty close. </p>
<p>In the next post, I will show how I got Backbone.js to talk to my proxy server.</p>
<p><a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">Making Backbone.js work with Parse.com &gt;&gt;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Going (Mostly) Server-less with Backbone.js</title>
		<link>http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/</link>
		<comments>http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 11:19:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Parse.com]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=363</guid>
		<description><![CDATA[I have been having a lot of fun with Backbone.js and CoffeeScript lately.&#160; It is my new programming obsession.&#160; They go together like chocolate and coffee.&#160; Along with this work, I have had the fantasy of going server-less and pushing all of my data stores to a back-end that I don’t have to code or [...]]]></description>
			<content:encoded><![CDATA[<p>I have been having a lot of fun with <a href="http://documentcloud.github.com/backbone/">Backbone.js</a> and <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> lately.&#160; It is my new programming obsession.&#160; They go together like chocolate and coffee.&#160; Along with this work, I have had the fantasy of going server-less and pushing all of my data stores to a back-end that I don’t have to code or manage myself.&#160; I mean, how cool would that be?&#160; To develop a browser-based application complete with data storage without a server is boss if you ask me.</p>
<p>For my data store, I have been playing with a new (currently in Beta) service called <a href="https://www.parse.com/">Parse.com</a>.&#160; Parse.com gives you a schema-less data store &#8212; a place to put your stuff with a REST API.&#160; They are focusing on being the persistence layer for mobile apps when you don’t want to mess with a server.&#160; Is there any reason why we can’t use a service like this in an HTML5/Javascript single-paged app?&#160; It turns out that the answer is more complicated than “no” but it is something that we can certainly get around.&#160; </p>
<p>This series will be broken into several parts:</p>
<ol>
<li>Introduction (this page) </li>
<li><a href="http://houseofbilz.com/archives/2011/11/07/a-proxy-server-for-parse-com/">A Proxy Server for Parse.com</a> </li>
<li><a href="http://houseofbilz.com/archives/2011/11/07/making-backbone-js-work-with-parse-com/">Making Backbone.js Work with Parse.com</a> </li>
<li><a href="http://houseofbilz.com/archives/2011/11/09/working-with-backbone-js-and-the-parse-com-proxy/">Working with Backbone.js and the Parse.com Proxy</a> </li>
<li><a href="http://houseofbilz.com/archives/2011/11/30/an-example-backboneparse-com-app/">Building an Application with Parse.com Models</a> </li>
<li><a href="http://houseofbilz.com/archives/2011/11/30/hosting-the-todos-example-on-heroku/">Hosting the Todos example on Heroku (Bonus)</a></li>
</ol>
<p>All of the code (front-end and back-end) in these examples will be written in <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> but there is no reason you can’t do the same thing with Javascript.&#160; Let me know if you find this short series useful.&#160; </p>
<p><strong>Disclaimer:&#160; I am really just hacking and documenting my work.&#160; I have no idea how this will perform in a real-world scenario.&#160; It is a thought experiment.&#160; If anything, this is really just a place for me to document my work.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/11/07/going-mostly-server-less-with-backbone-js/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Captive Runtime packaging in Air 3.0</title>
		<link>http://houseofbilz.com/archives/2011/10/11/captive-runtime-packaging-in-air-3-0/</link>
		<comments>http://houseofbilz.com/archives/2011/10/11/captive-runtime-packaging-in-air-3-0/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 17:42:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/?p=313</guid>
		<description><![CDATA[When I talk with people about the Flex framework, many think of it as a Flash library. They often refer to Flex as a web framework that runs in a plug-in. To me, however, Flex is an application framework. To be honest, Flex in the browser doesn’t excite me. I am much more interested in [...]]]></description>
			<content:encoded><![CDATA[<p>When I talk with people about the Flex framework, many think of it as a Flash library. They often refer to Flex as a web framework that runs in a plug-in. To me, however, Flex is an application framework. To be honest, Flex in the browser doesn’t excite me. I am much more interested in using Flex on the desktop or on mobile devices.</p>
<p><strong>Some History</strong></p>
<p>Until recently, Flex has been criticized for requiring a separate runtime install. The criticism is valid – users were often confused by this and found the need to upgrade something other than the app they wanted to install. The user experience became one where the user was left wondering, “what just happened?”</p>
<p>In one case, my customer required that nothing be allowed installed on the users’ machine (network access was not available either). This meant no Air runtime and no app. We had a workaround which included an app embedded inside of a PDF but that left the user feeling like they were watching Inception (an app within an app…).</p>
<p>Although this was the case in OSX, Windows and Android, it was not the case in iOS (iPhone and iPad). Apple doesn’t allow third-party runtimes on their devices so Adobe created a native compiler and packager that bundles the Air libraries directly into the app.</p>
<p><strong>Captive Runtime</strong></p>
<p>In Air 3.0, however, the requirement for a separate Air runtime has been lifted. With the “Captive Runtime” feature, developers can bundle the native Air libraries with the app. When apps are bundled this way, they can be deployed any way you want. They won’t require an installation of Air OR the application itself (on the desktop; mobile apps still need to be installed but can be without the separate runtime). This doesn’t mean you are restricted from installing your app but it means that it is no longer required. In addition to iOS, Captive Runtime will work in Android, OSX and Windows.</p>
<p>Let’s see how easy it is to use. I will create a “Hello World” app for illustrative purposes but significantly more complicated applications work just as easily.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/29619d66-af32-458e-b4d6-dc43166cc114/2011-10-06_11-42-17.png" alt="" width="350" height="281" /></p>
<p><a href="http://www.adobe.com/devnet/flex/articles/whats-new-flex-flash-builder-46.html">Flash Builder 4.6</a> has integration built-in integration for captive runtime.  When you “Export Release Build” from Flash Builder, you simply create a “Signed application with AIR runtime bundled”.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/945de260-d491-4a2a-91c1-74ab7cb7c9b3/2011-10-06_06-55-542.png" alt="" width="370" height="381" /></p>
<p>Everything else is the same. You add a signed certificate to the app as you normally would and any other packaging settings.  When you are complete, you will get a native application that is ready to execute but doesn’t require Air to be installed.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/202db853-961d-47a9-8388-b34332892e19/2011-10-06_10-41-36.png" alt="" /></p>
<p>This app can be copied to a thumb drive, shared from network storage or embedded into an installer. It is an application just like any other.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/46a53a46-6b33-4523-a20e-db09d071eda0/2011-10-06_10-44-36.png" alt="" /></p>
<p>Note that this does bloat the size of your application. This may or may not be an issue for you depending on your audience and deployment mechanism. You can always package your app as a traditional Air app if you prefer.</p>
<p>The Windows story for building your app is exactly the same as the OSX side. The only difference is that the app is packaged as an EXE with the Air support alongside it.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/41811197-7d4d-4fcd-9bad-af15d4a39ea6/2011-10-06_11-30-16.png" alt="" width="322" height="172" /></p>
<p>The story for Android is similar. You have a different dialog for packaging, but the idea is the same. The APK that is produced will have Air bundled inside.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://content.screencast.com/users/BrianGenisio/folders/Snagit/media/4b0f8c73-28ea-4118-8012-021863e57edc/2011-10-06_11-23-11.png" alt="" /></p>
<p>Of course, you don’t need to use Flash Builder to package your app. You can do it from the SDK and the command line. Instead of repeating what you can already find out in other places, I will just refer you to <a href="http://www.tricedesigns.com/2011/08/10/air-3-0-captive-runtime/">Andrew Trice’s blog</a> for more info on that.</p>
<p>&nbsp;</p>
<p>If you would like to get a sneak peek of Flash Builder 4.6, you can <a href="https://prerelease.adobe.com/callout/default.html?callid=DC919522A42544798C33ECB4041FC5DC">apply for the Flex and Flash Builder pre-release</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/10/11/captive-runtime-packaging-in-air-3-0/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Slides and Presentation for &#8220;Mobile Air&#8221; Presentation</title>
		<link>http://houseofbilz.com/archives/2011/05/06/slides-and-presentation-for-mobile-air-presentation/</link>
		<comments>http://houseofbilz.com/archives/2011/05/06/slides-and-presentation-for-mobile-air-presentation/#comments</comments>
		<pubDate>Fri, 06 May 2011 18:02:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://houseofbilz.com/archives/2011/05/06/slides-and-presentation-for-mobile-air-presentation/</guid>
		<description><![CDATA[This morning, I presented at StirTrek 2011.&#160; Here are my demos and presentation: Presentation Code Demos ScoreKeeper (Shared screens) Demo]]></description>
			<content:encoded><![CDATA[<p>This morning, I presented at <a href="http://stirtrek.com">StirTrek 2011</a>.&#160; Here are my demos and presentation:</p>
<ul>
<li><a href="https://bitbucket.org/briangenisio/airforandroid/raw/0b43706fc87b/AirOnAndroid.pptx">Presentation</a></li>
<li><a href="https://bitbucket.org/briangenisio/airforandroid/src/0b43706fc87b">Code Demos</a></li>
<li><a href="https://bitbucket.org/briangenisio/scorekeeper/overview">ScoreKeeper (Shared screens) Demo</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://houseofbilz.com/archives/2011/05/06/slides-and-presentation-for-mobile-air-presentation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
