ASP.NET Core 与 .NET Core 演变与基础概述

https://github.com/dotnet/core
https://github.com/aspnet/home

今天看到 .NET Core 的改名计划,感觉跨平台的时代快要来了,从之前的 ASP.NET NEXT,ASP.NET 5,ASP.NET Core 1.0 等概念一路演变过来,花了点时间总结一下几个相关的概念。

OWIN 与 Katana 的关系

ASP.NET Core 1.0 的由来,要追溯到 Katana 这个项目, Katana 是 OWIN 定义规范的一个实现组件集合。

Open Web Interface for .NET (OWIN)

OWIN 是 Open Web Server Interface for .NET 首字母缩写,OWIN 定义了 Web 服务器和应用程序组件之间的交互的规范(specifications); OWIN 在 .NET Web 服务器和 .NET Web 应用之间定义了一套标准的接口,其目的是为了实现服务器与应用之间的解耦。由于这一规范的目的是发展一个广阔且充满活力的、基于 Microsoft .NET Framework 的 Web 服务器和应用程序组件生态系统,因此它可以将服务器与应用程序之间的交互减少到一小部分类型和单个函数签名,这个函数签名被称为应用程序委托(即 AppFunc)

using AppFunc = Func< IDictionary<string, object>, Task>;

Owin定义规范

OWIN

  • 服务器 (Server)

    HTTP 服务器直接与客户端交互, 并用 OWIN 语义处理请求, 服务器需要一个适配层将客户请求转换成 OWIN 语义。 支持 OWIN 的服务器有 KatanaNowin

  • Web 框架 (Web Framework)

    构建在 OWIN 之上的自包含的独立组件, 向 Web 应用提供可用的对象模型或者接口。 Web 框架可能需要一个适配层来转换 OWIN 语义。 支持 OWIN 的 Web 框架有:

  • Nancy
  • SignalR
  • WebApi
  • FubuMVC
  • Simple.Web
  • DuoVia.Http
  • Web 应用 (Web Application)

    一个特定的 Web 应用, 通常构建在 Web 框架之上, 使用 OWIN 兼容的服务器运行。

  • 中间件 (Middleware)

    特定的目的的服务器和应用之间的可插拔组件, 可以监视、 路由、 修改请求与响应。

  • 宿主 (Host)

    应用与服务器所在的进程, 主要负责应用的启动, 有些服务器自身也是宿主, 比如 Nowin 。

Katana

Katana 是 OWIN 规范定义实现的一个组件和框架集合,可以按其中每个层都能够轻松替代的方式来解耦;OWIN 与 Katana 是 ASP.NET 5 之前东西,关于 host, server,middleware 相关实现的源码可以在github上找到(https://github.com/aspnet/AspNetKatana),之前实现的 OAuth 2.0 认证授权 也都是基于 Microsoft.Owin.Security.OAuth 来实现的,不过现在 MS 已经不更新新的功能了(常规 fix bug); ASP.NET Core 是支持 OWIN 定义的实现的,也就是 ASP.NET Core 重新设计的 HttpAbstractions 子集,定义在 Microsoft.AspNetCore.Owin 包中。

KatanaASP.NET Core 对应关系

Many of the components, features, and models of Katana are now part of the ASP.NET Core project on GitHub. See https://github.com/aspnet/home for details. We still plan to release updates to Katana itself to address common problems and keeping it up-to-date.

Here is a list of Katana components and where you can find their ASP.NET Core counterparts:

ASP.NET 5 与 ASP.NET Core 1.0

如果还不晓得ASP.NET Next 与.NET Core是什么,可以先补充下知识

魅力 .NET:从 Mono、.NET Core 说起

vNext之旅(1):从概念和基础开始

image

今天看到了 ASP.NET 5 is dead - Introducing ASP.NET Core 1.0 and .NET Core 1.0 ,虽然只是改名字,但是觉得微软这次对.NET与 ASP.NET设计的非常好,之前命名的名词与版本号确实太多总是感觉怪怪的[ASP.NET vNext => ASP.NET 5 => ASP.NET Core 1.0],晚上查了查相关文章,大致了解一下。之前偶尔https://docs.asp.net/en/latest/上面的文档,以及http://www.asp.net/ 时常还有 ASP.NET vNext的影子,现在已经没有了,按照线路图的发展,估计在2016年3月份会RTM[时间暂定了]。

重新命名版本号

重新引入

CLI在MAC下安装也很简单,下载包NEXT即可,现还没有CentOS的包。

ASP.NET Core 下有哪些包

https://docs.microsoft.com/zh-cn/aspnet/core/api/#namespaces-in-the-aspnet-core-class-library

REFER:
owin
http://owin.org/
Katana
https://github.com/aspnet/AspNetKatana
ASP.NET Core Schedule and Roadmap
https://github.com/aspnet/home/wiki/roadmap/
ASP.NET Core doc
https://docs.microsoft.com/zh-cn/aspnet/core/
Katana 项目入门
https://msdn.microsoft.com/zh-cn/magazine/dn451439.aspx
Exploring the new .NET "dotnet" Command Line Interface (CLI)
http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx
Announcing ASP.NET 5 Release Candidate 1
http://blogs.msdn.com/b/webdev/archive/2015/11/18/announcing-asp-net-5-release-candidate-1.aspx
ASP.NET 5 and .NET Core RC1 in context (Plus all the Connect 2015 News)
http://www.hanselman.com/blog/ASPNET5AndNETCoreRC1InContextPlusAllTheConnect2015News.aspx
ASP.NET 5 已终结,迎来 ASP.NET Core 1.0 和 .NET Core 1.0
http://www.oschina.net/news/70049/aspnet5-is-dead-introducing-aspnet-core-1-0-and-netcore-1-0

原文地址:https://www.cnblogs.com/Irving/p/5146976.html