When should I use OWIN Katana?

解答1

In asp.net WebApi v2, the OWIN pipeline becomes the default. It is eventually going to be the standard pipeline under any asp.net project.

I cannot put it better than what is written here : http://www.asp.net/aspnet/overview/owin-and-katana/an-overview-of-project-katana

The section "The Open Web Interface for .NET (OWIN)" explains perfectly the goals of OWIN.

Without OWIN, the asp.net bits are coupled to the way IIS communicates with the application. OWIN abstracts web servers and framework components. That means that your application code will now be aware of the OWIN interface, but not of the webserver that is serving the request.

In return, applications can be more easily ported between hosts and potentially entire platforms/operating systems. For example, the ability to host an application in a console or any process allows Mono to host it without efforts... (Raspberry Pi anyone)

The second aspect is that it works as a pipeline.



You can plug any middlewares (and as many as you want) between the webserver and your application.
This allows for more modular solutions. You can develop redistributable
middlewares that can impact the request/response coming to/from your
application, but keep these modules separated from the application code.

To persuade yourself of the benefits of this modular approach, take a look at the nuget packages available for OWIN : http://www.nuget.org/packages?q=owin

A lot of these packages were previously core asp.net functionality, and have been extracted as middleware.
For example, adding support to login using various OAuth providers
becomes an infrastructure concern (a middleware) and does not need to be
part of your application code anymore :

Or if you want to automatically replace all the images from your
website by cute cat images, you can do that transparently as well :

https://github.com/serbrech/Owin.Catify

EDIT : It is now available as a nuget package : Owin.Catify!

 

解答2

A simpler version of that answer is that Katana is gong to fully replace System.Web assembly and the old ASP.NET pipeline, which gives you both better flexibility (use it in more scenarios and use only the parts you like) and performance.

So everyone should watch its evolution now and be ready to switch when it is finally completed.

Below is a diagram I drew to fill in the details Microsoft fails to include in this article.

OWIN is such a standard that it let application frameworks run upon it and forget about everything beneath it. On the other hand, OWIN itself utilizes various host adapters to make sure it can talk to the underlying web servers (IIS and many others).

I am now working with the Jexus web server author to investigate how we can write a host adapter to bridge OWIN/Katana and Jexus. We are really happy to learn that OWIN is flexible and highly customizable.

Reference: http://blog.lextudio.com/2014/06/why-owin-matters-a-lot-for-asp-net-developers/

When should I use OWIN Katana?的更多相关文章

  1. OWIN katana注册中间件的几种写法

    首先特别说明下在startup中注册完中间件的两个注意事项,看到有人写的东西有误导人的作用.关于startup启动发现类的内容,参照这里 http://www.asp.net/aspnet/overv ...

  2. OWIN,Katana,identity整体概述

    在用asp.net identity的时候,发现很多概念不是很懂,特地去查资料了解了一些相关信息,现在做下笔记. 1.OWIN,OWIN是Open Web Server Interface for . ...

  3. Owin Katana 的底层源码分析

    最近看了一下开源项目asp.net katana,感觉公开的接口非常的简洁优雅,channel 9 说是受到node.js的启发设计的,Katana是一个比较老的项目,现在已经整合到asp.net c ...

  4. Owin Katana 的分析介绍

    本文首要是对美团的分布式ID结构Leaf的原理进行介绍,针对Leaf原项目中的一些issue,对Leaf项目进行功用增强,问题修正及优化改善,改善后的项目地址在这里: Leaf项目改善计划 https ...

  5. OWIN and Katana

      OWIN(Open Web Interface for .NET)是在.net的web server和web应用之间定义了一套规范. Katana是微软实现了OWIN的一个Web Server的项 ...

  6. ASP.NET WebApi OWIN 实现 OAuth 2.0

    OAuth(开放授权)是一个开放标准,允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和密码提供给第三方应用. OAuth 允许用户提供一个令牌, ...

  7. Nancy之基于Nancy.Owin的小Demo

    前面做了基于Nancy.Hosting.Aspnet和Nancy.Hosting.Self的小Demo 今天我们来做个基于Nancy.Owin的小Demo 开始之前我们来说说什么是Owin和Katan ...

  8. ASP.NET MVC随想录——锋利的KATANA

    正如上篇文章所述那样,OWIN在Web Server与Web Application之间定义了一套规范(Specs),意在解耦Web Server与Web Application,从而推进跨平台的实现 ...

  9. NET WebApi OWIN 实现 OAuth 2.0

    NET WebApi OWIN 实现 OAuth 2.0 OAuth(开放授权)是一个开放标准,允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和 ...

随机推荐

  1. CodeForces - 512B Fox And Jumping[map优化dp]

    B. Fox And Jumping time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  2. tomcat配置JMX

    最近看JDK的命令行工具,使用Java VisualVM和Jconsole工具都可以监控java程序的运行情况(包括CUP和内存等的使用情况,线程的运行状态等) 在Java VisualVM 工具里可 ...

  3. 【转】DevOps的前世今生

    转自:http://www.infoq.com/cn/news/2016/09/learn-devops-from-reports 目前在国外,互联网巨头如Google.Facebook.Amazon ...

  4. Express框架(http服务器 + 路由)

    index.js 使用express框架搭建http服务器,和实现路由功能. var express = require('express'); var app = express(); // 主页输 ...

  5. 一键搞定JavaEE应用,JRE+Tomcat+Mysql-JaveEE绿色运行环境JTM0.9版 (转载)

    这是一个集成了jre,tomcat,mysql的绿色运行环境, 直接解压之后就可以运行.不需要用户自己安装jre,tomcat,mysql,一键到位,看起来像是桌面式的web应用.换句话说,就像是we ...

  6. Haskell中cabal install glib遇到的问题

    1. 运行命令cabal install glib时出现错误: Cannot find gtk2hsC2hs Please install `gtk2hs-buildtools` first and ...

  7. ora-00600错误解决一枚

    今天网友遇到ora-600错误,这里把这个ora-600错误的解决方法详细记录一下. 最初报错信息如下: ora-600-图1 ora-600-图2 图3 这里我们可以看到报错控制文件版本不一致,要求 ...

  8. Mixed Content: The page at 'https://a.t.com/login' was loaded over HTTPS, but requested an insecure stylesheet 非全站https

    Mixed Content: The page at 'https://a.t.com/login' was loaded over HTTPS, but requested an insecure ...

  9. python调用API

    相信做过自动化运维的同学都用过API接口来完成某些动作.API是一套成熟系统所必需的接口,可以被其他系统或脚本来调用,这也是自动化运维的必修课. 本文主要介绍Python中调用API的几种方式,下面是 ...

  10. the source attachment does not contain the source for the file xxx.class无法关联到某个类

    问题描述: 按下列操作添加相应路径(这里是错误操作) 该问题仍旧无法解决: 注意:这里spring-webmvc-4.1.7.RELEASE.JAR中确实包含AnntationMethodHandle ...