Owin/Katana是否应该替换Web API? [英] Is Owin/Katana supposed to replace Web API?

查看:125
本文介绍了Owin/Katana是否应该替换Web API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当ASP.NET MVC出现时,微软在许多地方多次宣布它不应该取代ASP.NET Web窗体.换句话说,这只是您可能会发现有用的另一种技术,或者您可能在其他情况下使用Web窗体.

When ASP.NET MVC came, Microsoft announced many times in many places that it wasn't supposed to replace ASP.NET Web Forms. In other words, it's just another technology that you might find useful, or you might use Web Forms in other scenarios.

但是,随着公司进入市场,他们不可能拥有太多的技术,因为那太昂贵了.他们通常会选择一种成熟的技术,坚持下去,在它的基础上进行扩展,然后再使用其中的元素以降低成本.

However, as companies enter into the market, they can't have a jungle of technologies, because that's too expensive. They usually select a mature technology, stick to it, build on it and extend it and reuse elements in it to reduce costs.

现在,我们正试图决定从Web API迁移到Owin/Katana.我们只是想知道我们100%迁移到Owin是否可以?

Now we're trying to decide to move to Owin/Katana from Web API. We just wonder if it's OK that we move 100% to Owin?

我问这个问题的原因是因为我们为Web API创建了非常丰富的代码库,包括流,压缩,身份验证,UGC的规范化,对I18N的支持. L10N等.

The reason I'm asking this question is because we've created a very rich codebase for Web API, including streaming, compression, authentication, normalization of UGC, support of I18N & L10N, and more.

如果要迁移到Owin,我们需要为Owin重新创建这些工具,因为它的体系结构与Web API不同.

If we want to move to Owin, we need to re-create these facilities/utilities again for Owin, because its architecture is different from Web API.

我们希望迁移到Owin,因为它是一种更快,更轻便的自托管服务器,并且似乎是Microsoft服务技术的未来.

We want to move to Owin, because it's faster, lighter, self-hosted server, and seems to be the future of service technologies from Microsoft.

对于我们来说,完全迁移到Owin并设想一个未来,即通过Owin提供我们所有服务,而我们不再使用Web API,是否安全?

Is it safe for us to move to Owin completely and imagine a future in which all of our services are delivered through Owin, and we discontinue using Web API?

推荐答案

OWIN只是一个规范,仅此而已.它描述了服务器和应用程序都可以使用的通用接口,因此应用程序不需要与服务器紧密耦合.

OWIN is just a specification, nothing more. It describes a common interface that servers and applications can both use, so that applications don't need to be tightly coupled to servers.

Katana是将ASP.NET与IIS分离的第一步.根据官方路线图,在Katana上的工作已停止.为片假名开发的思想和技术已进入下一版ASP.NET(ASP.NET Core).

Katana was the first step towards decoupling ASP.NET from IIS. Work on Katana has stopped now, according to the official roadmap. The ideas and technologies developed for Katana have made their way into the next version of ASP.NET (ASP.NET Core).

在OWIN本身之上构建应用程序几乎没有任何意义,因为您所使用的是HTTP之上的最低抽象级别(实际上是处理原始请求和响应).通常只有在构建需要低级访问的中间件组件时才需要.

It rarely makes sense to build applications on top of OWIN itself, because you're operating at the lowest level of abstraction above HTTP (literally dealing with raw requests and responses). That's usually only necessary if you are building middleware components that need low-level access.

换句话说:您不应该在OWIN上重建应用程序,因为您将花费大量时间来重新发明ASP.NET中已经存在的所有内容.

In other words: you shouldn't rebuild your application on OWIN, because you'd be spending a lot of time reinventing all of the stuff already in ASP.NET.

ASP.NET Core 是ASP.NET的下一个发展和Web API.它具有您提到的所有内容:快速,轻巧并且可以自我托管.如果需要重建体系结构,请在ASP.NET Core上进行.

ASP.NET Core is the next evolution of ASP.NET and Web API. It has all the things you mentioned: it's fast, lightweight, and can self-host. If you need to rebuild your architecture, do it on ASP.NET Core.

这篇关于Owin/Katana是否应该替换Web API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆