SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
OWIN
 Open Web Interface for .NET (owin.org)



Luboš Karásek | 19. 2. 2012
GMC Software Technology AG
Content
    • Why OWIN
    • App function
    • Middleware, IAppBuilder
    • Startup
    • Examples
    • Discussion



2
sudo apt-get install NodeJS




    node server.js
3
4
Web has changed

    • Mobile clients, HTML5, Cloud
    • Distributed applications – no IIS, Linux
    • ASP.NET is not always suitable
    • New .NET community servers and frameworks
      needs common interface




5
O(n2)




6
Introduction of terms
    Func<T, TResult>
    string Convert(int i) { return i.ToString(); }

    Func<int,string> convertDelegate = Convert;
    string s = convertDelegate(1);     //same as Convert(1)

    Task
    Represents an asynchronous operation
    • IsCompleted (Task<TResult> property Result)
    • IsFaulted (property Exception)
    • Wait
7
Application Delegate



    using AppFunc = Func<
           IDictionary<string, object>, //Env
           Task>; // Done




8
Examples are available on GitHub
    https://github.com/karasek/OWIN-Test-Samples




9
Middleware

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

     Func<AppFunc, AppFunc> middleware = AddTime;

     static AppFunc AddTime(AppFunc next)
     {
       return env =>
       {
          env ["started"] = DateTime.UtcNow;
          return next(env);
       };
     }
     https://github.com/owin/gate/blob/master/src/Main/Gate.Middleware/Static.cs
10
Application Startup
 NuGet package Owin

 namespace Owin
 {
   public interface IAppBuilder
   {
     IDictionary<string, object> Properties { get; }
     IAppBuilder Use(object middleware, params object[] args);
     object Build(Type returnType);
     IAppBuilder New();
   }
 }

 https://github.com/owin/owin/blob/master/src/Owin/IAppBuilder.cs
11
12
Links
     • http://owin.org/

     • http://nancyfx.org/

     • https://github.com/davidfowl/OwinHttpClient

     • http://nuget.org/packages?q=owin

     • http://www.sinatrarb.com/

     • http://www.strathweb.com/2012/12/running-aspnet-web-api-with-
       owin-and-katana

     • http://www.sparkjava.com/




13
Thank you




Luboš Karásek   GMC Software Technology

@luboskarasek   www.gmc.net

Weitere ähnliche Inhalte

Was ist angesagt?

An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
Ayush Mishra
 

Was ist angesagt? (20)

Python WSGI introduction
Python WSGI introductionPython WSGI introduction
Python WSGI introduction
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
 
Cocoon OSGi CocoonGT2007
Cocoon OSGi CocoonGT2007Cocoon OSGi CocoonGT2007
Cocoon OSGi CocoonGT2007
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
 
Eclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applicationsEclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applications
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Workshop Consul .- Service Discovery & Failure Detection
Workshop Consul .- Service Discovery & Failure DetectionWorkshop Consul .- Service Discovery & Failure Detection
Workshop Consul .- Service Discovery & Failure Detection
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
Celery for internal API in SOA infrastructure
Celery for internal API in SOA infrastructureCelery for internal API in SOA infrastructure
Celery for internal API in SOA infrastructure
 
Technology Radar Talks - NuGet
Technology Radar Talks - NuGetTechnology Radar Talks - NuGet
Technology Radar Talks - NuGet
 
Short Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoShort Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyo
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
 
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and KubernetesJava Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
 
London Community Summit - Habitat 2016
London Community Summit - Habitat 2016London Community Summit - Habitat 2016
London Community Summit - Habitat 2016
 
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten ZiegelerMonitoring OSGi Applications with the Web Console - Carsten Ziegeler
Monitoring OSGi Applications with the Web Console - Carsten Ziegeler
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGi
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...
 

Ähnlich wie Owin

Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
catherinewall
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
Jussi Pohjolainen
 

Ähnlich wie Owin (20)

Campus days 2014 owin
Campus days 2014 owinCampus days 2014 owin
Campus days 2014 owin
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
 
A Brief History of OWIN
A Brief History of OWINA Brief History of OWIN
A Brief History of OWIN
 
Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
 
Middleware webnextconf - 20152609
Middleware   webnextconf - 20152609Middleware   webnextconf - 20152609
Middleware webnextconf - 20152609
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngineGoogle Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
Node.js primer for ITE students
Node.js primer for ITE studentsNode.js primer for ITE students
Node.js primer for ITE students
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Job DSL Plugin for Jenkins
Job DSL Plugin for JenkinsJob DSL Plugin for Jenkins
Job DSL Plugin for Jenkins
 

Owin

  • 1. OWIN Open Web Interface for .NET (owin.org) Luboš Karásek | 19. 2. 2012 GMC Software Technology AG
  • 2. Content • Why OWIN • App function • Middleware, IAppBuilder • Startup • Examples • Discussion 2
  • 3. sudo apt-get install NodeJS node server.js 3
  • 4. 4
  • 5. Web has changed • Mobile clients, HTML5, Cloud • Distributed applications – no IIS, Linux • ASP.NET is not always suitable • New .NET community servers and frameworks needs common interface 5
  • 7. Introduction of terms Func<T, TResult> string Convert(int i) { return i.ToString(); } Func<int,string> convertDelegate = Convert; string s = convertDelegate(1); //same as Convert(1) Task Represents an asynchronous operation • IsCompleted (Task<TResult> property Result) • IsFaulted (property Exception) • Wait 7
  • 8. Application Delegate using AppFunc = Func< IDictionary<string, object>, //Env Task>; // Done 8
  • 9. Examples are available on GitHub https://github.com/karasek/OWIN-Test-Samples 9
  • 10. Middleware using AppFunc = Func<IDictionary<string, object>, Task>; Func<AppFunc, AppFunc> middleware = AddTime; static AppFunc AddTime(AppFunc next) { return env => { env ["started"] = DateTime.UtcNow; return next(env); }; } https://github.com/owin/gate/blob/master/src/Main/Gate.Middleware/Static.cs 10
  • 11. Application Startup NuGet package Owin namespace Owin { public interface IAppBuilder { IDictionary<string, object> Properties { get; } IAppBuilder Use(object middleware, params object[] args); object Build(Type returnType); IAppBuilder New(); } } https://github.com/owin/owin/blob/master/src/Owin/IAppBuilder.cs 11
  • 12. 12
  • 13. Links • http://owin.org/ • http://nancyfx.org/ • https://github.com/davidfowl/OwinHttpClient • http://nuget.org/packages?q=owin • http://www.sinatrarb.com/ • http://www.strathweb.com/2012/12/running-aspnet-web-api-with- owin-and-katana • http://www.sparkjava.com/ 13
  • 14. Thank you Luboš Karásek GMC Software Technology @luboskarasek www.gmc.net