[[Open棟梁Project>http://opentouryo.osscons.jp/]] - [[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]

-[[戻る>ASP.NET]]

* 目次 [#ob1efb64]
#contents

*概要 [#g0f9dd7b]
OWIN(Open Web Interface for .NET)
-.NETのWebサーバとWebアプリケーション接続するためのインタフェース。
-新しい HTTP Server のプログラミング抽象化レイヤーを定義する。
-OWIN 統合により、One ASP.NET の Pluggable を促進する。
-OWINのリファレンス実装は「Katanaプロジェクト」。

**経緯 [#s2fe2e19]
-昨今、色々と技術的な変化が早いため、
--MVC 1-5 は.NET Frameworkのサイクルから外れ、
--また、System.Webからの脱却が必要になってきてOWINが登場した。

-OWINが達成したこと。
--System.Webから脱却し、性能の向上を可能にした。
--.NET Frameworkのサイクルから外れた早いリリースを可能にした。

**主要なデータ構造 [#z3da880d]
***environment dictionary [#ac5fcdac]
-HTTPContextから脱却し、環境を保持する environment dictionary。
-HTTP request and response を処理するのに必要なデータは保持される。

 IDictionary<string, object>

***application delegate [#z5026963]
コンポーネントの間は下記の function signature で呼ばれる。

 Func<IDictionary<string, object>, Task>;

*Startup.cs [#n017a299]
OWINはミドルウェアをつなげたパイプラインとして全体を処理する。~
Startupクラスは、このパイプラインを指定して使用できるようにする。

**OWIN化手順 [#q6af4660]
Startupクラスを追加して、~
パイプラインのコンポーネント(=ホスティング ランタイム)を指定する。

-OWIN Startup Class Detection | The ASP.NET Site~
https://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection
>Every OWIN Application has a startup class where you specify components for the application pipeline.~
There are different ways you can connect your startup class with the runtime,~
depending on the hosting model you choose (OwinHost, IIS, and IIS-Express). 

-Katana で Hello, world - miso_soup3 Blog~
http://miso-soup3.hateblo.jp/entry/2013/11/11/014258

**ホスティング ランタイム [#le7af00c]
***IIS [#s102fafa]
-IIS でホストするには、Microsoft.Owin.Host.SystemWebを使用する。

-NuGet で「Microsoft.Owin.Host.SystemWeb」をインストール。
 install-package Microsoft.Owin.Host.SystemWeb

-System.WebのパイプラインをOWINのパイプラインに流すことができる。
-これにより、OWINのミドルウェアをASP.NET Web Formsや、MVC 5でも使用できる。

***OwinHost.exe [#ibe04f08]
-Katana の OwinHost.exe でホストするには、OwinHostを使用する。

-NuGet で「OwinHost」をインストール。
 install-package OwinHost

**OWINのパイプラインとMiddleware作成 [#o8b46ad1]
この「ミドルウェア」を自作すればパイプライン処理の挙動をカスタマイズできる。

-neue cc - OWINのパイプラインとMiddleware作成ガイド~
http://neue.cc/2014/01/06_442.html

**参考 [#tef95456]
-Understanding ASP NET 5 Application Startup File Startup.cs in Visual Studio 2015 - YouTube~
https://www.youtube.com/watch?v=oK1M2lLEU0M

-asp.net mvc - What is the new Startup.cs file for in Visual Studio 2013 projects? - Stack Overflow~
http://stackoverflow.com/questions/20034105/what-is-the-new-startup-cs-file-for-in-visual-studio-2013-projects

*[[ASP.NET Identity]] [#x8cab528]

*OWIN is dead ? [#o8448c24]
以下に「これからは ASP.NET 5。(死に切ってはいないけれど) OWIN is dead!!」とある。

-ASP.NET 5はどうしてOWIN上に乗らなかったのか - xin9le.net~
http://blog.xin9le.net/entry/2015/01/18/161631

今では完全に OWIN と Katana Project は止まっているらしい。~
# ASP.NET 5は、現在は[[ASP.NET Core]]と名称が変更されている。

*参考 [#o5fab226]
-OWIN - Open Web Interface for .NET を使う — Kyrt Blog~
http://kyrt.in/2013/12/17/owin_azure_cache_session_middleware.html

-【.NET定期勉強会@Sansan完全レポート】第3回~
OWINって何?Microsoft MVPに聞いてみよう!(その1)~
| エンジニア勉強会 | Sansan株式会社 - クラウド名刺管理~
http://jp.corp-sansan.com/news/2014/140929_4597.html

--OWIN って何?~
http://www.slideshare.net/miso_desu/owin-34791501

-neue cc - OWINの仕組みとOWIN上のフレームワーク(ミドルウェア)の作り方~
http://neue.cc/2014/05/13_473.html

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS