Herding Code 161: Single Page Applications with John Papa and Ward Bell

While at MVP Summit, Jon and the Scotts talk to John Papa and Ward Bell about Single Page Applications, the new ASP.NET and Web Tools 2012.2 SPA templates, and John and Ward’s new Hot Towel SPA template (you need a hot towel at a spa, get it?).

Download / Listen:

Herding Code 161: Single Page Applications with John Papa and Ward Bell

Show Notes:

  • Intro
    • (01:10) K Scott asks John Papa about to overview what’s just been released.
    • (01:24) Jon explains how he remembers the ASP.NET and Web Tools 2012 release, comparing it to a video game "map pack".
    • (02:04) John says that one of the new features in this release is that you can create new File / New / Project templates for ASP.NET MVC using VSIX.
    • (03:18) Scott K says you can find all the new goodies at http://asp.net/vnext.
  • Hot Towel overview
    • (03:37) K Scott asks what happens when you create a new Hot Towel project.
    • (04:30) K Scott asks what’s included:
      • Durandal
      • Knockout
      • Breeze
      • Some other nice things: jQuery, Bootstrap, Moment
      • The useful parts of the ASP.NET stack
  • Durandal and getting the various libraries to play well together
    • (06:00) Jon asks if everything in the Hot Towel parts fit together well, and if it was hard to get them to play well together.
    • (07:14) Durandal uses Require.js for AMD for script dependency resolution. Hot Towel is still using ASP.NET Bundling and Minification system, although when you deploy you can use Durandal’s compilation system.
    • (09:03) Ward talks about what he likes about Durandal.
      • You can bring any thing you know from Caliburn.Micro in, including convention based view composition.
      • It includes a lot of useful debugging and tracing information in the console. That includes intercepting problems with Sammy.js (which would otherwise just report "Error" without any context), binding failures, etc.
    • (10:24) Hot Towel also includes Toaster, which is really useful for debugging.
    • (11:15) Hot Towel has really been carefully assembled and and configured so it all really works well together.
    • (12:06) John says Hot Towel solves a common problem people experience when getting started with SPA development – it’s hard to figure out which libraries to use and how to hook them together.
  • What’s the sweet spot? Line of business apps? Websites?
    • (13:20) K Scott asks if the sweet spot for Hot Towel is for for line of business applications. John says that’s what it’s been used for. It’s great for data intensive applications, but he says it’s not a good fit if you’re just building a website.
    • (13:53) Jon asks about the SEO story. John says there really isn’t a great solution for it, but says that for most SPA stories – e.g. line of business CRUD apps – you probably don’t need or want search engines to be able to read it. For some cases, like a store scenario, you might want a hybrid solution. The store would be a standard website that’s SEO friendly, but when you shift to buying something you enter a SPA experience.
  • Organize all the scripts!
    • (15:45) K Scott asks how John organizes code for a SPA. John says he likes to put all the application specific scripts into a separate /scripts/app folder. Jon says he noticed that in the RTM version of the SPA template, and Ward and John confess to having been the driving forces behind that change.
    • (17:37) John talks about the two crowds who are using these scripts – there are people who have been using JavaScript for a while, and developers who are used to C# and are starting to do more JavaScript development. Simple things like pascal casing vs. camel casing make a big difference in how experienced JavaScript developers perceive and enjoy the shipped JavaScript code.
  • Bringing grownup architecture into client side coding
    • (18:19) Ward talks about other problems in earlier versions, like lumping the viewmodel and data access, etc. He says he understands the effort to make things easy for beginners to figure out, and Scott talks about some of the sloppy, oversimplified JavaScript in some other Microsoft releases. John says that the new script organization in the release turned out both better and easier to understand.
    • (20:48) Scott talks about his thoughts on client-side MVC: HTML is the model, CSS is the view, JavaScript is the controller.
    • (22:04) John says we’ve been figuring out of the past few years that it’s not okay to just throw JavaScript code up there until it works. He says he often surveys developers and asks how many of them have read a book on JavaScript with dismaying results. Scott says it’s not just a problem with disorganized code, you end up with resource management issues. Scott, John and Ward commiserate on the problems they’ve seen with sloppy code in long running JavaScript applications.
    • (24:31) Ward talks about the importance of good coding principles, especially the single responsibility principle. John says SRP is incredibly useful just about everywhere. Scott says he sees the same thing with testable JavaScript code.
  • Hello World and Hello World scenarios
    • (26:37) K Scott asks if there’s a hello world style application when you create a new Hot Towel application. John says there is, but it’s absolutely minimal so that it’s actually useable as a starting point for an application. There’s no database. Ward says Hot Towel has two simple pages with just enough code to get you started; use the other SPA templates to learn about the frameworks, then build your real app with Hot Towel – if you’re going with a Knockout-based UI.
    • (28:37) Scott K says he sees Knockout and Angular cluttering your HTML in ways that violate some of the principles discussed earlier. Ward that you can do both without declarative HTML binding if you want. There’s a discussion of convention based bindings; K Scott asks if the Caliburn.Micro convention based bindings are used in Hot Towel, Ward explains why it’s not done.
    • (31:40) John talks about some poor practices he sees in Knockout demos which just throw in some JavaScript code after the bindings rather than just using a click binding or using delegation.
    • (33:32) Scott asks if we’d have imagined 10 years ago that we’d be writing JavaScript code.
    • (33:54) Ward says the thing that blows his mind is that we’re talking about a ToDo list like it’s rocket science. There’s a description of the canonical sample scenarios. Jon proposes the Contoso SPA, Scott talks about how everyone was writing blog samples a few years ago.
    • (35:43) John explains that he wrote Hot Towel so that you could use it without having to rip out a bunch of demo code; Ward says it also completes the stack, providing IoC, screen management, etc. The price tag of restructuring around composed JavaScript libraries is a lot of small files, figuring out AMD, etc. John and Ward praise Durandal some more.
    • (38:52) Scott K says there’s still a tooling problem with lots of injected JavaScript files. Ward and John say they don’t see that as long as they keep things organized.
  • Getting started with SPA development
    • (40:27) K Scott asks for two things developers should do before getting started with SPAs. John says the first thing is to remember that you can apply your current good coding practices, the second is that you should treat the code as a real language and take advantage of patterns, especially the module pattern. Ward says use your intuition – if something smells bad, stop doing it and ask for help.
    • (43:03) John says don’t worry too much about which framework is the best, just pick one that feels natural. There’s a discussion of how the different frameworks have different feels, and you can just pick one and get started.
  • Did Silverlight development experience help?
    • (45:15) Jon says he first encountered a lot of these issues in Silverlight development. John says yes, and explains how his skills applied. Ward says he can’t comment on how it’d have been for him if he hadn’t used Silverlight, but that if you do have Silverlight experiences they’ll definitely apply. John talks about his experiences with Code Camper.
  • Can mere mortals create VSIX MVC templates?
    • (50:18) K Scott asks how difficult it was to create a VSIX based MVC template and if listeners could start with it. John says he waited for Ward to figure it and he copied Ward’s work, which wasn’t too bad. Ward explains what was difficult – mostly it comes down to poor documentation and duplicate references to files. He says he also hit issues with pulling in NuGet packages from multiple sources. Hot Towel is available as a NuGet package as well.
  • Randomness
    • (58:11) The customary discussion of Ward’s wardrobe occurs.
    • (1:00:00) John talks about his upcoming PluralSight courses. Ward says he’s excited that BreezeJS was selected as part of the SPA story for ASP.NET and that he and IdeaBlade are focused on helping people as they’re getting started with Single Page Application development. 

Show Links:

Herding Code 160: Glimpse 1.0 release and Semantic Release Notes with Nik Molnar and Anthony vander Hoorn

While at MVP Summit, Jon and the Scotts talk to Nik and Anthony about the Glimpse 1.0 release, Semantic Release Notes and NuGet versioning.

Download / Listen:

Herding Code 160: Glimpse 1.0 release and Semantic Release Notes with Nik Molnar and Anthony vander Hoorn

Show Notes:

  • Intro
    • (00:38) Nik and Anthony remind us of what Glimpse does.
  • High level: What have they been up to?
    • (01:27) Nik explains how they’re now sponsored by RedGate software, but it Glimpse continues to be an open source project under Apache 2 license. The end result is that they’re both able to work 40 hours a week on it.
    • Anthony talks about the change to remove the dependency on System.Web.dll, allowing for compatibility with ASP.NET Web API and OWIN.
  • New features in Glimpse 1.0
    • (03:24) Jon asks about new features. Nik says they’re mostly at feature parity with the previous release, with a lot of key refactoring. Some new features include:
      • Support for SignalR
      • Routes are available in Web Forms
      • They can determine and surface route constraints
    • They’re working on MVC 4 support, System.Web.Optimizations, and Web API.
    • Anthony says the big goal of refactoring is to allow for fortnightly releases, which meant they needed to rework the core into something they could build on quickly.
    • (05:42) Jon asks about MVC 4 support. Nik says that everything in the MVC 3 package works, with the exception of Task based async support and newly added features like System.Web.Optimizations and Web API. Synchronous controllers and AsyncControllers work.
  • Notifications, Semantic Release Notes
    • (06:25) Anthony talks about support they’ve added to work better with more frequent updates, including update notifications.
    • That got them thinking – can they also show more information about what’s in the update? What about plugin updates?
    • Nik talks about what they’re doing to pull information from NuGet about installed packages.
    • (11:08) Nik explains how the extensibility model uses an attribute which indicates that the plugin came from a NuGet package and indicates which version of the package it came from.
    • (12:12) They want to give you information about what’s changed between releases, which led them to Semantic Release Notes.
    • Semantic Release Notes are written in Markdown format, but include typed information (inspired by Todo.txt) which allows them to determine what’s changed between any two releases.
    • (15:45) Jon and Scott K ask about why they picked Markdown as opposed to some other formats. Nik explains a lot of reasons, including compatibility with any text based release notes system.
    • (17:20) This allows them to present "The Sports Center of Release Notes" which showcases the relevant highlights.
    • (17:40) Anthony says NuGet release notes are virtually unused because they don’t offer any value. They’ve been talking to developers who say they’d be happy to include release notes if they were actually useful.
    • (19:33) Nik says that another benefit of a text-based format is that it could be extracted from commit messages.
    • (20:20) Nik says that NuGet has raised the water level the experience of installing release notes, understanding what an update does, configuration, overall experience.
    • (21:28) Nik says that Semantic Release Notes could also inform developers of Semantic Versioning problems – e.g. if you’ve got a breaking change, you should be bumping the major version number.
  • Problems with NuGet packages targeting product versions
    • (22:15) Anthony says they’ve run into some issues they’ve run into with NuGet. One issue they’ve run into is that developers often unwittingly install the Glimpse core package rather than the Glimpse.MVC package, which pulls in the core. They’re thinking about instead they could look at packages already installed in the project, determine that it’s an MVC project (for instance), and recommend installing the correct package (Glimpse.MVC in this case).
    • (26:00) There’s a discussion about problems to be considered with dependency scanning, notifying users, etc.
    • (27:55) Scott K asks about how this would work with locally hosted NuGet servers, MyGet, etc. Nik says they’ve seen a lot of cases of custom Glimpse plugins for things like e-commerce and internal information.
    • (28:55) There’s a MyGet feed with the nightly release, as well as a community feed for plugins.
    • (29:38) Scott K asks about how it works with local packages specifically.
    • (30:10) Nik talks about the problem with package explosion. NuGet allows you to target a specific .NET framework version, but not product versions. Jon asks why not just install Glimpse.MVC2, Glimpse.MVC3, etc. Anthony says this is a problem for any project that tries to factor things into a core with version specific dependant packages.
    • (34:28) Jon says they’re working hard to solve this problem, but would like to not have to. Anthony agrees: this is something he’d like see handled by NuGet itself.
    • (25:28) Nik says this is a growing problem, with examples from Windows 8 development. Jon talks about how he sees this problem in MVC 4. Anthony says he sees things moving in a good direction and that these are growing pains.
    • (37:25) Scott K asks if this is a problem that they’re seeing just because they have an ecosystem.
    • (38:40) Jon says he sees some people using VSIX instead of NuGet in cases where NuGet is limited. Nik says he’s frustrated that you can’t package up tooling – you can create a custom Web Platform Installer package at the high level, you can create a package.config at the project level, but there’s no solution for the installed tooling.
  • Miscellaneous jibber jabber and future possible features
    • (40:55) Anthony talks about the problems they’ve run into with XML documents and Sandcastle.
    • (42:48) Jon asks about possible future features. Scott K he’d like to see a plugin for Fiddler. Anthony talks about how they’re in a unique position with insight into the entire request pipeline, from browser through server and back to the browser.
    • (45:30) Scott K talks about how OWIN support allows access to a lot of other web stacks, too.
    • (45:55) Nik says that they include the Glimpse request ID as a header now, so you can trace the request in Fiddler or other network tools.
    • (47:00) Anthony says they’re realizing that they can do a lot more than just surface troubleshooting information for people who are learning, talking about the potential for an extensible mini-dashboard which can show really intelligent information – e.g. inform me if a request makes more than three database calls.
    • (50:14) Jon asks if there are any plugins which analyze security. There’s a discussion about automated OWASP analysis.
    • (52:10) Anthony says they’re talking to Brendan Forster about displaying decision trees visually.
    • (54:54) Jon asks what they’re looking at doing long term. Nik says they’re looking at doing some monthly conversations for developers.
    • (56:14) Jon asks how people can get involved. Answer: go to GetGlimpse.com.

Show Links:

MVC for the client side web is very simple

Model:

<body>
    <h2>Food List</h2>
    <div id="food">Apple</div>
    <input type="text" id="foodToAdd" /><button id="AddFood" text="add"/>
</body>

View:

body { background-color:#000;font-family:serif;color:#ff00ff; font-size:1em  }
#food { border: 1 solid black; }

Controller:

<script>
$(function() { $("#AddFood").click(onAddFoodClicked);
             });

function onAddFoodClicked(ev) {
 var currentlist = $("#food").text();
 var foodToAdd = $("#foodToAdd").val();
  $("#food").text(currentlist + "," + foodToAdd);
  $("#foodToAdd").val("");
  
}
</script>

See?

JS Bin

Herding Code 159: Catching up with Oren Eini on RavenDB

This week on Herding Code, the guys talk with Oren Eini (a.k.a. Ayende Rahien) about what’s new with RavenDB.

Download / Listen:

Herding Code 159: Catching up with Oren Eini on RavenDB

Show Notes:

  • (00:47) Introduction and review of document databases and RavenDB
    • Oren gives us a quick overview of document databases and RavenDB
    • Relational databases work for the kind of applications we were building in the early ’90′s. We can kind of make them work in our current applications but it takes too much work.
    • RavenDB is a document database which stores JSON documents.
    • JSON documents can store arbitrarily complex data very easily.
  • (04:35) Comparing accuracy and data consistency between document databases and relational databases
    • Jon asks about Oren’s comments on a recent .NET Rocks podcast in which he said that document databases allow us to be more correct than relational databases.
    • Oren gives a real life example of how an update to a customer’s financial information caused a change to her historical record, which caused some real problems.
    • Jon talks about some of the hoops we jump through in an attempt to maintain historical data in a relational database, e.g. soft deletes.
  • (08:42) Disk space concerns
    • Scott K says he hears DBA’s worry about disk space due to data repetition between documents and asks what other concerns people bring up.
    • Oren says there can be more computation and indexing, but on the other hand temporal data is orders of magnitude easier.
    • Data design principles were established back when space was expensive, that’s all changed now.
    • Oren says he hears people say that space isn’t cheap in the enterprise, but runs some numbers and concludes they’re either very inefficient or someone’s got their hand in the till. Scott K says that enterprises data storage is often expensive because they’re not tiering their data correctly to put low priority data on cheaper storage.
    • Oren says enterprises drive up storage costs by due to foolish backup strategies.
  • (14:42) Query and performance benefits
    • Scott K says that people often view document databases as a giant blob of text rather than structured data which can be searched, indexed, etc.
    • Oren says that you get full text search for free in RavenDB.
    • In relational databases, you’re always working with the very latest data, so you have locks, readers waiting for writers, etc.
    • RavenDB does a lot of precomputation in the background, so it can give you aggregate information immediately.
  • (17:27) RavenDB 2.0 release overview
    • Big improvements to performance on some key codepaths, in some cases over 1000%.
    • Support for JavaScript scripts on the server, which allows for scenarios like mass migrations and batching support on the server.
    • Management UI improvement, better management API coverage, performance counters, etc.
    • Dev improvements – sharding support, full support for async.
  • (19:40) 2.01 release overview
    • Files some rough spots in the 2.0 release – things that beta testers didn’t mind, but can be a little smoother.
    • They added a new feature – improves support for replicating to a relational database.
  • (22:05) Sharding improvements and migrations
    • Sharding’s been around since the beginning, but required you to specify a lot of things – lots of options, too much complexity, too many important decisions early in the development process.
    • Sharding support has been revamped – provide the endpoints, defaults take care of the rest.
    • Oren gives an example with sharding customer data. By default, documents are sharded together based on transaction id. You can specify a shard when you save based on a user specified id.
    • Some people have problems with the default approach because the document id includes the shard id. That’s necessary to prevent having to query all shards.
    • Jon asks how this works over time if you need to add shards, migrate data, etc. Oren says you can rebalance by biasing new data towards a newly added shard.
    • If you need to move data to a new server – for instance, a customer becomes large enough that you want to put all of their documents on a new shard, you’ve got two options for handling the id’s. Oren says some users migrate data, rewriting id’s during the process, but he doesn’t recommend that. Instead, he recommends using a sharding function which allows remapping document id’s to a new shard without changing id’s.
    • Jon obviously doesn’t get it and asks the same question again, also asking how you handle data modifications over time. Oren explains that you can just write a JavaScript function to update your existing documents if needed.
    • Kevin asks how long data a data migration takes. Oren types one up on the fly and explains the parsing and execution time.
  • (34:43) Time for some random questions!
    • Scott K notes that there’s a client that runs on Mono and asks if there are plans to get the server running on Mono. Oren talks about the general plan to handle that, but says it’s not high on the priority list.
    • (35:48) Scott K asks about compact scenarios, including clients that run on mobile and embedded instances that run locally. Oren notes that  clients are easy, because anything that can make a REST call can be a client. They had an embedded version that had very little interest.
    • (38:03) In disconnect scenarios, it’s usually simpler to cache JSON documents locally.
    • (39:10) Jon asks about merge support for occasionally connected scenarios. Oren says that’s intentionally not included.
    • (41:25) Jeremy Miller (@jeremydmiller) asks when Oren is going to fix Lucene.net’s flow control via exception madness. Oren says it’s not planned, and that Jeremy should ignore those exceptions.
    • (42:25) Philip (@autosnak) asks why RavenDB doesn’t do more for startups and small biz pricing-wise. Oren explains the offers they make available – open source is free, RavenDB basic edition is $5 / month, they donate a lot of license for a lot of other cases, and even the full versions are incredibly cheap compared with any other database. Shoot him an e-mail.
    • (44:44) Chris Whellams (@chriswillems) asks how to sell NoSQL and RavenDB to IT management and bosses that are addicted to SQL Sever. Oren outlines a strategy – start with a persistent viewmodel cache on a slow page to get a quick win, then use it for simple storage of ancillary application data (e.g. preferences), then use it in a spike on a new project. This is exactly what the MSNBC team did – they started with a non-operating RavenDB node in production, then slowly moved some things in without taking on any unnecessary risk.
    • (42:50) Jon asks for any closing thoughts. Oren says they’re starting on some weekly webinars for RavenDB users – or just if you’re curious about it. There’s a RavenDB course in the US in May.
    • FIN!

Show Links:

Herding Code 158: Nat Friedman and Joseph Hill announce Xamarin 2.0

Nat Friedman and Joseph Hill from Xamarin join us for several big announcements: Xamarin Studio, Xamarin Component Store, iOS development in Visual Studio, and a new free Starter edition.

Download / Listen:

Herding Code 158: Nat Friedman and Joseph Hill announce Xamarin 2.0

Show Notes:

  • (00:45) Nat begins by catching us up on Xamarin’s first eighteen months.
    • Xamarin’s focus is on helping developers build mobile apps across multiple platforms.
    • They have 230,000 developers in their community, adding 700-800 per day, with over 12,000 paying customers.
    • They’ve had top iPad (Bastion), music apps (Rdio) and some large mission critical line of business apps.
    • What’s special about their platform is that you can target iOS, Android, and Windows Phone, share C# code across  all those platforms, and still deliver a native experience.
    • Nat say’s they’re the overnight success that took ten years to prepare, referencing the ten years they took to build Mono.
  • (03:20) Xamarin’s value proposition and customer base
    • Kevin asks which of their value propositions (.NET based development, cross-platform development) resonates more with users.
    • Nat says that many developers are initially attracted by C# development, although that’s not always the case (referencing an internal app at GitHub written by Objective-C developers who just liked sharing code between platforms).
    • Nat says there’s no real way to be a mobile developer now without having a cross-platform strategy – iOS might have looked like the only platform that mattered a few years ago, but now Android is more popular and Windows Phone is growing in popularity.
  • (04:47) Code reuse strategy
    • Kevin asks how the code reuse happens, since these are true native applications.
    • Nat talks about different cross-platform strategies and says that they don’t believe in write once, run anywhere.
    • With Xamarin, you separate the backend and UI code and write specific UI code for each platform, although you still write it in C#.
    • Rdio has over 150,000 lines of code which are shared between iOS, Android and Windows which covers networking, caching, authentication, etc.
  • (07:55) First big announcement: Joseph Hill announces support for building for iOS applications in Visual Studio.
    • Nat says that you can have one Visual Studio solution targeting iOS, Android and Windows Phone, and step through the code with the full debugging support you’re used to.
    • How does the Mac support work?
      • Scott K asks if this means that you have to run Visual Studio on a Mac. Nat says that’s not necessary, you just need to pair your Visual Studio instance with a Mac – it just needs to be on the network somewhere. That’s required both to be able to sign releases and to meet Apple’s license terms.
      • Jon asks if this would work with a Mac Mini, and Nat says that’s a popular option.
      • Scott K asks about a "Mac in the cloud" option; Nat says they’re not planning that.
      • Kevin asks if several developers could share one Mac. Nat says that Apple’s requirement is that each developer is supposed to have a license, and Joseph says that the Apple toolchain is build for single user rather than server support.
      • Jon ask if he can start playing with iOS support without having a Mac, Joseph explains that you can install and look around a bit, but you can’t build or deploy.
      • Kevin asks about the Interface Builder interaction.
      • Kevin asks if it was incredibly painful to set up this support for Visual Studio.
  • (16:14) Second big announcement: Nat announces the release of Xamarin Studio.
    • Xamarin Studio runs on OSX, Windows, and Linux.
    • It’s based on Mono Develop, but it’s a completely new user interface with a lot of great new features.
    • Visual Studio Express users can’t install extensions so Xamarin Studio allows them to do Xamarin development, also it’s what all Mac users will be using.
    • Kevin asks if it’s a fork of Mono Develop.
    • Kevin asks if Xamarin Studio is open source.
    • Jon asks how it was developed. Joseph says it’s still C# Mono code using GTK. Developers write Xamarin Studio in Xamarin Studio.
    • K. Scott asks if you can target non-mobile scenarios. Joseph says you can still target ASP.NET, console, class libraries, etc.
    • Kevin asks what happens to Mono Develop. Nat says it continues as an open source project, and they’ll contribute back to it as they develop Xamarin Studio.
  • (22:35) Xamarin as a Mono producer and consumer
    • Jon says it’s interesting watching the evolution of the Mono / Xamarin efforts as they’ve moved from supplying the Mono framework to being both building Mono and building a business on Mono.
    • Nat says it’s great working for a customer base rather than an opinionated crowd. "A really good signal that we’re doing good work is that people give us money for it."
    • Joseph talks about their model, explaining how their Xamarin business works well with their role as stewards of the Mono project.
  • (25:28) Third big announcement: Nat announces the Xamarin Component Store
    • Nat says they see developers solving the same problems over and over again, giving an example of a common requirement for a signature capture control.
    • The Xamarin Component Store is a library of pre-built components. Nat gives an example of an Azure Mobile Service component.
    • It works in both Visual Studio and Xamarin Studio.
    • Components include documentation, screenshots, and sample projects. Nat says it’s conceptually similar to NuGet, but gives you a lot better experience and makes it easier to get started.
    • There are a lot of component vendors who are contributing both free and paid components, and Xamarin has also contributed several based on their experience in supporting Xamarin developers.
    • Jon asks how they handle cross platform, native user interface with components.
    • Kevin asks how people can submit components to the store.
    • Nat says he thinks this will really be a compelling feature of their platform, since developers won’t have to build everything from scratch.
    • Kevin asks they handle purchases and vender payments.
    • Kevin asks if the components are curated.
    • Jon asks about component support for Android and Windows Phone.
    • Kevin asks if it’s possible to create Xamarin components using native Objective-C components. Nat says they support both Objective-C and Java code reuse.
    • Jon says the design on the Xamarin Component store website looks great and asks about Xamarin’s approach to design. Nat says that they’re selling a good design experience and design is an important part of that.
    • Kevin says he like hover screenshots, Nat says he really likes the hover menu control.
  • (39:35) Fourth big announcement: Nat announces the free Xamarin Studio Starter Edition
    • You can use Starter Edition to get started, build, and deploy applications.
    • Starter Edition is limited to 32KB of IL code.
    • Jon loves the idea of limiting the free edition based on compiled code size.
    • Kevin asks what kind of app will fit in 32KB. Nat says that using a lot of DLL’s will put you over the limit quickly, but images aren’t content. About 20% of the apps in the store would fit under the limit.
    • Joseph says they didn’t want to limit based on features. Jon talks about the frustration people see in Visual Studio version based feature limitations. Nat says pricing is hard; ultimately they want to get a lot of people using Xamarin and they think this is a good way to do that.
  • (44:53) Jon asks about support for languages other than C#.
    • Nat says they see people using F# and Java (using IKVM).
    • Joseph says that C# is their main focus – all the documentation is in C# – but they’re happy to see people using other languages.
    • Kevin asks for JavaScript support. Nat says they think it’s hard to build large scale apps in JavaScript.
  • (47:35) Nat talks about their upcoming developer conference.
    • The first two days are focused completely on training.
    • The second two days feature some great talks by community leaders, user interface designers, and more. The entire team will be on hand to answer questions.

Show Links:

Herding Code 157: Amir Rajan on dynamic web development with Oak and Gemini

On this episode of Herding Code, the guys talk to Amir Rajan about his Oak and Gemini projects, which bring Rails-inspired dynamic programming to ASP.NET MVC.

Download / Listen:

Herding Code 157 – Amir Rajan on dynamic web development with Oak and Gemini

Show Notes:

  • Overview – Developing with Oak
    • Oak is an approach to building single page applications that are heavy on JavaScript that takes a lot of inspiration from the Ruby community’s development approach.
    • Jon asks Amir to explain his development workflow, including SpecWatcher, NSpec, and Growl.
    • Jon asks about the File / New Project experience. Amir describes how that’s not even required – Oak works with WarmuP to build out a new project.
    • The next step is using Rake – Amir explains how Rake works. Running Rake builds the application and deploys, then sets up IIS against that instance.
  • Dynamic programming and Gemini
    • Oak leverages the dynamic keyword. Amir explains how it just augments what’s already there in ASP.NET MVC.
    • Amir explains how Oak works with Gemini, separate library he’s built to enable building dynamic objects. It allows you to attach properties and methods through mixins. He gives an example of using Gemini to extend a dynamic object with validation methods.
    • Amir describes how Oak leverages Gemini to take advantage of these decorated dynamic model objects throughout the different layers.
    • Scott K asks where the composition happens – is this a pipeline process?
    • Jon says it sounds like this is a more fleshed out version of some dynamic features that were started in ASP.NET MVC, like dynamic views and ViewBag. He explains how Gemini goes beyond Expando, because it also includes support for method missing.
    • Jon says Gemini reminds him of the Clay dynamic objects used in Orchard.
  • Data access and Cambium
    • Jon asks Amir about Cambium, the data layer. Amir says he customized Rob Conery’s Massive library to work with his Gemini objects, and points out that the resulting library uses remarkably little code.
    • Scott K asks Amir if he’s looked at Breeze. Amir says so far he’s just worked with standard ASP.NET MVC controllers, but he’s interested in looking at Breeze, Dapper, and NoSQL ORMs.
  • But why?
    • Kevin asks the silly question: why bother bringing Rails idioms to ASP.NET MVC – why not work in Rails?
    • Jon says the thing he sees Amir’s done is eliminate the shift between development and runtime modes in Visual Studio based development.
    • Jon asks about change tracking support in Cambium.
  • More about data – migrations
    • Amir explains migrations and schema generation in Oak and Cambium.
    • Amir says that SQL based migrations are important in many development environments.
  • Single page and Ajax
    • Jon asks Amir about the Single Page Application story in Oak. Amir explains some of the points of friction that exist in ASP.NET SPAs and explains how Oak is able to round-trip dynamic types.
    • Scott K. asks why it’s so hard to migrate schemas in .NET. Amir says that it’s due to our fixation on trying to define our models using code first in .NET types rather than in the database.
    • Jon asks how the first deployment and upgrade scenarios work in Oak.
    • Jon asks how Ajax interactions work. Amir explains how this works using the TaskRabbit sample to explain.
    • Amir explains how he’s relying on client-side rendering and templating more and more. He asks if we’re seeing that movement as well, and Scott K. agrees with him. They agree that focusing on serving JSON and rendering on the client solves a lot of problems.
    • Jon asks Amir if he’s using one controller to serve HTML and JSON, or if they’re split out. Amir says he’s got one controller to serve the HTML, then does everything else via a separate controller that serves JSON. He says he’s noticed that the ORMs have very little need for state with this approach.
    • Jon says he’s seeing the shift from a little Ajax interaction in mostly HTML focused servers to servers that are almost completely focused on serving JSON.
  • Some misc. questions
    • Jon asks about Canopy. Amir describes how Canopy is a stabilization layer on top of Selinium, and talks about why Canopy is built on top of F#.
    • Scott K. asks if Amir has looked at OWIN yet.
    • Jon asks about Async support in Oak.
    • Twitter question from Bobby Johnson: What do you do to limit the viral nature of dynamic in your code? Amir and Jon talk about how a lot of the assumed safety of static code is an illusion when you think about all the moving parts you’ve got no control over.
    • K. Scott and Scott K. think this is a fascinating project and like the code.
    • Scott K. and Jon joke about variants. Amir mentions that the dynamic nature of Gemini means that all the dynamic properties and methods are case insensitive.
  • Wrap up and getting started with Oak
    • Amir talks about how to get started with Oak.
    • Jon says the sample apps, documentation and screencasts are really nice.
    • Jon asks what’s next. Amir lists a better SPA story, better file uploads, adding dynamic to ServiceStack and Nancy, and growing the number of Gemini modules.
    • Kevin asks about the performance impact of this dynamic focus. Amir that he’s got an included test, and he’s found that dynamic is actually faster in a lot of cases which need to use reflection, such as ORMs, JSON serialization, and model binding.
    • Amir calls out the NSpec project and references their interview on Hanselminutes.

Show Links: