Single Page Apps

22
Single Page Apps Presented By Mike Acord Microsoft Solutions Architect May 12, 2014 http://www.omniresources.com https://www.linkedin.com/in/ michaelacord

description

Presentation on Single Page Applications I recently gave for a client. Feel free to contact Omni Resources at http://www.omniresources.com or myself on LinkedIn at https://www.linkedin.com/in/michaelacord if you would like to learn more about builiding Single Page Apps.

Transcript of Single Page Apps

Page 1: Single Page Apps

Single Page AppsPresented By Mike Acord

Microsoft Solutions Architect

May 12, 2014http://www.omniresources.comhttps://www.linkedin.com/in/michaelacord

Page 2: Single Page Apps

SPA Agenda

• What is a SPA?• Examples• Advantages/Challenges• SPA Technologies• SPA Frameworks• Q & A

Page 3: Single Page Apps

So, What is SPA?

Page 4: Single Page Apps

Single Page Applications

• Native-like user interface• Fluid• Fast• Page loaded once, updates with

JavaScript• Interactive

Page 5: Single Page Apps

Traditional Characteristics

• HTML5• JSON• Routing• RESTful web services• Data binding• Templates

Page 8: Single Page Apps

SPA Examples

Page 9: Single Page Apps

Example: Twitter

Page 10: Single Page Apps

Advantages

• Fluid interface• Native feel• Server scale• Mobile friendly• Can distribute as an App• Ability to work offline• Client-side caching• Trendy

Page 11: Single Page Apps

Challenges

• New skills required (JavaScript)• SEO• Bookmarking• Duplicate logic server/client side• Testing• Debugging• Large initial page load

Page 12: Single Page Apps

SPA TechnologiesWelcome to your new tech stack

Page 13: Single Page Apps

SPA Technologies

Routing

{{View Templates}}

Page 14: Single Page Apps

RESTful API

• "REpresentational State Transfer• Alternative to complex SOAP/WSDL• Use HTML Action headers to distinguish

actions• Methods:

• GET: Get the item details• PUT: Update an item• POST: Create an item• DELETE: Delete the item

Page 15: Single Page Apps

RESTful API

• Tree-like hierarchy URI, often human readable• Example: /food/fruit/apples/fuji

• Typically returns JavaScript Object Notation (JSON)

• Stateless: server does not keep track of user state

• Standard: most libraries understand REST

Page 16: Single Page Apps

Routing

• Determines what page to display

Routing

Page 17: Single Page Apps

Routing

• Allows direct linking• Allows bookmarking• Allows History (Back/Forward)• Preserves page state

Routing

Page 18: Single Page Apps

View Templates

• Clean separation of html (View) from JavaScript

• Allows reuse• Use separate template files

{{View Templates}}

Page 19: Single Page Apps

Other SPA Technologies

• HTML5 Storage• PushState• Data Binding• On-demand file loading• OAuth• PhoneGap

Page 20: Single Page Apps

SPA FrameworksHelping put it all together

Page 21: Single Page Apps

SPA Frameworks

Page 22: Single Page Apps

Thank you!Q & A

http://www.omniresources.comhttps://www.linkedin.com/in/michaelacord