SlideShare a Scribd company logo
SINGLE PAGE
APPLICATIONS WITH
JAVASCRIPT AND ASP.NET
MVC4

Author: Yurii Shapovalov
Yurii_Shapovalov@epam.com
TOPICS
 Definition
 SPA Architecture
 Server Stack
 Client Stack
 JavaScript Patterns
 Web Optimization
 Examples of components
WHAT’S A SPA?
• is a web application that fits on a single web page, providing a fluid

UX akin to a desktop application.

• Maintain navigation, history, page linking.
• Whole applications fits on a single web page.
• Persisting important state on the client
• Fully (or mostly) loaded in the initial page load
• Progressively downloads data as required
SPA HIGH LEVEL
ARCHITECTURE
Server

Client

ASP.NET
+ (JavaScript /
HTML / CSS)

Views
(HTML / CSS)

Data Services

Application
(JavaScript)

Database

Data Access
(JavaScript)

Navigation
SERVER SIDE DESIGN
Web API

ASP.NET Web API

Unit of Work Pattern

Repository Pattern

Entity Framework

EF Code First

Database

JSON
ASP.NET WEB API
• Simplifies web services

• Good for serving JSON
JSON
Models

SQL Server

Data Layer

ASP.NET Web
API
CONTROLLERS
public IEnumerable<Activity> GetAll()
{
return Uow.Activities.GetAll().OrderBy(p => p.Name);
}
public Activity Get(int id)
{
var activity = Uow.Activities.GetById(id);
if(activity != null)
return activity;
}
public HttpResponseMessage Put(Activity activity)
{
Uow.Activities.Update(activity);
Uow.Commit();
return new HttpResponseMessage(HttpStatusCode.NoContent);
}}
INDEX.HTML
• Using HTML5 Boilerplate
• (http://html5boilerplate.com/)
• Modernizr.js – checks supported features in client
browser.
• @using System.Web.Optimization
• Configuring App_Start
• BundleConfig
BUNDLING AND MINIFICATION
• To reduce size of resources which we transfer to

client in initial page load, we are using bundling
and minification.
• Bundling reduce server calls for resources.

• Minification reduce the size of file.
BUNDLING
• Instead of this:
<script type="text/javascript" src="jquery.easing.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="inputlabel.js"></script>
<script type="text/javascript" src="jquery.treeview.js"></script>
<script type="text/javascript “src="quickpager.jquery.js"></script>
<script type="text/javascript" src="jquery.modalboxmin.js"></script>
<script type="text/javascript" src="jquery.activity-indi.js"></script>
<script type="text/javascript" src="/lib/js/tabs.js"></script>
<script type="text/javascript" src="/lib/js/socializ.js"></script>
<script type="text/javascript" src="/lib/js/muScript.js"></script>
<!-- ... -->
BUNDLING
… doing this for scripts:
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jsextlibs").Include(
"~/Scripts/lib/jquery.activity-indicator-{version}.js",
"~/Scripts/lib/knockout-{version}.js",
"~/Scripts/lib/underscore.js",
"~/Scripts/lib/moment.js",
"~/Scripts/lib/sammy.js",
"~/Scripts/lib/amplify.js"
// ...
));
BUNDLING
… and for other resources:
bundles.Add(new ScriptBundle("~/bundles/jsapplibs").
IncludeDirectory("~/Scripts/app/", "*.js",
searchSubdirectories: false));

bundles.Add(new StyleBundle("~/Content/css").
Include(
"~/Content/normalize.css",
"~/Content/main.css", ));
bundles.Add(new Bundle("~/Content/Less",
new LessTransform(), new CssMinify())
.Include("~/Content/styles.less"));
BUNDLING
Add bundles on index.html
@Styles.Render("~/Content/css", "~/Content/less")
@Scripts.Render("~/bundles/modernizr")

@Scripts.Render(

"~/bundles/jquery",
"~/bundles/jsextlibs",
"~/Scripts/lib/require.js",
"~/bundles/jsapplibs",

"~/bundles/jsmocks",
"~/Scripts/main.js"
)
BUNDLING AND MINIFICATION
Using B/M

Without B/M

Chang
e

File
Requests

9

34

256%

KB Sent

3.26

11.92

266%

KB
Received

388.51

530

36%

780 MS

53%

Load Time 510 MS
CSS AND LESS
Less – Dynamic Stylesheet language
.accent-top (@sizeMultiplier: 1, @lineHeightMultiplier: 1)
{
.accent;
width: @base-accent-top-width * @sizeMultiplier;
height: @base-accent-top-height * @sizeMultiplier;
div {
text-transform: uppercase;
}}
LESS TO CSS
 Creating custom BundleTransform using library dotLett.

public class LessTransform : IBundleTransform
{
public void Process(BundleContext c, BundleResponse resp)
{

resp.Content = dotless.Core.Less.Parse(resp.Content);
response.ContentType = "text/css";
}}
RENDER VIEWS
• Render all pages in main section.
• All pages are stored in Views folder
• General components like header, navigation and footer
we are defining above or below of main section.

<section class="main">
@RenderPage("Views/workspace.cshtml")
@RenderPage("Views/statistics.cshtml")
@RenderPage("Views/settings.cshtml")
@* ... *@
</section>
VIEWS
• View is a simple html with data-bind.
• Views might contain Knockout templates
<section id="workspace-view" class="view">
<h2 data-bind="text: context.date"></h2>
<ul data-bind="template: { name: 'activity-template',
foreach: activities }" class="activity"></ul>
<button data-bind="click: addActivity" class="addactivity">+</button>
<table data-bind="template: { name: timelogTemplate }">
</table>
</section>
CLIENT SIDE DESIGN
HTML Views
HTML Views
HTML Views
HTML / Views

Bootstrapper
MVVM Binder

HTML / Views
HTML / Views
HTML / Views
ViewModels

Sorting
Filtering

Data Primer

HTML / Views
HTML / Views
HTML / Views
Models

Data Context
Data Services

Model Mappers
Model Mappers
Model Mappers
Model Mappers
JAVASCRIPT LIBRARIES
jQuery

Working with DOM,

Knockout.js

Data Binding and MVVM

Amplify.js

Data Push/Pull, Caching, Client Storage

Breeze.js

Querying with filters, ordering and paging

Sammy.js

Navigation and History

require.js

Dependency Resolution

underscore.js

JavaScript helper

toastr.js

UI Alerts

qunit

Unit Testing
JAVASCRIPT PATTERNS
• AMD (Asynchronous Module Definition)
• is a JavaScript API for defining modules and their
dependencies in such a way that modules may be
asynchronously loaded
• Revealing Module Pattern
• we define all of our functions and variables in the
private scope and return an anonymous object with
pointers to the private functionality we wished to reveal
as public.
• MVVM
AMD PATTERN
Application

Controller

Navigation

Data Services

Data Context

Model

• Sequence of loading component might
cause an issue.
DEFINING A MODULE IN
REQUIRE.JS
Module ID
define('model',

Dependencies

[‘settings', 'model.workspace'],
function (settings, workspace) {
var

model = {
Workspace: workspace
}; // ...
return model;
});

Module Factory
STARTING THE SPA
Bootstrapper

Prime the Data

Setup the presentation

Data Services

HTML Views

Data Context

View Models

Models

Navigation Router
BOOTSTRAPPER
Bootstrapper responsible for initial application run.
define('bootstrapper',
var run = function () {

['jquery', 'route-config', 'presenter', 'dataprimer', 'binder'],
function ($, routeConfig, presenter, dataprimer, binder) {
presenter.toggleActivity(true);
var run = function () {
$.when(dataprimer.fetch())
presenter.toggleActivity(true);
$.when(dataprimer.fetch())
.done(binder.bind)
.done(binder.bind)
.done(routeConfig.register)
.done(routeConfig.register)
.always(function () {
presenter.toggleActivity(false);
.always(function () {
});
}
presenter.toggleActivity(false);
return {
run : run
}}
}});
DATASERVICE
var init = function () {
amplify.request.define('activities', 'ajax', {
url: '/api/activities',
dataType: 'json',
type: 'GET'
}); },
getActivities = function (callbacks) {
return amplify.request({
resourceId: 'activities',
data: '',
success: callbacks.success,
error: callbacks.error
});}; init();
return {
getActivities: getActivities
};
VIEWMODEL
activityItemTemplate = 'common.activityitem',
timelogTemplate = 'common.timelogtable';
activities = ko.observableArray();
activate = function (routerData, callback) {
refresh(callback); }
getWorkspace = function (callback) {
datacontext.activities.getActivities(id);
}
return {
activate: activate
activityItemTemplate: activityItemTemplate,
timelogTemplate: timelogTemplate
}});
AS RESULT WE HAVE
• Async services
• Client side application & business logic

• Long-lived client-side state
• 2 way data binding
• Tombstoning / dropped connection
PROS AND CONS
• Faster UI

• Bad for SEO

• More Interactive

• More complex to build

• Can work offline

• Need to expose
application logic to
client

• UI is just another

Client
• UI can have BI
• Perfect for HTML5

and Mobile apps

• Require strong
JavaScript skills
QUESTIONS?
Yurii Shapovalov
Email: Yurii_Shapovalov@epam.com
Skype: Shapovalov.Yuriy

More Related Content

What's hot

Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
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
Mark Leusink
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Kranthi Lakum
 
Modern Web App Architectures
Modern Web App ArchitecturesModern Web App Architectures
Modern Web App Architectures
Raphael Stary
 
Single page application
Single page applicationSingle page application
Single page application
Jeremy Lee
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
rudib
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
Bilal Amjad
 
Single page application
Single page applicationSingle page application
Single page application
Ismaeel Enjreny
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web applicationRahul Bansal
 
Introduction to angular js july 6th 2014
Introduction to angular js   july 6th 2014Introduction to angular js   july 6th 2014
Introduction to angular js july 6th 2014Simona Clapan
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)Keshab Nath
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
Brij Mishra
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentalsGopal Ji Singh
 
Web component
Web componentWeb component
Web component
EngrHasanuzzamanSumo
 
You Know WebOS
You Know WebOSYou Know WebOS
You Know WebOS
360|Conferences
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
SC5.io
 

What's hot (20)

Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
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
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Modern Web App Architectures
Modern Web App ArchitecturesModern Web App Architectures
Modern Web App Architectures
 
Single page application
Single page applicationSingle page application
Single page application
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
Single page application
Single page applicationSingle page application
Single page application
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web application
 
Introduction to angular js july 6th 2014
Introduction to angular js   july 6th 2014Introduction to angular js   july 6th 2014
Introduction to angular js july 6th 2014
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
 
Asp.net
 Asp.net Asp.net
Asp.net
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
 
Tutorial asp.net
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
 
Web component
Web componentWeb component
Web component
 
You Know WebOS
You Know WebOSYou Know WebOS
You Know WebOS
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
 

Similar to Single Page Applications on JavaScript and ASP.NET MVC4

Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAE
Ron Reiter
 
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
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Beau Lebens
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
Nick Lee
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
toddbr
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
e-suap - client technologies- english version
e-suap - client technologies- english versione-suap - client technologies- english version
e-suap - client technologies- english version
Sabino Labarile
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
MVS: An angular MVC
MVS: An angular MVCMVS: An angular MVC
MVS: An angular MVC
David Rodenas
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
Christian Baranowski
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJSAaronius
 
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Nicolás Bouhid
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
Antônio Roberto Silva
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
pootsbook
 
Backbone js
Backbone jsBackbone js
Backbone js
husnara mohammad
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
Patrick Schroeder
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & Backbone
Ashan Fernando
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
Gunnar Hillert
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
Simon Morvan
 

Similar to Single Page Applications on JavaScript and ASP.NET MVC4 (20)

Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAE
 
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...
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
e-suap - client technologies- english version
e-suap - client technologies- english versione-suap - client technologies- english version
e-suap - client technologies- english version
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
MVS: An angular MVC
MVS: An angular MVCMVS: An angular MVC
MVS: An angular MVC
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJS
 
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & Backbone
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
 

Recently uploaded

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Single Page Applications on JavaScript and ASP.NET MVC4

  • 1. SINGLE PAGE APPLICATIONS WITH JAVASCRIPT AND ASP.NET MVC4 Author: Yurii Shapovalov Yurii_Shapovalov@epam.com
  • 2. TOPICS  Definition  SPA Architecture  Server Stack  Client Stack  JavaScript Patterns  Web Optimization  Examples of components
  • 3. WHAT’S A SPA? • is a web application that fits on a single web page, providing a fluid UX akin to a desktop application. • Maintain navigation, history, page linking. • Whole applications fits on a single web page. • Persisting important state on the client • Fully (or mostly) loaded in the initial page load • Progressively downloads data as required
  • 4. SPA HIGH LEVEL ARCHITECTURE Server Client ASP.NET + (JavaScript / HTML / CSS) Views (HTML / CSS) Data Services Application (JavaScript) Database Data Access (JavaScript) Navigation
  • 5. SERVER SIDE DESIGN Web API ASP.NET Web API Unit of Work Pattern Repository Pattern Entity Framework EF Code First Database JSON
  • 6. ASP.NET WEB API • Simplifies web services • Good for serving JSON JSON Models SQL Server Data Layer ASP.NET Web API
  • 7. CONTROLLERS public IEnumerable<Activity> GetAll() { return Uow.Activities.GetAll().OrderBy(p => p.Name); } public Activity Get(int id) { var activity = Uow.Activities.GetById(id); if(activity != null) return activity; } public HttpResponseMessage Put(Activity activity) { Uow.Activities.Update(activity); Uow.Commit(); return new HttpResponseMessage(HttpStatusCode.NoContent); }}
  • 8. INDEX.HTML • Using HTML5 Boilerplate • (http://html5boilerplate.com/) • Modernizr.js – checks supported features in client browser. • @using System.Web.Optimization • Configuring App_Start • BundleConfig
  • 9. BUNDLING AND MINIFICATION • To reduce size of resources which we transfer to client in initial page load, we are using bundling and minification. • Bundling reduce server calls for resources. • Minification reduce the size of file.
  • 10. BUNDLING • Instead of this: <script type="text/javascript" src="jquery.easing.js"></script> <script type="text/javascript" src="jquery-ui.js"></script> <script type="text/javascript" src="inputlabel.js"></script> <script type="text/javascript" src="jquery.treeview.js"></script> <script type="text/javascript “src="quickpager.jquery.js"></script> <script type="text/javascript" src="jquery.modalboxmin.js"></script> <script type="text/javascript" src="jquery.activity-indi.js"></script> <script type="text/javascript" src="/lib/js/tabs.js"></script> <script type="text/javascript" src="/lib/js/socializ.js"></script> <script type="text/javascript" src="/lib/js/muScript.js"></script> <!-- ... -->
  • 11. BUNDLING … doing this for scripts: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jsextlibs").Include( "~/Scripts/lib/jquery.activity-indicator-{version}.js", "~/Scripts/lib/knockout-{version}.js", "~/Scripts/lib/underscore.js", "~/Scripts/lib/moment.js", "~/Scripts/lib/sammy.js", "~/Scripts/lib/amplify.js" // ... ));
  • 12. BUNDLING … and for other resources: bundles.Add(new ScriptBundle("~/bundles/jsapplibs"). IncludeDirectory("~/Scripts/app/", "*.js", searchSubdirectories: false)); bundles.Add(new StyleBundle("~/Content/css"). Include( "~/Content/normalize.css", "~/Content/main.css", )); bundles.Add(new Bundle("~/Content/Less", new LessTransform(), new CssMinify()) .Include("~/Content/styles.less"));
  • 13. BUNDLING Add bundles on index.html @Styles.Render("~/Content/css", "~/Content/less") @Scripts.Render("~/bundles/modernizr") @Scripts.Render( "~/bundles/jquery", "~/bundles/jsextlibs", "~/Scripts/lib/require.js", "~/bundles/jsapplibs", "~/bundles/jsmocks", "~/Scripts/main.js" )
  • 14. BUNDLING AND MINIFICATION Using B/M Without B/M Chang e File Requests 9 34 256% KB Sent 3.26 11.92 266% KB Received 388.51 530 36% 780 MS 53% Load Time 510 MS
  • 15. CSS AND LESS Less – Dynamic Stylesheet language .accent-top (@sizeMultiplier: 1, @lineHeightMultiplier: 1) { .accent; width: @base-accent-top-width * @sizeMultiplier; height: @base-accent-top-height * @sizeMultiplier; div { text-transform: uppercase; }}
  • 16. LESS TO CSS  Creating custom BundleTransform using library dotLett. public class LessTransform : IBundleTransform { public void Process(BundleContext c, BundleResponse resp) { resp.Content = dotless.Core.Less.Parse(resp.Content); response.ContentType = "text/css"; }}
  • 17. RENDER VIEWS • Render all pages in main section. • All pages are stored in Views folder • General components like header, navigation and footer we are defining above or below of main section. <section class="main"> @RenderPage("Views/workspace.cshtml") @RenderPage("Views/statistics.cshtml") @RenderPage("Views/settings.cshtml") @* ... *@ </section>
  • 18. VIEWS • View is a simple html with data-bind. • Views might contain Knockout templates <section id="workspace-view" class="view"> <h2 data-bind="text: context.date"></h2> <ul data-bind="template: { name: 'activity-template', foreach: activities }" class="activity"></ul> <button data-bind="click: addActivity" class="addactivity">+</button> <table data-bind="template: { name: timelogTemplate }"> </table> </section>
  • 19. CLIENT SIDE DESIGN HTML Views HTML Views HTML Views HTML / Views Bootstrapper MVVM Binder HTML / Views HTML / Views HTML / Views ViewModels Sorting Filtering Data Primer HTML / Views HTML / Views HTML / Views Models Data Context Data Services Model Mappers Model Mappers Model Mappers Model Mappers
  • 20. JAVASCRIPT LIBRARIES jQuery Working with DOM, Knockout.js Data Binding and MVVM Amplify.js Data Push/Pull, Caching, Client Storage Breeze.js Querying with filters, ordering and paging Sammy.js Navigation and History require.js Dependency Resolution underscore.js JavaScript helper toastr.js UI Alerts qunit Unit Testing
  • 21. JAVASCRIPT PATTERNS • AMD (Asynchronous Module Definition) • is a JavaScript API for defining modules and their dependencies in such a way that modules may be asynchronously loaded • Revealing Module Pattern • we define all of our functions and variables in the private scope and return an anonymous object with pointers to the private functionality we wished to reveal as public. • MVVM
  • 22. AMD PATTERN Application Controller Navigation Data Services Data Context Model • Sequence of loading component might cause an issue.
  • 23. DEFINING A MODULE IN REQUIRE.JS Module ID define('model', Dependencies [‘settings', 'model.workspace'], function (settings, workspace) { var model = { Workspace: workspace }; // ... return model; }); Module Factory
  • 24. STARTING THE SPA Bootstrapper Prime the Data Setup the presentation Data Services HTML Views Data Context View Models Models Navigation Router
  • 25. BOOTSTRAPPER Bootstrapper responsible for initial application run. define('bootstrapper', var run = function () { ['jquery', 'route-config', 'presenter', 'dataprimer', 'binder'], function ($, routeConfig, presenter, dataprimer, binder) { presenter.toggleActivity(true); var run = function () { $.when(dataprimer.fetch()) presenter.toggleActivity(true); $.when(dataprimer.fetch()) .done(binder.bind) .done(binder.bind) .done(routeConfig.register) .done(routeConfig.register) .always(function () { presenter.toggleActivity(false); .always(function () { }); } presenter.toggleActivity(false); return { run : run }} }});
  • 26. DATASERVICE var init = function () { amplify.request.define('activities', 'ajax', { url: '/api/activities', dataType: 'json', type: 'GET' }); }, getActivities = function (callbacks) { return amplify.request({ resourceId: 'activities', data: '', success: callbacks.success, error: callbacks.error });}; init(); return { getActivities: getActivities };
  • 27. VIEWMODEL activityItemTemplate = 'common.activityitem', timelogTemplate = 'common.timelogtable'; activities = ko.observableArray(); activate = function (routerData, callback) { refresh(callback); } getWorkspace = function (callback) { datacontext.activities.getActivities(id); } return { activate: activate activityItemTemplate: activityItemTemplate, timelogTemplate: timelogTemplate }});
  • 28. AS RESULT WE HAVE • Async services • Client side application & business logic • Long-lived client-side state • 2 way data binding • Tombstoning / dropped connection
  • 29. PROS AND CONS • Faster UI • Bad for SEO • More Interactive • More complex to build • Can work offline • Need to expose application logic to client • UI is just another Client • UI can have BI • Perfect for HTML5 and Mobile apps • Require strong JavaScript skills

Editor's Notes

  1. Today we are going to talk about how to build Single Page Application using ASP.NET MVC4 and JavaScript with bunch of libraries.So, let’s start.
  2. Here is briefly a topics to discuss today. I will focus mostly on client side, because it’s usually much more complex than server side for Single Page Applications.
  3. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  4. Typical high level architecture consists of client and server side.On server side we have database, ASP.NET services, which transfer to client all required resources, HTML, CSS, JavaScript)And Data Services which responsible for data access, and asynchronous communication with application.Client side has initialialized HTML page (only one html page per application), CSS files.And JavaScript which might be splitted to several components: Application (component contain business logic)Navigation (maintain transition between views)And Data Access layer which support communication between services, and asynchronous data loading.When client call our application, server returns all required stuff, and call initialization procedure when everything is downloaded.Initialization procedure prepare all components, apply settings. As result, we have complete web application on clientApplication communicate services through Data Access component, and retrieve data on demand.
  5. Server side store the data, so, database on server side is a key component. ORM like EntityFramework will help to access data in DB. Data layer consists of several patterns which provide data in consistent way, and decouple operations and data.Repository pattern which isolate objects from code for accessing them.Unit of work – maintain set of repositories, and manage commit operations, also handles concurrency issues.And our services are exposed in Web API, which is implemented with ASP.NET Web API and using JSON format for transferring data to the client.
  6. ASP.NET providing asynchronous services to client, it works with data layer, receive required entities or collections of entities, and transfer them to client in JSON format.
  7. Typical controller looks like this.Operations call UnitOfWork and define which repository need to use. Call the operation in this repository, and apply some filter or ordering for received data.Than transfer it to client.(I have reduce size of methods, remove exception handling, input values validation, and business logic, just to simplify example, but it’s not ready to production code.)
  8. I’m sure most of you have seen such html code. It usually stands in head files, or at the end of the body.Let me ask you a question, what will do browser? …Yes, it will send to server bunch or requests for each file.And server of course return these files, usually with tabs, spaces, some developers comments.So, you probably get my point, we need to minify these files, and transfer them to client in one response.
  9. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  10. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  11. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  12. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  13. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  14. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  15. What JavaScript libraries might help for this needs:First of all, it’s jQuery for DOM manipulating, retrieving the views (I mean finding them in DOM) and so on.Knockout.js needs for data binding, and implementation of MVVM patternAmplify.js – this library will help to push data to the services and get information from there, it supports caching, so allows to cache some responses.Breeze.js – useful library which allows us create queries to our data, it’s like a linq for JavaScript. By the way… library also supports caching, but I prefer to use caching on layers which is close to server data services.Sammy.js – maintain navigation based on hash tag after url, and store history of user actions. Quite useful right.We will have a lot of JavaScript code, and will be good to organize it well – require.js will help us. It allows to make componetes with javascript classes, and load them asynchronously.Underscore.js – will help to work with collections of elements, and will be interesting for those, who like functional programming.Toastr.js – to create notifications, popups, error messages on UIQunit – we are professionals, and we cannot believe that our code will work well, we need to prove it by unit tests at least, so, I like qunit library for this.That’s even not all libraries, but this is the most significant one. Others will depends on functional and non-functional requirements to our application.
  16. AMD (Asynchronous Module Definition)is a JavaScript API for defining modules and their dependencies in such a way that modules may be asynchronously loadedRevealing Module Patternwe define all of our functions and variables in the private scope and return an anonymous object with pointers to the private functionality we wished to reveal as public.MVVMMVVM facilitates a clear separation of the development of the graphical user interface from the development of the business logic or back end logic known as the model 
  17. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  18. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  19. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  20. What is a SPA, (definition from Wikipedia)Sounds like a simple concept, right?What else specific options we can define, which relates to SPA?Application maintain navigation, history of transitions. And application!, but not browser responsible for linking of all pages (or views in terms of SPA).Whole application fits on a single web page. So we don’t need to refresh the page when user click to some internal link.Persisting important state on the client. Server might know nothing what view are opened on clients side, all such information are stored on client.Fully loaded on the initial page load, and progressively downloads data as required.
  21. Here is my contacts, please feel free to contact me if you will have any questions according to SPA, or subject that we discussed.I will be glad to discuss different approaches in building SPA.Do you have any questions?