Martin Kruliš 23. 5. 2016 by Martin Kruliš (v1.0)1.

Slides:



Advertisements
Similar presentations
REST Introduction 吴海生 博克软件(杭州)有限公司.
Advertisements

Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Development of mobile applications using PhoneGap and HTML 5
RESTful Web Development With Nodejs and Express. REST Stands for REpresentational State Transfer Has the following constraints: ◦Client-Server ◦Stateless.
Client/Server Architectures
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Building a UI with Zen Pat McGibbon –Sales Engineer.
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
RESTful applications Norman White. REST Representational state transfer Key concepts – Client Server architecture built on transferring resources between.
J2EE Structure & Definitions Catie Welsh CSE 432
Web Services XML-RPC, SOAP, REST Advanced Web-based Systems | Misbhauddin.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
Google Data Protocol Guy Mark Lifshitz. Motivation Google’s Mission: – Organize the world’s information – Make information universally accessible – Provide.
INTEGRATION OF BACKBONE.JS WITH SPRING 3.1. Agenda New Features and Enhancements in Spring 3.1 What is Backbone.js and why I should use it Spring 3.1.
REAL WORLD AJAX MARCH TIBCO USER CONFERENCE / 2004 Enterprise Rich Internet Applications with AJAX Real World Case Studies with TIBCO General Interface™
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Martin Kruliš by Martin Kruliš (v1.1)1.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
RESTful Web Services What is RESTful?
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
REST By: Vishwanath Vineet.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Presentation Title Subtitle DSpace UI Prototype 7 Spring, Angular.js, and the DSpace REST API.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
Ext JS - Direct Bridging The Gap A DMSBT Presentation By Timothy Chandler.
National College of Science & Information Technology.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Web Technologies Computing Science Thompson Rivers University
The Client-Server Model
API (Application Program Interface)
RESTful Sevices Distributed Objects Presented by: Shivank Malik
Modern Web: Single Page Applications
REST- Representational State Transfer Enn Õunapuu
Introduction to Redux Header Eric W. Greene Microsoft Virtual Academy
MVC and other n-tier Architectures
Server-side Scripting
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
Ashish Pandit IT Architect, Middleware & Integration Services
WEB API.
ASP.NET Module Subtitle.
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Web Technologies Computing Science Thompson Rivers University
Web Application Interfaces (APIs)
Web Client Side Technologies Raneem Qaddoura
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Martin Kruliš by Martin Kruliš (v1.0)1

 Single Page Applications ◦ The application logic runs in the browser  Provides more desktop-like user experience  HTTP requests are handled asynchronously (and covertly) ◦ Traditional browsing is typically discouraged  Handled internally by re-rendering the page ◦ Thin server architecture  Data storage, security verifications, … ◦ Disadvantages  Application boot - loading and initialization time  Less stable execution environment (many browser types) by Martin Kruliš (v1.0)2

 SPA vs. Desktop Applications ◦ Similar UI concepts  Event driven programming ◦ Environment and security  It is much simpler to hack code of a web application than regular (compiled) desktop application ◦ Server communication  A defining attribute of web applications  Another source of runtime errors  Asynchronous request may interfere with UI events by Martin Kruliš (v1.0)3

 Events and User Actions ◦ Events are entangled with DOM structure ◦ User actions are abstract (not tied to DOM)  Event may trigger an action which is not DOM-related ◦ Mechanism for global action processing  Components ◦ A smart way how to divide code ◦ Components need to communicate/cooperate ◦ Components may compete for resources  Local storage, workers, … by Martin Kruliš (v1.0)4

 Model-View-Controller at Client Side by Martin Kruliš (v1.0)5 View Controller Model Process user actions and handles business logic Process user actions and handles business logic Keeps client-side data and manages their sync. with server side (if necessary) Renders data (Javascript structures, JSON, XML, …) into HTML fragments

 Model-View-Viewmodel ◦ Simplifies data presentation especially in SPA by Martin Kruliš (v1.0)6 View Model View Model ViewModel Data for business logic Data for presentation Presentation logic Data bindings

 AngularJS Library ◦ Open source SPA framework, propelled by Google ◦ Adopts MVC and MVVM patterns  Logic in controllers is coded imperatively  Data bindings are declarative (embedded in HTML) ◦ $scope object – a context for most operations  Variables from scope can be bound to page fragments  Two-way data binding  Updates are performed iteratively (digest cycle) ◦ Angular 2 recently released  Complete rewrite, many changes  Microsoft TypeScript – typed version of Javascript by Martin Kruliš (v1.0)7

 MVVM and Data Binding ◦ Declarative, embedded in HTML  Typically as new attributes and CSS classes  Using a special syntax directly in text content User Name: {{ fistName }} {{ lastName }} ◦ The Viewmodel is the $scope context  The bindings are bidirectional  Automatically propagated in both ways  $scope.caption input.value (from above)  $scope.firstName -> rendered to the text placeholder  The controller works only with the $scope object by Martin Kruliš (v1.0)8

 Directives ◦ Many embedded directives for the visual control  ng-bind, ng-model  ng-if, ng-switch, ng-repeat, ng-show, ng-hide ◦ Defining custom directives  Controllers ◦ Perform $scope initialization ◦ Declare functions (actions), which can be triggered by event-handlers (e.g., ng-click ) by Martin Kruliš (v1.0)9 Example 1

 MVC and Feature Scalability ◦ The model-view bindings may become troublesome in complex scenarios by Martin Kruliš (v1.0)10 View Model Action Controller Model View

 Flux Framework ◦ Dispatcher process one action at a time ◦ Action is propagated to all stores before the views are changed (prevents cycling) ◦ If a view needs to update something, it generates new action by Martin Kruliš (v1.0)11 Action Dispatcher Store View Action

 ReactJS Library ◦ Another open source library which uses Flux ◦ Open source, propelled by Facebook and Instagram ◦ Key features  Separation of concepts (individual UI components)  One-way data flow  Child component cannot modify its parent  Actions are propagated up through callback  Virtual DOM  Aggregate changes, so fewer modifications to real DOM are required when a component re-renders itself  JSX – Javascript language extension by Martin Kruliš (v1.0)12

 Thick Client and Thin Server ◦ HTTP is no longer used (only) in traditional sense ◦ RPC-like concept is used over HTTP or WebSockets ◦ Server performs only those operations that cannot or should not be transferred to client  Data management (retrieval, modifications, …)  Data are transferred in JSON or in native format (images)  Authentication and authorization  Trusted computing base cannot be extended to the client  Supportive tasks  Providing modules, styles, …  Rendering fragments of HTML (performance optimization) by Martin Kruliš (v1.0)13

 Representational State Transfer (REST) ◦ Server API which offers retrieval and manipulation with application resources in a HTTP-compliant way  Resources are identified by URIs  Operations are performed by HTTP requests ◦ REST formal constraints are  Client-server model  Stateless interface (no client context is cached at server)  Cacheable (response defines whether it can be cached)  Uniform interface  Layered system (proxies, servers may be replicated) by Martin Kruliš (v1.0)14

 Representational State Transfer (REST) ◦ HTTP request methods reflect desired operations  GET – retrieve the resource (nullipotent)  POST – append new sub-entity in the resource  PUT – insert/replace the resource (idempotent)  DELETE – remove the resource (idempotent) ◦ Example  API for photo gallery  /gallery – collection of all galleries  /gallery/kittens - photos in gallery with ID=kittens  /gallery/kittens/kitten01 – photo kitten by Martin Kruliš (v1.0)15

 REST Example by Martin Kruliš (v1.0)16 /gallery (collection of galleries) /gallery/kittens (photos in gallery) …/kitten01 (single photo) GET Get the list of all galleries (JSON) Get the list of photos in the gallery (JSON) Get the image (jpeg) POST Create a new gallery Create a new photo in a gallery Not generally used. Perhaps for adding image metadata… PUT Replace list of galleries (atypical) Replace entire list of photos in gallery Replace/insert an image (of given ID) DELETE Empty the whole application Remove all photos of a gallery Remove the given image

 PHP Slim Framework Example $app = new \Slim\App; $app->get('/hello/{name}', function (Request $request, Response $response) { $name = $request->getAttribute('name'); $response->getBody()->write("Hello, $name"); return $response; }); $app->run(); by Martin Kruliš (v1.0)17

 Deployment ◦ New versions are not loaded immediately ◦ Backward compatibility, versions in file names, …  Error Handling ◦ Careful error/exception handling ◦ Explicit transfers to server (which may also fail) ◦ Client-side error cache  Dependencies in development ◦ Typical SPA uses many libraries ◦ Library management systems exist  Composer, npm, Bower, … by Martin Kruliš (v1.0)18

by Martin Kruliš (v1.0)19