Next-generation Asp.net development specification OWIN (1) -- background and brief introduction of OWIN, asp. netowin

Source: Internet
Author: User

Next-generation Asp.net development specification OWIN (1) -- background and brief introduction of OWIN, asp. netowin

With the release of VS2013, Microsoft introduced many new features in Asp. Net, such as using the new permission verification module Identity and Async to improve the Web server throughput and efficiency. One of them has to mention OWIN and Katana. the full name of OWIN is Open Web Interface. net, OWIN is. developed by the Net open-source community based on Ruby. net Web development architecture, which has a very simple standard definition and greatly reduces inter-module coupling. OWIN is not a specific implementation, but a specification used to guide how to build a Web ecosystem that complies with the OWIN standards. Microsoft introduced and promoted OWIN and implemented Katana in accordance with the owin specification.

In this case, OWIN will make Asp.net shine in the second spring. Next, let's take a step closer to OWIN and Katana.

Reading directory:

I. Review the development history of Asp.net

Ii. Solution

Iii. OWIN Introduction

4. OWIN prospects and predictions

I. Review the development history of Asp.net

Unconsciously, Asp.net has been with us for more than 10 years and gradually enters the middle age. In the face of the ever-changing Web development revolution, Asp.net has become somewhat inadequate. Why is this happening? Let's review the development history of Asp.net:

Asp stage

The Web was initially developed using Asp, a scripting language embedded in the page. The advantage of Asp is that it is simple and easy to use, but with the growing complexity of development and the increasing size of Web programs, Asp, a development method that combines logic code with page Html, is no longer able to adapt.

Asp.net Web Form stage

Due to Asp's short board, it is inevitable to upgrade Asp to build a new Web development platform. I guess Microsoft may want to allow developers on Winform to easily migrate to Web development, so it created a development process similar to Winform and its development method, which is Asp. Net.

Asp.net Web Form was undoubtedly advanced at the time, but over time, some of its problems were also exposed:
Most of the core classes in Asp.net are included in System. web. dll, while System. web. dll is included in. net Framework, which means that if you want to release a new version of Asp.net. net Framework is released together, which reduces the Asp.net update frequency. In addition, System. Web. dll is coupled with IIS, so that the Asp.net program cannot be migrated to other servers.

Positive changes

The new Asp.net MVC changes the shortcomings of the past and is released independently of the. Net Framework. Therefore, the version changes of MVC can be developed and released quickly without being subject to the. Net Framework. MVC development project team.
Furthermore, when developing and releasing Web APIs, we did not even use any types contained in System. Web. dll, which means:

  • Web APIs are completely independent from external sources. They are quickly released and updated through Nuget.
  • Does not rely on System. Web. dll, which means it does not rely on IIS services. Therefore, Web APIs can run in other host processes, such as console programs and windows Services.

Future: a more flexible framework

By deconstruct a framework component in Asp.net development, Microsoft can quickly iterate and release a new version through Nuget, and add new enhancement features.
In the future, a more flexible framework means that we can combine these components based on the project needs and run them on the supported Host.

Ii. Solution

Before introducing OWIN, we will proceed to the process from Web request to responseAbstraction:
The whole process of a Web request is a simple input and output. The input is the header information, cookie, data, and other information contained in the request. The output is the final Html. it is like putting the flour in, and the last thing is the steamed bread. However, changing from flour to steamed bread requires many processes. This process forms the entire process. Similar to the decorator mode, each decorator object follows the same interface, so that we can splice different decorator.

It is a reference to the WSGI specification (python Web Server Gateway Interface) in Python, which is similar to the OWIN mentioned below. The Request passes through layer-by-layer onion skins and is finally output. The onion skins on this layer are our components that comply with the OWIN specifications.

OWIN is a specification based on the above ideas and objectives, and does not contain any specific implementation.. The purpose is to isolate an abstraction layer between the web server and the application to decouple them.
The OWIN design has two goals: simple and less dependent on other framework types.
In this way, you can:

  • New components can be easily developed and applied
  • The program can be easily migrated on the host and OS

Core OWIN Definition

OWIN simplifies request, response, session, cookie, and other related information in the web application into the following dictionary.. Essentially, this dictionary contains all the context information of a web request.
A owin-compliant web server needs to package the request information into the following dictionary type and pass it to the next layer. The next layer of components or applications must read and modify the dictionary data. Finally, the Web server obtains the dictionary that has been processed layer by layer, and then outputs the webpage to the client.

IDictionary<string, object>

The following is a specific definition.

Key Name

Value Description

"owin.RequestBody"

A Stream with the request body, if any. Stream. Null MAY be used as a placeholder if there is no request body. See Request Body.

"owin.RequestHeaders"

AnIDictionary<string, string[]><string, string[]=""> Of request headers. See Headers.

"owin.RequestMethod"

AstringContaining the HTTP request method of the request (e.g ., "GET","POST").

"owin.RequestPath"

AstringContaining the request path. The path MUST be relative to the "root" of the application delegate; see Paths.

"owin.RequestPathBase"

AstringContaining the portion of the request path corresponding to the "root" of the application delegate; see Paths.

"owin.RequestProtocol"

AstringContaining the protocol name and version (e.g. "HTTP/1.0"Or"HTTP/1.1").

"owin.RequestQueryString"

AstringContaining the query string component of the HTTP request URI, without the leading "?" (E.g .,"foo=bar&baz=quux"). The value may be an empty string.

"owin.RequestScheme"

AstringContaining the URI scheme used for the request (e.g ., "http","https"); See URI Scheme.

Another core is application delegate.This is the interface that all components running under the OWIN protocol must follow.

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

The reason for this definition is:

  • Since there are few dependencies, it is very easy and simple to write a component.
  • Asynchronous Design makes the program run more efficiently, especially when I/O intensive operations are encountered.
  • Application delegate is the smallest unit that can be executed. OWIN components can easily connect to each other to form an Http processing pipeline.
4. OWIN prospects and predictions

The use of the OWIN specification accelerates the evolution of Asp.net and responds quickly to new things.

With the development of OWIN, more and more OWIN-based application frameworks (middleware) will emerge in the future, and more owinhosts will emerge. One is that Microsoft preemptible Katana, it can run on Windows, and is independent of IIS. It provides host support for frameworks that support the OWIN protocol; the other one is the Jexus Web Server that runs on Linux and FreeBSD to support the OWIN protocol (Jexus 5.6 or later is required ).

Although Asp. Net is very old, it is getting more and more popular now, young guys have something, it also has, and will be more sensitive to fashion in the future. It has a stable and mature temperament, but it is difficult for other young people to possess. This is the best time of. Net, isn't it?


What is a piece of vb code?

Dim oShellApp: Set oShellApp = CreateObject ("Shell. Application ")
Define a Shell object variable and initialize it as a Shell object reference.
Dim oShellAppWindows: Set oShellAppWindows = oShellApp. Windows
Defines a window object set and initializes the reference of the window object set.
Dim owin
Define a window object variable
'Retrieve the pop-up IE window
For Each owin In oshellappwindows' get the pop-up IE window
In the oShellAppWindows window object collection, traverse every window object assigned to the owin variable
If LCase (TypeName (owin. Document) = "htmldocument" And _
InStr (1, owin. LocationName, IeTitle, vbTextCompare)> 0 then' if the IE window meets the condition is found
Determine if the window type is htmldocument and the window title name contains the text of the IeTitle variable, find the window that meets the criteria
GetIeHtml = owin.Document.activeElement.Document.doc umentElement. innerHTML
GoTo mend' exit
End If
Next

Mend:
The last three statements release references to object variables.
Set oShellAppWindows = Nothing
Set oShellApp = Nothing
Set owin = Nothing

This is a detailed explanation.

Owin is a brand of air enable

Never heard
If you want to buy an airenable water heater, you are advised to check this product.
Here I will talk about the top ten brands of Air Energy
1 neentai Air Energy International famous brand global benchmark enterprise in the New Energy Industry
2. One of the largest air production bases of China's aerospace industry partners
Midea air conditioner | the market share of air energy water heater brands ranks first
4 gree air conditioners | the second largest market share of air energy water heaters
5 Jinjiang bailang Air Energy brand air energy water heater Sino-British Joint Venture High-tech Enterprises
6 Zhigao China Famous Brand, China well-known trademark, air energy water heater professional manufacturer
7 Jin long heat pump/air energy water heater, the world's first international copper industry association, board of directors
8. Zhenxin thermal energy, one of the first well-known trademarks in China, was shortlisted as one of the national "energy-saving and benefiting-benefiting" Enterprises.
9 Tsinghua Ziguang Air Energy brand one of the earliest Enterprises in China's air energy industry
One of the large scale Air Energy Enterprises in China
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.