SlideShare ist ein Scribd-Unternehmen logo
1 von 25
How to build real world single page
applications
 Git

 AppHarbor   PaaS
 MongoDB integration

 IoC/Dependency Injection

 Tests with nUnit & Moq

 CI + CD

 Repository Pattern

 Exception Management

 Authentication & Authorization
 Bootstrap.MVC     for responsive design
 Backbone.js    client MVC lib
 Client   Side session management
 Client   side authentication
 Build   and deploy an App in the Cloud
 WebApi   is Self Hosted and more flexible
 WebApi  Has Content Negotiation
 Separation of concerns
  • Allows detaching the website from the Api
User          Question            Vote

•   Name          • QuestionText    • UserId
•   Password      • IsOpenToVotes   • Answer
•   PassSalt      • List<Vote>
•   AccessToken
The Api…
 User   Model:
   public class User : Entity

         public   string   Name { get; set; }
         public   string   Password { get; set; }
         public   string   PasswordSalt { get; set; }
         public   string   AccessToken { get; set; }
 User   Api Model:
   public class User

         public string Id { get; set; }
         public string Name { get; set; }
         public string AccessToken { get; set; }
 Use   AttributeRouting nuGet Package
public class SampleController : ApiController
{
    [GET("Sample")]
    public List<Tweet> Index() { /* ... */ }

    [POST("Sample")]
    public void Create() { /* ... */ }

    [PUT("Sample/{id}")]
    public void Update(int id) { /* ... */ }

    [Route("Sample/Any-Method-Will-Do")]
    public string Wildman() { /* ... */ }
}
Main
Dependency
Main
         Injector
 Pros

  • Decoupling

  • Easy Testing, Isolating and Mocking

 Cons

  • Complicates the code

  • New set of bugs
 Add   StructureMap.MVC4 nuGet Package
 to the website
 Build   classes with IoC in mind
 Add   Repository Registry
 Add   Registry to Ioc.cs in Depedency
 Resolution folder
 Not   a part of Asp.Net.
 It’s just a best practice
 Allows:

  • Code reuse
  • Decoupling
  • IoC/Dependency Injection

 Current   Standard – Low learning curve for
 developers
   void Add(IEnumerable<T> entities)

   IQueryable<T> All(Expression<Func<T, bool>> criteria)

   void Delete(Expression<Func<T, bool>> criteria)

   void Update(IEnumerable<T> entities)


 ...
The Client…
 Backbone.js

 Knockout.js

 Javascript.MVC

 Ember.js

 Angular.js

 Batman.js

 Sammy.js

 YUI
 Twitter   Bootstrap
 Foundation    3 by Zurb
 HTML5     Boilerplate
 LessFramework

…
 Attribute   Routing
 Twitter   Bootstrap
 Twitter   Bootstrap Starter Layout Page
 Great   Backbone.js Book
 Chrome    Extensions
  • Dev Http Client

  • Edit this Cookie

  • Clear Cache

  • JSON View

 Responsinator
 effie.arditi@gmail.com

 @fe_rdt

 Github:   EffieArditi

Weitere ähnliche Inhalte

Was ist angesagt?

Repository design pattern in laravel
Repository design pattern in laravelRepository design pattern in laravel
Repository design pattern in laravel
Sameer Poudel
 

Was ist angesagt? (20)

Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
OroCRM Technology Webinar May 28, 2014
OroCRM Technology Webinar May 28, 2014OroCRM Technology Webinar May 28, 2014
OroCRM Technology Webinar May 28, 2014
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
 
Building domain-specific testing tools : lessons learned from the Apache Slin...
Building domain-specific testing tools : lessons learned from the Apache Slin...Building domain-specific testing tools : lessons learned from the Apache Slin...
Building domain-specific testing tools : lessons learned from the Apache Slin...
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
 
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
 
Repository design pattern in laravel
Repository design pattern in laravelRepository design pattern in laravel
Repository design pattern in laravel
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
ASP.NET Web API O to 100
ASP.NET Web API O to 100ASP.NET Web API O to 100
ASP.NET Web API O to 100
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSockets
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Mock Server Using WireMock
Mock Server Using WireMockMock Server Using WireMock
Mock Server Using WireMock
 

Andere mochten auch

Web home pg pres
Web home pg presWeb home pg pres
Web home pg pres
eyecandoit
 
TM Yak Carpathia Investment offer
TM Yak Carpathia Investment offerTM Yak Carpathia Investment offer
TM Yak Carpathia Investment offer
Igor Varyvoda
 
Real World Dependency Injection - phpday
Real World Dependency Injection - phpdayReal World Dependency Injection - phpday
Real World Dependency Injection - phpday
Stephan Hochdörfer
 

Andere mochten auch (15)

Building great spa’s with angular js, asp.net mvc and webapi
Building great spa’s with angular js, asp.net mvc and webapiBuilding great spa’s with angular js, asp.net mvc and webapi
Building great spa’s with angular js, asp.net mvc and webapi
 
Web home pg pres
Web home pg presWeb home pg pres
Web home pg pres
 
Дерев'яні вікна в Івано-Франківську. ТМ "ЯК Карпатія"
Дерев'яні вікна в Івано-Франківську. ТМ "ЯК Карпатія"Дерев'яні вікна в Івано-Франківську. ТМ "ЯК Карпатія"
Дерев'яні вікна в Івано-Франківську. ТМ "ЯК Карпатія"
 
Hubertus Menu
Hubertus MenuHubertus Menu
Hubertus Menu
 
What is lto j
What is lto jWhat is lto j
What is lto j
 
TM Yak Carpathia Investment offer
TM Yak Carpathia Investment offerTM Yak Carpathia Investment offer
TM Yak Carpathia Investment offer
 
Owin from spec to application
Owin from spec to applicationOwin from spec to application
Owin from spec to application
 
OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIIS
 
Дерев'яні вікна та двері від виробника.
Дерев'яні вікна та двері від виробника.Дерев'яні вікна та двері від виробника.
Дерев'яні вікна та двері від виробника.
 
Owin and Katana
Owin and KatanaOwin and Katana
Owin and Katana
 
Real-Time Web Applications with ASP.NET WebAPI and SignalR
Real-Time Web Applications with ASP.NET WebAPI and SignalRReal-Time Web Applications with ASP.NET WebAPI and SignalR
Real-Time Web Applications with ASP.NET WebAPI and SignalR
 
Real World Dependency Injection - phpday
Real World Dependency Injection - phpdayReal World Dependency Injection - phpday
Real World Dependency Injection - phpday
 
Very basic of asp.net mvc with c#
Very basic of asp.net mvc with c#Very basic of asp.net mvc with c#
Very basic of asp.net mvc with c#
 
DevIntersections 2014 Web API Slides
DevIntersections 2014 Web API SlidesDevIntersections 2014 Web API Slides
DevIntersections 2014 Web API Slides
 
Difference between wcf and asp.net web api
Difference between wcf and asp.net web apiDifference between wcf and asp.net web api
Difference between wcf and asp.net web api
 

Ähnlich wie Real World Asp.Net WebApi Applications

Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
Aaron Saunders
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
Chalermpon Areepong
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 

Ähnlich wie Real World Asp.Net WebApi Applications (20)

Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
Spring training
Spring trainingSpring training
Spring training
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
springtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdfspringtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdf
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Lap around Visual Studio 2013
Lap around Visual Studio 2013Lap around Visual Studio 2013
Lap around Visual Studio 2013
 
Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4 Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010
 
Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.js
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Real World Asp.Net WebApi Applications

  • 1. How to build real world single page applications
  • 2.
  • 3.
  • 4.
  • 5.  Git  AppHarbor PaaS  MongoDB integration  IoC/Dependency Injection  Tests with nUnit & Moq  CI + CD  Repository Pattern  Exception Management  Authentication & Authorization
  • 6.  Bootstrap.MVC for responsive design  Backbone.js client MVC lib  Client Side session management  Client side authentication
  • 7.  Build and deploy an App in the Cloud
  • 8.  WebApi is Self Hosted and more flexible  WebApi Has Content Negotiation  Separation of concerns • Allows detaching the website from the Api
  • 9. User Question Vote • Name • QuestionText • UserId • Password • IsOpenToVotes • Answer • PassSalt • List<Vote> • AccessToken
  • 11.  User Model: public class User : Entity public string Name { get; set; } public string Password { get; set; } public string PasswordSalt { get; set; } public string AccessToken { get; set; }
  • 12.  User Api Model: public class User public string Id { get; set; } public string Name { get; set; } public string AccessToken { get; set; }
  • 13.  Use AttributeRouting nuGet Package public class SampleController : ApiController { [GET("Sample")] public List<Tweet> Index() { /* ... */ } [POST("Sample")] public void Create() { /* ... */ } [PUT("Sample/{id}")] public void Update(int id) { /* ... */ } [Route("Sample/Any-Method-Will-Do")] public string Wildman() { /* ... */ } }
  • 14. Main
  • 15. Dependency Main Injector
  • 16.  Pros • Decoupling • Easy Testing, Isolating and Mocking  Cons • Complicates the code • New set of bugs
  • 17.  Add StructureMap.MVC4 nuGet Package to the website  Build classes with IoC in mind  Add Repository Registry  Add Registry to Ioc.cs in Depedency Resolution folder
  • 18.  Not a part of Asp.Net. It’s just a best practice  Allows: • Code reuse • Decoupling • IoC/Dependency Injection  Current Standard – Low learning curve for developers
  • 19. void Add(IEnumerable<T> entities)  IQueryable<T> All(Expression<Func<T, bool>> criteria)  void Delete(Expression<Func<T, bool>> criteria)  void Update(IEnumerable<T> entities)  ...
  • 21.  Backbone.js  Knockout.js  Javascript.MVC  Ember.js  Angular.js  Batman.js  Sammy.js  YUI
  • 22.  Twitter Bootstrap  Foundation 3 by Zurb  HTML5 Boilerplate  LessFramework …
  • 23.  Attribute Routing  Twitter Bootstrap  Twitter Bootstrap Starter Layout Page  Great Backbone.js Book
  • 24.  Chrome Extensions • Dev Http Client • Edit this Cookie • Clear Cache • JSON View  Responsinator