introduction tosinglepageapplications
DESCRIPTION
TRANSCRIPT
The Trusted Technology Partner in Business Innovation
PASSION DISCIPLINE INNOVATION TEAMING INTEGRITY
By Muhammad Nabeel
November 20, 2012
INTRODUCTION TO SINGLE PAGE APPLICATIONS
ABOUT ME
• Sr. Consultant at Neudesic
• More than 12 years of experience
• Currently working on HTML5, Web API and jQuery
• Blogs at mnabeelkhan.blogspot.com
AGENDA
• What is Single Page Application?
• Key features
• Pros and Cons
• Developing a Single Page Application
• Demo
• Q &A
WHAT IS SINGLE PAGE APPLICATION
Rich and responsive web application that fits in a single
page providing a fluid interface by loading all necessary
code with a single page load
TYPICAL WEB APPLICATION
• Has multiple pages
• Server is called multiple times during user interaction
• Typically web applications does not have offline story.
• Set established frameworks.
KEY FEATURES OF SINGLE PAGE APPLICATION
• Fits on a single page
• Maintains navigation history and deep linking
• Persisting important state on the client
• Fully* loads on initial page load
• Using Asynchronous downloads of features if needed.
PROS AND CONS
• Fluid UI – Means better user experience
• More interactive – By the use of Async calls
• Better for perceived performance
• Separation of Concerns
• Better for mobile apps
• Offline story
PROS
• Complex architecture
• Need better understanding of different JavaScript libraries
• Special attention is needed for huge applications
• Bad for Search Engine Optimization
CONS
EXAMPLE OF SINGLE PAGE APPLICATIONS
• Gmail
• iCloud
• www.morphix.si
• http://fuelbrandinc.com
• http://learn.knockoutjs.com/
SINGLE PAGE APPLICATION - ARCHITECTURE
DEVELOPING A SINGLE PAGE APPLICATION
• HTML 5, WebAPI, Knockout and jQuery
• Pager.js (http://oscar.finnsson.nu/pagerjs)
• ScaleApp (http://scaleapp.org/)
AVAILABLE PATTERNS AND FRAMEWORKS
SINGLE PAGE APPLICATION – LIFE CYCLE
LIBRARIES
• KnockoutJS – For data binding.
• upshotJS – For retrieving data from server and caching at
client side.
• Nav.js – For navigation and history management.
SPA - BEST PRACTICES
• Define Goal – Preplan the sequence of web site and what
you want to achieve.
• Start with establishing a file structure
• Establish tools and libraries that are needed.
• Develop the HTML and CSS before the JavaScript
• Add JavaScript
• Inspect the HTML
• Add unit tests
DEMO
Requirements
• Visual Studio 2010+
• ASP.NET MVC 4.0
• Libraries
Developing a huge single page application should be like
developing multiple small pages. That is the only way you'll
be able to scale up and out the development.
DEVELOPMENT CONSIDERATION
RESOURCES
• Book – Single Page Web Applications
by Josh C. Powell
• http://knockoutjs.com
• http://www.asp.net/single-page-application
QUESTIONS AND ANSWERS
mnabeelkhan.blogspot.com