OWIN & Katana 
Fabian Vilers 
@fvilers 
http://www.linkedin.com/in/fvilers
Who am I ? 
Entrepreneur 
.NET Software Craftsman 
Role Play Gamer 
Music Addict 
Basket-Ball Fan 
Poker Player
Who are you ?
Motivations 
Source: http://xkcd.com/844
Motivations 
Challenges raised by the historical model 
Classic ASP (1996) 
ASP.NET (2002) 
Evolutionary steps 
ASP.NET MVC (2009) & ASP.NET Web API (2012) 
The future 
A nimble framework 
Equally simple as starting with Node.js
Classic ASP
Classic ASP 
Dynamic and data-driven 
Server-side scripts 
Abstraction of HTTP protocol and web server 
Challenging as growing in size and complexity 
Lack of structure 
Duplication of code
ASP.NET
ASP.NET 
Object-oriented 
Similar design time experience for WinForms developers 
Rich set of user interface controls and infrastructure features 
Server-side event model 
Hide as much as possible the web’s stateless nature 
Tighly coupled with System.Web.dll and IIS 
Included as part of the .NET framework
ASP.NET MVC
ASP.NET MVC 
Small, focused and pluggable components 
Greater control over application and markup 
Not included in .NET framework and released as an independant download 
Static markup with dynamic sections 
Client scripting and AJAX friendly
ASP.NET Web API 
ASP.NET MVC helped the rise of Web APIs 
Evolved from ASP.NET MVC as a more modular framework 
Released via NuGet packages and iterated more indenpendently 
No dependencies to System.Web.dll thus, no dependencies to IIS 
Capable to run in a custom host
OWIN 
Open Web Interface for .NET 
Decouple server and application to create an abstraction 
As few as possible dependencies on other framework types 
New components could be more easily developed and consumed 
Applications are more easily ported between hosts, plateforms and operating systems 
Stimulate the open source ecosystem 
Inspired by the benefits achieved by Rack (Ruby community)
OWIN 
Two core elements 
Environment dictionary populated by the OWIN web server 
Application delegate that accepts the environment dictionary as input and output a task 
Very small number of dependencies 
Asynchronous design 
Atomic unit of execution
OWIN Pipeline 
Host 
•IIS 
•OwinHost.exe 
•Custom 
Server 
•System.Web 
•HttpListener 
•WebListener 
Middleware 
•Authentication 
Middleware 
•Logging 
Application 
Framework 
•Web API 
•SignalR 
Application 
•Your app
Project Katana 
Building and hosting OWIN-based web applications 
Portable 
Components should be substituable for new components 
Modular, flexible 
Components should be small and focused 
Lightweight, performant, scalable 
Components are explicitly added to the pipeline 
Consume fewer resources and handle more load
Let’s write some code!
Links 
OWIN Specification: http://owin.org/spec/owin-1.0.0.html 
Katana Project: http://katanaproject.codeplex.com 
Code from the demo: https://github.com/fvilers/OWIN-Katana

Owin & katana

  • 1.
    OWIN & Katana Fabian Vilers @fvilers http://www.linkedin.com/in/fvilers
  • 2.
    Who am I? Entrepreneur .NET Software Craftsman Role Play Gamer Music Addict Basket-Ball Fan Poker Player
  • 3.
  • 4.
  • 5.
    Motivations Challenges raisedby the historical model Classic ASP (1996) ASP.NET (2002) Evolutionary steps ASP.NET MVC (2009) & ASP.NET Web API (2012) The future A nimble framework Equally simple as starting with Node.js
  • 6.
  • 7.
    Classic ASP Dynamicand data-driven Server-side scripts Abstraction of HTTP protocol and web server Challenging as growing in size and complexity Lack of structure Duplication of code
  • 8.
  • 9.
    ASP.NET Object-oriented Similardesign time experience for WinForms developers Rich set of user interface controls and infrastructure features Server-side event model Hide as much as possible the web’s stateless nature Tighly coupled with System.Web.dll and IIS Included as part of the .NET framework
  • 10.
  • 11.
    ASP.NET MVC Small,focused and pluggable components Greater control over application and markup Not included in .NET framework and released as an independant download Static markup with dynamic sections Client scripting and AJAX friendly
  • 12.
    ASP.NET Web API ASP.NET MVC helped the rise of Web APIs Evolved from ASP.NET MVC as a more modular framework Released via NuGet packages and iterated more indenpendently No dependencies to System.Web.dll thus, no dependencies to IIS Capable to run in a custom host
  • 13.
    OWIN Open WebInterface for .NET Decouple server and application to create an abstraction As few as possible dependencies on other framework types New components could be more easily developed and consumed Applications are more easily ported between hosts, plateforms and operating systems Stimulate the open source ecosystem Inspired by the benefits achieved by Rack (Ruby community)
  • 14.
    OWIN Two coreelements Environment dictionary populated by the OWIN web server Application delegate that accepts the environment dictionary as input and output a task Very small number of dependencies Asynchronous design Atomic unit of execution
  • 15.
    OWIN Pipeline Host •IIS •OwinHost.exe •Custom Server •System.Web •HttpListener •WebListener Middleware •Authentication Middleware •Logging Application Framework •Web API •SignalR Application •Your app
  • 16.
    Project Katana Buildingand hosting OWIN-based web applications Portable Components should be substituable for new components Modular, flexible Components should be small and focused Lightweight, performant, scalable Components are explicitly added to the pipeline Consume fewer resources and handle more load
  • 17.
  • 18.
    Links OWIN Specification:http://owin.org/spec/owin-1.0.0.html Katana Project: http://katanaproject.codeplex.com Code from the demo: https://github.com/fvilers/OWIN-Katana