SlideShare uma empresa Scribd logo
1 de 15
Build Modern Web Apps using 
ASP.NET Web API & AngularJS 
Taiseer Joudeh 
Senior IT Team Lead at Aramex 
Twitter : @tjoudeh 
Blog: http://bitof tech.net
Agenda 
• Deep dive into ASP.NET Web API 
• REST Specifications 
• Build RESTful HTTP service using Web API 
• Single Page Applications Overview 
• SPA Frameworks 
• Build simple SPA using AngularJS 
• Host the project on Microsoft Azure
What is ASP.NET Web API? 
• Framework for building HTTP based services 
• Use HTTP is application protocol 
• Designed for broad reach (To any client speaks HTTP!) 
• HTTP != REST 
• The framework does not enforce an architectural style 
• Can be used with: 
• ASP.NET Web Forms 
• ASP.NET MVC
ASP.NET Web API Features 
• Built on top of ASP.NET Stack 
• Native Support for ASP.NET Routing 
• Convention over Configuration 
• Native abstraction on top of raw HTTP protocol 
• Brand new HTTP client toolkit 
• High level of scalability on architecture and on the cloud 
• Easily build RESTful compliant Services
What is RESTful Services? 
• REST = Representation State Transfer 
• Stateless architect which runs over HTTP (Not a protocol) 
• Four basic design principals for RESTful services: 
1. Use HTTP Verbs only to interact with resources 
2. Interaction with resources is stateless, request/response contain all 
information 
3. Resources identified by URIs only (Services Discovery) 
4. Content Negotiation (Support for XML/JSON)
Resources in RESTful Services 
Operation HTTP Verb ResourceURI 
Get all students GET /api/students 
Create a new student POST /api/students 
Get a student GET /api/students/{username} 
Update a student PUT /api/students/{username} 
Delete a student DELETE /api/students/{username}
Why to build RESTful Services? 
• Can be easily consumed by any client (Mobile Apps, SPA, Desktop 
Apps, Service to Service, etc…) 
• Lightweight (No XML parsing, less bandwidth, just the payloads) 
• Easier to learn and build, you can get up running quickly. 
• Closer to Web design specification, all about HTTP protocol.
Demo
To implement a Web API….. 
• Derive from API Controller 
• Implement your HTTP Methods 
• Maps URI space to your API controllers 
• Ex: api/{controller}/{id} 
• {controller} + “Controller ” = ApiController Type Name 
• Simple types are taken from URI 
• Route data, query parameters 
• Complex types come from the body 
• MediaTypeFormaters are configured to deserialize request body based on content 
type 
• JSON, XML, and form-url-encoded are supported out of the box
Demo
What is SPA? 
• Single Page Application – Bad Name maybe! (Rich Web 
Applications) 
• Load all necessary resources up-front with single page load (shell 
page) 
• Bring the desktop experience to the web – Partial loads 
• Built entirely with JS and HTML
Motivations to build SPA 
• Rich user experience – faster responses 
• Reduce round tripping between client and the server 
• Reach – SPAs can reach different users on different platforms.
SPA Architecture Philosophy 
• Thin Stateless Server 
• Role is a service (RESTful API is important) 
• Stateless server…easy to scale 
• Strong separation of concerns which leads to lower network latency, less 
bandwidth usage, snappy response 
• MVC at the Client 
• View: sets on top of the architecture (Think of page). 
• Model: set at the bottom of the architecture, holds the data for the view 
• Controller: Sets in between, orchestrator between View and Model, handle 
business logic
SPA Frameworks 
• Consider framework with features: 
• Browser history management (Support for back button) 
• Templating engine (Mustache, Handlebars, etc…) 
• Two way data binding 
• Routing service 
• Framework examples: 
• AngularJS 
• EmberJS 
• BackboneJS
Thank You!

Mais conteúdo relacionado

Mais procurados

New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
teach4uin
 
SharePoint App Types at a Glance
SharePoint App Types at a GlanceSharePoint App Types at a Glance
SharePoint App Types at a Glance
David J Rosenthal
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
Keshab Nath
 

Mais procurados (20)

New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
SharePoint App Types at a Glance
SharePoint App Types at a GlanceSharePoint App Types at a Glance
SharePoint App Types at a Glance
 
Salesforce UI API (TDXGG'18)
Salesforce UI API (TDXGG'18)Salesforce UI API (TDXGG'18)
Salesforce UI API (TDXGG'18)
 
MVC-3 Vs Webform
MVC-3 Vs WebformMVC-3 Vs Webform
MVC-3 Vs Webform
 
Introduction ASP
Introduction ASPIntroduction ASP
Introduction ASP
 
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
Mulesoft Salesforce Connector -  OAuth 2.0 JWT BearerMulesoft Salesforce Connector -  OAuth 2.0 JWT Bearer
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
 
Essential Knowledge for SharePoint Add-Ins
Essential Knowledge for SharePoint Add-InsEssential Knowledge for SharePoint Add-Ins
Essential Knowledge for SharePoint Add-Ins
 
Everybody loves Swagger
Everybody loves SwaggerEverybody loves Swagger
Everybody loves Swagger
 
Domain and hostion
Domain and hostionDomain and hostion
Domain and hostion
 
ECS 2018: Introduction to Azure Web Applications
ECS 2018: Introduction to Azure Web ApplicationsECS 2018: Introduction to Azure Web Applications
ECS 2018: Introduction to Azure Web Applications
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
 
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
 
Apps for SharePoint 2013
Apps for SharePoint 2013Apps for SharePoint 2013
Apps for SharePoint 2013
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
Azure basics
Azure basicsAzure basics
Azure basics
 
Introducing Office Web Apps as a Tool for Developing Content Rich Applications
Introducing Office Web Apps as a Tool for Developing Content Rich ApplicationsIntroducing Office Web Apps as a Tool for Developing Content Rich Applications
Introducing Office Web Apps as a Tool for Developing Content Rich Applications
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedin
 
Dreamforce 2018 Locker Service
Dreamforce 2018 Locker ServiceDreamforce 2018 Locker Service
Dreamforce 2018 Locker Service
 
Mule Anypoint API Gateway
Mule Anypoint API GatewayMule Anypoint API Gateway
Mule Anypoint API Gateway
 

Semelhante a Build Modern Web Apps Using ASP.NET Web API and AngularJS

Role of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIRole of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EI
WSO2
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 

Semelhante a Build Modern Web Apps Using ASP.NET Web API and AngularJS (20)

APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web Sites
 
Role of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIRole of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EI
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
SharePoint 2013 - What's New
SharePoint 2013 - What's NewSharePoint 2013 - What's New
SharePoint 2013 - What's New
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
 
Web Applications Development with MEAN Stack
Web Applications Development with MEAN StackWeb Applications Development with MEAN Stack
Web Applications Development with MEAN Stack
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Single page applications with backbone js
Single page applications with backbone jsSingle page applications with backbone js
Single page applications with backbone js
 
Developer’s Independence Day: Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day: Introducing the SharePoint App Model
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
 

Último

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Build Modern Web Apps Using ASP.NET Web API and AngularJS

  • 1. Build Modern Web Apps using ASP.NET Web API & AngularJS Taiseer Joudeh Senior IT Team Lead at Aramex Twitter : @tjoudeh Blog: http://bitof tech.net
  • 2. Agenda • Deep dive into ASP.NET Web API • REST Specifications • Build RESTful HTTP service using Web API • Single Page Applications Overview • SPA Frameworks • Build simple SPA using AngularJS • Host the project on Microsoft Azure
  • 3. What is ASP.NET Web API? • Framework for building HTTP based services • Use HTTP is application protocol • Designed for broad reach (To any client speaks HTTP!) • HTTP != REST • The framework does not enforce an architectural style • Can be used with: • ASP.NET Web Forms • ASP.NET MVC
  • 4. ASP.NET Web API Features • Built on top of ASP.NET Stack • Native Support for ASP.NET Routing • Convention over Configuration • Native abstraction on top of raw HTTP protocol • Brand new HTTP client toolkit • High level of scalability on architecture and on the cloud • Easily build RESTful compliant Services
  • 5. What is RESTful Services? • REST = Representation State Transfer • Stateless architect which runs over HTTP (Not a protocol) • Four basic design principals for RESTful services: 1. Use HTTP Verbs only to interact with resources 2. Interaction with resources is stateless, request/response contain all information 3. Resources identified by URIs only (Services Discovery) 4. Content Negotiation (Support for XML/JSON)
  • 6. Resources in RESTful Services Operation HTTP Verb ResourceURI Get all students GET /api/students Create a new student POST /api/students Get a student GET /api/students/{username} Update a student PUT /api/students/{username} Delete a student DELETE /api/students/{username}
  • 7. Why to build RESTful Services? • Can be easily consumed by any client (Mobile Apps, SPA, Desktop Apps, Service to Service, etc…) • Lightweight (No XML parsing, less bandwidth, just the payloads) • Easier to learn and build, you can get up running quickly. • Closer to Web design specification, all about HTTP protocol.
  • 9. To implement a Web API….. • Derive from API Controller • Implement your HTTP Methods • Maps URI space to your API controllers • Ex: api/{controller}/{id} • {controller} + “Controller ” = ApiController Type Name • Simple types are taken from URI • Route data, query parameters • Complex types come from the body • MediaTypeFormaters are configured to deserialize request body based on content type • JSON, XML, and form-url-encoded are supported out of the box
  • 10. Demo
  • 11. What is SPA? • Single Page Application – Bad Name maybe! (Rich Web Applications) • Load all necessary resources up-front with single page load (shell page) • Bring the desktop experience to the web – Partial loads • Built entirely with JS and HTML
  • 12. Motivations to build SPA • Rich user experience – faster responses • Reduce round tripping between client and the server • Reach – SPAs can reach different users on different platforms.
  • 13. SPA Architecture Philosophy • Thin Stateless Server • Role is a service (RESTful API is important) • Stateless server…easy to scale • Strong separation of concerns which leads to lower network latency, less bandwidth usage, snappy response • MVC at the Client • View: sets on top of the architecture (Think of page). • Model: set at the bottom of the architecture, holds the data for the view • Controller: Sets in between, orchestrator between View and Model, handle business logic
  • 14. SPA Frameworks • Consider framework with features: • Browser history management (Support for back button) • Templating engine (Mustache, Handlebars, etc…) • Two way data binding • Routing service • Framework examples: • AngularJS • EmberJS • BackboneJS