A Dip in the SPA get wet with Single Page Apps

26
Ward Bell www.ideablade. com A Dip in the SPA get wet with Single Page Apps

description

A Dip in the SPA get wet with Single Page Apps. Ward Bell www.ideablade.com. http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159. Single Page Application. Rich and responsive like a desktop app but built with HTML5 and JavaScript. Why not just build a desktop app?. - PowerPoint PPT Presentation

Transcript of A Dip in the SPA get wet with Single Page Apps

Page 1: A Dip in the SPA get wet with Single Page Apps

Ward Bellwww.ideablade.com

A Dip in the SPAget wet with Single Page Apps

Page 3: A Dip in the SPA get wet with Single Page Apps

Single Page Application

Rich and responsive like a desktop appbut built with HTML5 and JavaScript

Page 4: A Dip in the SPA get wet with Single Page Apps

Why not just build a desktop app?

Page 5: A Dip in the SPA get wet with Single Page Apps

Mobile platformsAnti-plugin bias“Shift in direction”

Page 6: A Dip in the SPA get wet with Single Page Apps

Not Widgets

But they inspire with their responsiveness

http://worrydream.com/bartwidget/

Brett Victor: http://vimeo.com/36579366

Page 7: A Dip in the SPA get wet with Single Page Apps

LOB Apps: forms over data

Page 9: A Dip in the SPA get wet with Single Page Apps

Single Page Application

A web page hosts layout & contentcomposed dynamically on the client

with JavaScript

Page 10: A Dip in the SPA get wet with Single Page Apps

DEMO: WE MIGHT GO HERE

Noyes UpshotDataControllerDemo

Page 11: A Dip in the SPA get wet with Single Page Apps

DEMO: WE’LL BUILD TOGETHER

SPA Demo 3_ExtTmpls

Page 12: A Dip in the SPA get wet with Single Page Apps

SPA ArchitectureVisible UIHTML/CSS

ApplicationJavaScript

Data AccessJavaScript

Offline

Web UIHTML/CSS/JS

Data ServicesJSON/XML

Server Client

NavigationJavaScript

Local Storage

Page 13: A Dip in the SPA get wet with Single Page Apps

nav.jshistory.js

knockout.js

upshot.js

jQuery & friends

Client JavaScript Libraries

Navigation

MVVM

Data & Model Management

DOM / AJAX

Page 15: A Dip in the SPA get wet with Single Page Apps

MVVM with knockout.js

http://jsfiddle.net/wardbell/uzrCN/1/

Page 16: A Dip in the SPA get wet with Single Page Apps

knockout (ko) on jsfiddle

http://www.knockmeout.net/2011/08/all-of-knockoutjscom-live-samples-in.htmlExplore Ryan Niemeyer’s fiddles:

Page 18: A Dip in the SPA get wet with Single Page Apps

upshot.js• Microsoft client JavaScript library • By ASP.NET team• Pre-beta! • Learn: http://

www.asp.net/single-page-application • Open source:

http://aspnetwebstack.codeplex.com/

Page 19: A Dip in the SPA get wet with Single Page Apps

upshot.js• Client-side data management– call services (query, save)– cache data as model objects– change tracking & validation

• Plays nice with KO• Open data source (potentially)– ASP.NET Web API Data Controller– WCF RIA Domain Services

Page 20: A Dip in the SPA get wet with Single Page Apps

Web APP not Web Site

Web development experience does not prepare you to build SPAs

Page 21: A Dip in the SPA get wet with Single Page Apps

Closer to Silverlight apps

• Async services• Client-side application & business

logic• Long-lived client-side state• 2-way data binding (MVVM)• Coping with bad connections

Similar problems and solution patterns

Page 22: A Dip in the SPA get wet with Single Page Apps

Not Ready For Prime Time

Explore … have fun … beware!

Page 23: A Dip in the SPA get wet with Single Page Apps

Upshot far from ready

Unstable libraries

No clear library winners

New JavaScript coding practices

Weak tooling (intellisense, debugging)

Browser incompatabilities

Page 24: A Dip in the SPA get wet with Single Page Apps

Ship date?

Documentation

Samples (most don’t work)

“To Do”s everywhere

Multi-part keys

Model navigation

Projections/Includes

Metadata anomalies

Heavy payload

upshot premature

Page 25: A Dip in the SPA get wet with Single Page Apps

Resources• Steve’s SPA video

http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159

• Steve Sanderson blog http://blog.stevensanderson.com

• ASP SPA http://www.asp.net/single-page-application

• Bart Jolling Tutorial http://bartjolling.blogspot.com/2012/02/building-single-page-apps-with-aspnet.html

• John Papa Knockout video course on PluralSighthttp://www.pluralsight-training.net/microsoft/Courses/TableOfContents?courseName=knockout-mvvm

• Brian Noyes DevConn Demoshttp://briannoyes.net/2012/03/28/DevConnectionsSlidesAndDemosndashUpshotAndPrism.aspx