OWIN Web API with Linky
-
Upload
tomas-jansson -
Category
Technology
-
view
378 -
download
2
description
Transcript of OWIN Web API with Linky
![Page 1: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/1.jpg)
OWIN AND WEB API 2.2
Oslo/NNUG
Tomas Jansson
26/08/2014
![Page 2: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/2.jpg)
THIS IS ME
Tomas Jansson
Manager & Practice Lead .NETBEKK Oslo
@[email protected]/mastojblog.tomasjansson.com
![Page 3: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/3.jpg)
AGENDA
What is OWIN
Show me MORE CODE!
TerminologyShow me the
code!
RESTWeb API 2.2
![Page 4: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/4.jpg)
WHAT IS OWIN?
OWIN defines a standard interface between .NET web servers and web applications.
The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools.
http://owin.org/
![Page 5: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/5.jpg)
WHAT IS OWIN?
OWIN defines a standard interface between .NET web servers and web applications.
The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools.
http://owin.org/WhatOWIN is
![Page 6: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/6.jpg)
WHAT IS OWIN?
OWIN defines a standard interface between .NET web servers and web applications.
The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools.
http://owin.org/
The goal
![Page 7: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/7.jpg)
TERMINOLOGY
Actors Environment AppFunc
![Page 8: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/8.jpg)
ACTORS
Host: The process an application and server execute inside of, primarily responsible for application startup.
Example: Self-host, Nowin, IIS
http://owin.org/spec/owin-1.0.0.html
![Page 9: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/9.jpg)
ACTORS
http://owin.org/spec/owin-1.0.0.html
Server: The HTTP server that directly communicates with the client and then uses OWIN semantics to process requests.
Examples: SystemWeb, Self-Host, Nowin
Host: The process an application and server execute inside of, primarily responsible for application startup.
Example: Self-host, Nowin, IIS
![Page 10: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/10.jpg)
ACTORS
Middleware: A pass through component that handles cross cutting concerns. Acts as a pipeline between server and application.
Example: Security stuff
http://owin.org/spec/owin-1.0.0.html
Server: The HTTP server that directly communicates with the client and then uses OWIN semantics to process requests.
Examples: SystemWeb, Self-Host, Nowin
Host: The process an application and server execute inside of, primarily responsible for application startup.
Example: Self-host, Nowin, IIS
![Page 11: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/11.jpg)
ACTORS
Middleware: A pass through component that handles cross cutting concerns. Acts as a pipeline between server and application.
Example: Security stuff
Web Framework: Self-contained components that you can base your applicationon.
Example: Web API, NancyFx, SignalR
http://owin.org/spec/owin-1.0.0.html
Server: The HTTP server that directly communicates with the client and then uses OWIN semantics to process requests.
Examples: SystemWeb, Self-Host, Nowin
Host: The process an application and server execute inside of, primarily responsible for application startup.
Example: Self-host, Nowin, IIS
![Page 12: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/12.jpg)
ACTORS
Middleware: A pass through component that handles cross cutting concerns. Acts as a pipeline between server and application.
Example: Security stuff
Web Framework: Self-contained components that you can base your applicationon.
Example: Web API, NancyFx, SignalR
Web Application: This is the stuff you’re most likely to write.
http://owin.org/spec/owin-1.0.0.html
Server: The HTTP server that directly communicates with the client and then uses OWIN semantics to process requests.
Examples: SystemWeb, Self-Host, Nowin
Host: The process an application and server execute inside of, primarily responsible for application startup.
Example: Self-host, Nowin, IIS
![Page 13: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/13.jpg)
ENVIRONMENT
http://mashable.com/2013/06/13/dictionary-new-words-2013/
![Page 14: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/14.jpg)
ENVIRONMENT
The Environment dictionary stores information about the request, the response, and any relevant server state.
The server is responsible for providing body streams and header collections for both the request and response in the initial call.
The application then populates the appropriate fields with response data, writes the response body, and returns when done.
![Page 15: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/15.jpg)
APPFUNC – THE APPLICATION DELEGATE
http://casopisinterfon.org/2014/03/11/da-li-funk-od-balkana-pravi-pesme-ili-balkan-od-funka-pravi-slona/
![Page 16: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/16.jpg)
APPFUNC – THE APPLICATION DELEGATE
using AppFunc = Func<IDictionary<string, object>, // Environment
Task>; // Done
![Page 17: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/17.jpg)
![Page 18: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/18.jpg)
WEB API 2.2
Full OWIN support
Attribute routing
Global error handling
Multiple OData improvements
![Page 19: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/19.jpg)
REST/RICHARDSON’S MATURITY MODEL
http://martinfowler.com/articles/images/richardsonMaturityModel/overview.png
![Page 20: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/20.jpg)
REST/RICHARDSON’S MATURITY MODEL
This is our goal today!
http://martinfowler.com/articles/images/richardsonMaturityModel/overview.png
![Page 21: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/21.jpg)
https://github.com/mastoj/OwinLinkyApi
![Page 22: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/22.jpg)
Summary
Time to pick up OWIN
Key components
of OWIN: Environment and AppFunc
REST level 3 is doable!
![Page 23: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/23.jpg)
RESOURCES
OWIN: http://owin.org/
Katana: https://katanaproject.codeplex.com/
Presentation: http://www.slideshare.net/mastoj/owin-web-api-with-linky
Source code: https://github.com/mastoj/OwinLinkyApi
Linky: https://github.com/zudio/Linky
![Page 24: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/24.jpg)
Questions?
![Page 25: OWIN Web API with Linky](https://reader033.fdocuments.in/reader033/viewer/2022052413/559bdde71a28ab39568b45f0/html5/thumbnails/25.jpg)
Thank you!
@TomasJansson