OWIN (Open Web Interface for .NET)

36
OWIN OWIN Open Web Interface Open Web Interface for .NET for .NET www.folio3.com @folio_3

Transcript of OWIN (Open Web Interface for .NET)

Page 1: OWIN (Open Web Interface for .NET)

OWINOWINOpen Web Interface Open Web Interface

for .NETfor .NET

www.folio3.com@folio_3

Page 2: OWIN (Open Web Interface for .NET)

Folio3 – OverviewFolio3 – Overview

www.folio3.com @folio_3

Page 3: OWIN (Open Web Interface for .NET)

Who We Are

We are a Development Partner for our customers

Design software solutions, not just implement them

Focus on the solution – Platform and technology agnostic

Expertise in building applications that are:

Mobile Social Cloud-based Gamified

Page 4: OWIN (Open Web Interface for .NET)

What We Do Areas of Focus

Enterprise

Custom enterprise applications

Product development targeting the enterprise

Mobile

Custom mobile apps for iOS, Android, Windows Phone, BB OS

Mobile platform (server-to-server) development

Social Media

CMS based websites for consumers and enterprise (corporate, consumer,

community & social networking)

Social media platform development (enterprise & consumer)

Page 5: OWIN (Open Web Interface for .NET)

Folio3 At a Glance Founded in 2005

Over 200 full time employees

Offices in the US, Canada, Bulgaria & Pakistan

Palo Alto, CA. Sofia, Bulgaria

Karachi, Pakistan

Toronto, Canada

Page 6: OWIN (Open Web Interface for .NET)

Areas of Focus: Enterprise Automating workflows

Cloud based solutions

Application integration

Platform development

Healthcare

Mobile Enterprise

Digital Media

Supply Chain

Page 7: OWIN (Open Web Interface for .NET)

Some of Our Enterprise Clients

Page 8: OWIN (Open Web Interface for .NET)

Areas of Focus: Mobile Serious enterprise applications for Banks,

Businesses

Fun consumer apps for app discovery,

interaction, exercise gamification and play

Educational apps

Augmented Reality apps

Mobile Platforms

Page 9: OWIN (Open Web Interface for .NET)

Some of Our Mobile Clients

Page 10: OWIN (Open Web Interface for .NET)

Areas of Focus: Web & Social Media Community Sites based on

Content Management

Systems

Enterprise Social Networking

Social Games for Facebook &

Mobile

Companion Apps for games

Page 11: OWIN (Open Web Interface for .NET)

Some of Our Web Clients

Page 12: OWIN (Open Web Interface for .NET)

www.folio3.com @folio_3

OWINOWINOpen Web Interface Open Web Interface

for .NETfor .NET

Page 13: OWIN (Open Web Interface for .NET)

www.folio3.com @folio_3

MotivationMotivation

Page 14: OWIN (Open Web Interface for .NET)

ASP.NET over the years

Introduced ASP.NET WebForms in 2002

Object-oriented

Similar design time experience for WinForms developers

Rich set of user interface controls and infrastructure features

Server-side event model

Monolithic Framework

Tighly coupled with System.Web.dll and IIS

Included as part of the .NET framework

Tied to .NET Framework releases

Page 15: OWIN (Open Web Interface for .NET)

ASP.NET over the years…(Continued)

Introduced ASP.NET MVC in 2009

Small, focused and pluggable components

Greater control over application and markup

Developed Out of Band – not included in .NET framework

and released as an independent download

Still tied to System.Web.dll -> dependencies to IIS

Client scripting and AJAX friendly

Page 16: OWIN (Open Web Interface for .NET)

ASP.NET over the years…(Continued)

Introduced ASP.NET Web Api in 2012

WCF to Web Api

No dependencies on System.Web.dll -> more modular

framework

Custom host! Developers can use a lightweight host for

their services

Page 17: OWIN (Open Web Interface for .NET)

ASP.NET Over the years…

Page 18: OWIN (Open Web Interface for .NET)

ASP.NET Web Hosting IIS – only available Hosting option Classic Mode – ASP.NET ISAPI extension / plugin Integrated Pipeline – ASP.NET Request Pipeline blended &

Integrated in IIS IIS Overhead

Packets Logging Application Lifecycle Management Security Hardening Health Monitoring

Each request needs to pass through ASP.NET Request Pipeline

Page 19: OWIN (Open Web Interface for .NET)

Modern Web Applications demand… Nimble Frameworks – Iterate more independently & more

quickly Standards Based Modular Pluggable components Composable Apps Fast & Lightweight Hosts – IIS might not be available Platform/OS agnostic

Page 20: OWIN (Open Web Interface for .NET)

Everyone does their own thing

ServiceStack

Nancy

Web API Self-Host

WCF Self-Host

OpenRasta

etc

Page 21: OWIN (Open Web Interface for .NET)

OWIN Open Web Interface for .NET

Inspired by the benefits achieved by Rack (Ruby community)

Specification – not implementation

Decouple server and applications/frameworks to create an abstraction

Bring forth hosting options other than IIS

Two Goals

New components could be more easily developed and consumed (OMC)

Applications are more easily ported between hosts, platforms and

operating systems

Stimulate the open source ecosystem

Page 22: OWIN (Open Web Interface for .NET)

OWIN – Terminology

Page 23: OWIN (Open Web Interface for .NET)

OWIN – Two Core elements Environment Dictionary – populated by OWIN Web Server

IDictionary < string, object >

“An OWIN-compatible Web server is responsible for

populating the environment dictionary with data such as

the body streams and header collections for an HTTP

request and response. It is then the responsibility of the

application or framework components to populate or

update the dictionary with additional values and write to

the response body stream.”

Page 24: OWIN (Open Web Interface for .NET)

OWIN – Environment Dictionary (Request Body)

Page 25: OWIN (Open Web Interface for .NET)

OWIN – Environment Dictionary (Response Body)

Page 26: OWIN (Open Web Interface for .NET)

OWIN – Two Core elements… Application Delegate – accepts the environment dictionary

and output a task

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

“The application delegate an implementation of the Func

delegate type where the function accepts the

environment dictionary as input and returns a Task.”

Interactions between the server and application

components occurs through calls to the AppFunc

delegate.

Page 27: OWIN (Open Web Interface for .NET)

OWIN Pipeline OWIN components can be easily chained together to create

complex HTTP processing pipelines

Each component in chain is termed as OMC (OWIN

Middleware component)

Middleware Delegate Signature:

Func < AppFunc, AppFunc >

Application is last component in chain

Page 28: OWIN (Open Web Interface for .NET)

OWIN Pipeline…

Request

Response

Page 29: OWIN (Open Web Interface for .NET)

Things you Might do in the Pipeline Open & Dispose Resources

Logging

Authentication

Authorization

Quick Monitoring endpoints

Sanitize Inputs

Content Negotiation

CORS

etc.

Page 30: OWIN (Open Web Interface for .NET)

OWIN Middleware

Page 31: OWIN (Open Web Interface for .NET)

Who is OWINed? Servers & Hosts

Katana Nowin Fracture

Frameworks Nancy SignalR WebApi FubuMVC Simple.Web DuoVia.Http ACSP.NET

Implementations ASP.NET vNext Katana Fix DyFrig

Page 32: OWIN (Open Web Interface for .NET)

Project Katana Open source components for building and hosting OWIN-

based web applications, maintained by the Microsoft Open

Technologies Group.

Include both infrastructure components, such as hosts and

servers, as well as functional components, such as

authentication components and bindings to frameworks

such as SignalR and ASP.NET Web API.

IIS is also not going anywhere – Katana does provide support

for it.

Page 33: OWIN (Open Web Interface for .NET)

www.folio3.com @folio_3

DemoDemo

Page 34: OWIN (Open Web Interface for .NET)

References http://owin.org/#start http://www.asp.net/aspnet/overview/owin-and-katana/an-overvi

ew-of-project-katana http://www.codeguru.com/csharp/.net/net_asp/overview-of-owi

n-and-katana.htm http://www.slideshare.net/betclicTech/mini-training-owin http://www.slideshare.net/c_horsdal/campus-days-2014-owin http://www.slideshare.net/damian-h/owin-from-spec-to-applicati

on http://www.slideshare.net/fvilers/owin-katana-38840810 http://www.asp.net/aspnet/overview/owin-and-katana/owin-mid

dleware-in-the-iis-integrated-pipeline

Page 35: OWIN (Open Web Interface for .NET)

References (Continued) http://dotnetcodr.com/2014/04/14/owin-and-katana-part-1-the-basics/ http://blogs.msdn.com/b/webdev/archive/2014/02/18/introducing-asp-

net-project-helios.aspx https://github.com/SignalR/SignalR-StockTicker http://www.codeproject.com/Articles/864725/ASP-NET-Understanding-

OWIN-Katana-and-the-Middlewa http://pluralsight.com/training/Player?author=scott-

allen&name=aspdotnet-mvc5-fundamentals-m6-ef6&mode=live&clip=0&course=aspdotnet-mvc5-fundamentals

http://www.tugberkugurlu.com/archive/logging-in-the-owin-world-with-microsoft-owin--introduction

https://msdn.microsoft.com/en-us/magazine/dn745865.aspx http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-

app-with-facebook-and-google-oauth2-and-openid-sign-on

Page 36: OWIN (Open Web Interface for .NET)

Contact

For more details about our services, please get in touch

with us.

[email protected]

US Office: (408) 365-4638

www.folio3.com