SlideShare a Scribd company logo
5
Most read
Single Page Application
Single Page Applicationalso called SPA – is creating a
huge impact of web application development.This brings in lot of benefitto
web application development – since it brings in lot of features like
1. Componentbased development
2. Stateful development.
3. MVC creation using JavaScript tightly coupled.
4. Encapsulated with State data.
5. Operations/methodsare tightly bound to class.
A single-page application (SPA), also known as single-page interface
(SPI), is a web application or web site that fits on a single web page
with the goal of providing a more fluid user experience akin to a
desktop application.
In an SPA,either all necessary code – HTML, JavaScript, and CSS –
is retrieved with a single page load, or partial changes are performed
loading new code on demand from the web server, usually driven by
user actions. The page does not automatically reload during user
interaction with the application, nor does control transfer to another
page. Updates to the displayed page may or may not involve
interaction with a server.
As shown above in the picture one single web page which assembles the
components and it maintains the state. The current web sites switches between
different sites.
Write-only DOM. No state / data is read from the DOM. The application outputs
HTML and operations on elements, but nothing is ever read from the DOM. Storing
state in the DOM gets hard to manage very quickly: it is much better to have one
place where the data lives and to render the UI from the data, particularly when the
same data has to be shown in multiple places in the UI.
Models as the single source of truth. Instead of storing data in the DOM or in
random objects, there is a set of in-memory models which represent all of the
state/data in the application.
Views observe model changes. We want the views to reflect the content of the
models. When multiple views depend on a single model (e.g. when a model changes,
redraw these views), we don't want to manually keep track of each dependent view.
Instead of manually tracking things, there is a change event system through which
views receive change notifications from models and handle redrawing themselves.
Decoupled modules that expose small external surfaces. Instead of making
things global, we should try to create small subsystems that are not interdependent.
Dependencies make code hard to set up for testing. Small external surfaces make
refactoring internals easy, since most things can changes as long as the external
interface remains the same.
Minimizing DOM dependent-code. Why? Any code that depends on the DOM
needs to be tested for cross-browser compatibility. By writing code in a way that
isolates those nasty parts, a much more limited surface area needs to be tested for
cross-browser compatibility. Cross-browser incompatibilities are a lot more
manageable this way. Incompatibilities are in the DOM implementations, not in the
Javascript implementations, so it makes sense to minimize and isolate DOM -
dependent code
On a Single Page Application, the server-side will be responsible for:
 Handling CRUD (Create, Read, Update and Delete) operations
 Executing different operations and workflows (these may include changing states
of entities, updating database records)
 Authentication and Authorization (this should always be done on the server side
to ensure that the requests are legitimate)
 Validation of web requests
 Providing an interface for the client application to perform operations (typically
done via a REST API)
The client side will be responsible for:
 Populating and rendering the UI with proper data
 Access the server via AJAX
 Perform client side routing
 Perform client side validation
Angular JS this is one tool which helps in creating SPA application
 Data-binding: It is the automatic synchronization of data between model and view
components.
 Scope: These are objects that refer to the model. They act as a glue between controller
and view.
 Controller: These are Javascript functions that are bound to a particular scope.
 Services: AngularJS come with several built-in services for example $http to make a
XMLHttpRequests. These are singleton objects which are instantiated only once in app.
 Filters: These select a subset of items from an array and returns a new array.
 Directives: Directives are markers on DOM elements (such as elements, attributes, css,
and more). These can be used to create custom HTML tags that serve as new, custom
widgets. AngularJS has built-in directives (ngBind, ngModel...)
 Templates:These are the rendered view with information from the controller and model.
These can be a single file (like index.html) or multiple views in one page using "partials".
 Routing: It is concept of switching views.
 Model View Whatever: MVC is a design pattern for dividing an application into different
parts (called Model, View and Controller), each with distinct responsibilities. AngularJS
does not implement MVC in the traditional sense, but rather something closer to MVVM
(Model-View-ViewModel). The Angular JS team refers it humorously as Model View
Whatever.
 Deep Linking: Deep linking allows you to encode the state of application in the URL so
that it can be bookmarked. The application can then be restored from the URL to the same
state.
 Dependency Injection: AngularJS has a built-in dependency injection subsystem that
helps the developer by making the application easier to develop, understand, and test.
Advantages of AngularJS
 AngularJS provides capability to create Single Page Application in a very clean and
maintainable way.
 AngularJS provides data binding capability to HTML thus giving user a rich and responsive
experience
 AngularJS code is unit testable.
 AngularJS uses dependency injection and make use of separation of concerns.
 AngularJS provides reusable components.
 With AngularJS, developer write less code and get more functionality.
 In AngularJS, views are pure html pages, and controllers written in javascript do the
business processing.
On top of everything, AngularJS applications can run on all major browsers and smart phones
including Android and iOS based phones/tablets.
Sample Loading Stack on how the modules are getting loaded
All the specific functionalities are defined as modules in the system which
mostly representobjects – Apps.js
This does the routing part on click of what which module should be routed
will be handled by - States.js
The Screen representationwhich is Html definition of the screens will be
mentioned here.
Every html will be supported by one controller this controller provides the
supportive functionality for the screens.
The Associated data which is populated from the Mongo DB is essentially
pulled from Service.js this makes a remote call in pulling the data

More Related Content

PDF
AngularJS - introduction & how it works?
PPTX
Angular js
PPTX
AngularJS = Browser applications on steroids
PPTX
Introduction to react js and reasons to go with react js in 2020
PPTX
Intro to angular
PPTX
jQuery programming with visual web part
DOC
Week1 dq5
PPTX
ASP .NET MVC
AngularJS - introduction & how it works?
Angular js
AngularJS = Browser applications on steroids
Introduction to react js and reasons to go with react js in 2020
Intro to angular
jQuery programming with visual web part
Week1 dq5
ASP .NET MVC

What's hot (20)

PPTX
Asp.net mvc presentation by Nitin Sawant
PPT
ASP .net MVC
PPTX
New Features of ASP.NET 4.0
PPSX
Asp.net mvc
PPTX
ASP .NET MVC Introduction & Guidelines
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
PDF
ASP.NET MVC 3
PPT
MVC ppt presentation
PPT
Asp.net mvc
PPT
MVC(Model View Controller),Web,Enterprise,Mobile
PDF
Building Web Application Using Spring Framework
PPTX
What's new in Angular 2?
PDF
Modern webtechnologies
PPTX
Angular js
PPTX
JSF 2.3: Integration with Front-End Frameworks
PPT
CTTDNUG ASP.NET MVC
PPTX
Mvc 4 0_jayant_jindal_28082010
PPTX
ASP.NET MVC.
 
PPT
MVC
PPTX
Model view controller (mvc)
Asp.net mvc presentation by Nitin Sawant
ASP .net MVC
New Features of ASP.NET 4.0
Asp.net mvc
ASP .NET MVC Introduction & Guidelines
Learning AngularJS - Complete coverage of AngularJS features and concepts
ASP.NET MVC 3
MVC ppt presentation
Asp.net mvc
MVC(Model View Controller),Web,Enterprise,Mobile
Building Web Application Using Spring Framework
What's new in Angular 2?
Modern webtechnologies
Angular js
JSF 2.3: Integration with Front-End Frameworks
CTTDNUG ASP.NET MVC
Mvc 4 0_jayant_jindal_28082010
ASP.NET MVC.
 
MVC
Model view controller (mvc)
Ad

Viewers also liked (20)

PPS
Italia, coasta
PPS
Catch the moment (new ones!)
PPT
Media And Money
PPS
instant foto
PPT
Cause Marketing - A Journey
PPTX
The classroom of the future is virtual
PPTX
Think before you click
PPTX
Biblioteche di ateneo e Iris
PPTX
Unicasorienta 2012
PPS
Dubai..pps
PPS
Valencia - orasul artelor si a stiintei
KEY
Jisc rsc morris_2012
PPT
Orasul fara strazi din Olanda
PDF
Arte latinoamericano
PPTX
What gets into Software code after some time
PPS
Expo Milano 2015
PPS
Funny accidents
PDF
Copyright Review Workshop Uct April 2008
PPTX
Html5 (looks ready for everything)
Italia, coasta
Catch the moment (new ones!)
Media And Money
instant foto
Cause Marketing - A Journey
The classroom of the future is virtual
Think before you click
Biblioteche di ateneo e Iris
Unicasorienta 2012
Dubai..pps
Valencia - orasul artelor si a stiintei
Jisc rsc morris_2012
Orasul fara strazi din Olanda
Arte latinoamericano
What gets into Software code after some time
Expo Milano 2015
Funny accidents
Copyright Review Workshop Uct April 2008
Html5 (looks ready for everything)
Ad

Similar to Single Page Application (20)

PPTX
Benefits of developing single page web applications using angular js
PDF
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
PPTX
Single page applications
PPTX
Anjular js
PDF
Javascript Client & Server Architectures
PPTX
Tech io spa_angularjs_20130814_v0.9.5
PPTX
AngularJS Anatomy & Directives
PPTX
The Growing Popularity of AngularJS
PPTX
Single Page Applications: Your Browser is the OS!
PDF
A white paper on Fundamentals and Implementations of Angular JS
PPTX
Angular jS Introduction by Google
 
PPTX
Single Page Angular Application Presentation
PPTX
Single Page Angular Application Presentation
PPTX
Angular js introduction
PPTX
Writing a massive javascript app
PPT
Top java script frameworks ppt
PPTX
Canopy view of single-page applications (SPAs)
PDF
AngularJS in Production (CTO Forum)
PDF
End to-End SPA Development Using ASP.NET and AngularJS
Benefits of developing single page web applications using angular js
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Single page applications
Anjular js
Javascript Client & Server Architectures
Tech io spa_angularjs_20130814_v0.9.5
AngularJS Anatomy & Directives
The Growing Popularity of AngularJS
Single Page Applications: Your Browser is the OS!
A white paper on Fundamentals and Implementations of Angular JS
Angular jS Introduction by Google
 
Single Page Angular Application Presentation
Single Page Angular Application Presentation
Angular js introduction
Writing a massive javascript app
Top java script frameworks ppt
Canopy view of single-page applications (SPAs)
AngularJS in Production (CTO Forum)
End to-End SPA Development Using ASP.NET and AngularJS

More from Prasad Narasimhan (20)

PPTX
PPTX
Technology needs to be disruptive
PPTX
Riseof technology
PPTX
Information as commodity
PPTX
Data visualization representation of Analytics data
PPTX
Art of creating good software
PPTX
Internet of things & predictive analytics
PPTX
Application of predictive analytics
PPTX
Software engineering at the speed of technology
PPTX
Challenges in adapting predictive analytics
PPTX
Predictive analytics in marketing
PPTX
Predictive analytics in financial service
PPTX
Predictive analytics in health insurance
PPTX
3D printing
PPTX
Internet of things
PPTX
360 degree view of architect
PPTX
Where business meet’s IT
PPTX
Information + insight = action
PPTX
Become a software technical architect
PPTX
What is happening in Information Technology
Technology needs to be disruptive
Riseof technology
Information as commodity
Data visualization representation of Analytics data
Art of creating good software
Internet of things & predictive analytics
Application of predictive analytics
Software engineering at the speed of technology
Challenges in adapting predictive analytics
Predictive analytics in marketing
Predictive analytics in financial service
Predictive analytics in health insurance
3D printing
Internet of things
360 degree view of architect
Where business meet’s IT
Information + insight = action
Become a software technical architect
What is happening in Information Technology

Single Page Application

  • 1. Single Page Application Single Page Applicationalso called SPA – is creating a huge impact of web application development.This brings in lot of benefitto web application development – since it brings in lot of features like 1. Componentbased development 2. Stateful development. 3. MVC creation using JavaScript tightly coupled. 4. Encapsulated with State data. 5. Operations/methodsare tightly bound to class. A single-page application (SPA), also known as single-page interface (SPI), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application. In an SPA,either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load, or partial changes are performed loading new code on demand from the web server, usually driven by user actions. The page does not automatically reload during user interaction with the application, nor does control transfer to another page. Updates to the displayed page may or may not involve interaction with a server.
  • 2. As shown above in the picture one single web page which assembles the components and it maintains the state. The current web sites switches between different sites. Write-only DOM. No state / data is read from the DOM. The application outputs HTML and operations on elements, but nothing is ever read from the DOM. Storing
  • 3. state in the DOM gets hard to manage very quickly: it is much better to have one place where the data lives and to render the UI from the data, particularly when the same data has to be shown in multiple places in the UI. Models as the single source of truth. Instead of storing data in the DOM or in random objects, there is a set of in-memory models which represent all of the state/data in the application. Views observe model changes. We want the views to reflect the content of the models. When multiple views depend on a single model (e.g. when a model changes, redraw these views), we don't want to manually keep track of each dependent view. Instead of manually tracking things, there is a change event system through which views receive change notifications from models and handle redrawing themselves. Decoupled modules that expose small external surfaces. Instead of making things global, we should try to create small subsystems that are not interdependent. Dependencies make code hard to set up for testing. Small external surfaces make refactoring internals easy, since most things can changes as long as the external interface remains the same. Minimizing DOM dependent-code. Why? Any code that depends on the DOM needs to be tested for cross-browser compatibility. By writing code in a way that isolates those nasty parts, a much more limited surface area needs to be tested for cross-browser compatibility. Cross-browser incompatibilities are a lot more manageable this way. Incompatibilities are in the DOM implementations, not in the Javascript implementations, so it makes sense to minimize and isolate DOM - dependent code On a Single Page Application, the server-side will be responsible for:  Handling CRUD (Create, Read, Update and Delete) operations
  • 4.  Executing different operations and workflows (these may include changing states of entities, updating database records)  Authentication and Authorization (this should always be done on the server side to ensure that the requests are legitimate)  Validation of web requests  Providing an interface for the client application to perform operations (typically done via a REST API) The client side will be responsible for:  Populating and rendering the UI with proper data  Access the server via AJAX  Perform client side routing  Perform client side validation Angular JS this is one tool which helps in creating SPA application
  • 5.  Data-binding: It is the automatic synchronization of data between model and view components.  Scope: These are objects that refer to the model. They act as a glue between controller and view.  Controller: These are Javascript functions that are bound to a particular scope.  Services: AngularJS come with several built-in services for example $http to make a XMLHttpRequests. These are singleton objects which are instantiated only once in app.  Filters: These select a subset of items from an array and returns a new array.  Directives: Directives are markers on DOM elements (such as elements, attributes, css, and more). These can be used to create custom HTML tags that serve as new, custom widgets. AngularJS has built-in directives (ngBind, ngModel...)
  • 6.  Templates:These are the rendered view with information from the controller and model. These can be a single file (like index.html) or multiple views in one page using "partials".  Routing: It is concept of switching views.  Model View Whatever: MVC is a design pattern for dividing an application into different parts (called Model, View and Controller), each with distinct responsibilities. AngularJS does not implement MVC in the traditional sense, but rather something closer to MVVM (Model-View-ViewModel). The Angular JS team refers it humorously as Model View Whatever.  Deep Linking: Deep linking allows you to encode the state of application in the URL so that it can be bookmarked. The application can then be restored from the URL to the same state.  Dependency Injection: AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test. Advantages of AngularJS  AngularJS provides capability to create Single Page Application in a very clean and maintainable way.  AngularJS provides data binding capability to HTML thus giving user a rich and responsive experience  AngularJS code is unit testable.  AngularJS uses dependency injection and make use of separation of concerns.  AngularJS provides reusable components.  With AngularJS, developer write less code and get more functionality.  In AngularJS, views are pure html pages, and controllers written in javascript do the business processing. On top of everything, AngularJS applications can run on all major browsers and smart phones including Android and iOS based phones/tablets.
  • 7. Sample Loading Stack on how the modules are getting loaded All the specific functionalities are defined as modules in the system which mostly representobjects – Apps.js This does the routing part on click of what which module should be routed will be handled by - States.js The Screen representationwhich is Html definition of the screens will be mentioned here. Every html will be supported by one controller this controller provides the supportive functionality for the screens. The Associated data which is populated from the Mongo DB is essentially pulled from Service.js this makes a remote call in pulling the data