Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Show Notes:

Jon asks for a quick overview of NancyFx. Steve and Andreas both say you can write the same app on any number of web frameworks, so what really distinguishes them is the syntax and feel. Andreas says that the web only has a small set of things you really can do – there are only a few HTTP methods – but an infinite number of ways you can build applications; Nancy is one of them.

Diagnostics

Andreas says Diagnostics is a website built into Nancy itself. It covers things like request tracing and interactive diagnostics.

Steve explains how the interactive diagnostics lets you find out what routes were hit and why, poke at live code, etc.

Andreas says this works using companion classes for metadata which is then rendered via JavaScript templates, so you can customize it as much as you want.

Jon says the code for Diagnostics seems like pretty good sample code for getting an idea of how Nancy code works.

Jon asks about how authentication is handled to restrict access.

Steve says they’re using Handlebars for JavaScript templates with Backbone and Nancy on the back end.

Content Negotiation

Andreas explains how routes just return models, and the formatting is handled by response processors. There’s a syntax to allow for more control at the route level if needed.

Steve says the response processors are allowed to participate in the selection by specifying how applicable they are for both content types and model types. The content negotiation can also allow you to select different models based on the request, avoiding unnecessary code from executing and weighing the model down unnecessarily.

Serializers and dependencies

Jon asks about the JSON serializers they’re using, and why they’re not using something like ServiceStack or JSON.NET. Andreas explains that because the Nancy core ships without dependencies, they used Mono code.

Jon asks about where Nancy can be be embedded, outside of standard web hosting scenarios.

Steve says that because Nancy doesn’t have other dependencies and is strictly focused on returning a response for a request, it’s extremely easy to test.

Andreas points out that you can use other serializers very easily via a NuGet package.

Jon asks about how packages work in Nancy. Andreas explains how Nancy scans for classes that implement ISerializer.

Kevin asks about implementing a processor for generating hyperlinks between models.

Jon asks if people are sharing processors. Steve says that they’re so trivial to write that there’s no real point in sharing them.

Localization

Andreas says this was a community contribution. There are several conventions (including querystring values, URL segments) which can be used to set the culture for the context. There’s a helper on the Razor base class that returns a dynamic object which can return localized values from a resource. Assembly resources are used by default, but you can add others.

Steve says that you can also use localized views based on filename.

Jon asks for more information on how you’d set up a custom resource location.

Architecture, pipelines, and IoC

Jon says that he spoke with Jeremy Miller at Codemash, and Jeremy said that it took a while to get the processor architecture set up, but now it’s very easy to add in features. It seems like that’s also paid off for Nancy. Andreas agrees, the pipeline system and dependency injection really simplify adding in new features.

Jon asks about how Nancy uses TinyIoC and how you could use TinyIoC in other applications.

Kevin and Jon ask about how Steve wrote TinyIoC to run on multiple platforms. Steve describes some issues they’ve worked around and how assembly scanning can get tricky due to test frameworks injecting things into the app domain.

Non-standard uses of Nancy

Jon asks for some examples. Steve says they seen people embed it into WPF applications for an interface, to provide mobile support, and even on Raspberry Pi. They’d love to hear more about what people are doing with it.

Questions from Twitter / Misc. Questions

Jim Liddell (@liddellj) asks about the roadmap. Steve talks about work they’re doing for OWIN and Async support.

This entry was posted
on Friday, January 18th, 2013 at 3:32 pmand is filed under podcast.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

http://twitter.com/MhmmdAb Mohammad Abdulfatah

It only dawned on me after listening to this show that one of the masterminds behind NancyFX is also the author of TinyMessenger, which is the simplest and most elegant in-process messaging system that I’ve ever used. I have been using it in games made with Unity and it’s been a godsend. Thank you both.