1 / 10

Building Single Page Application Ori Calvo ori.calvo@gmail.com

Building Single Page Application Ori Calvo ori.calvo@gmail.com. Client vs. Server. The web world is changing focus We want web application not just web site Better UX Mobile HTML5 As result more application logic moves to the client side Security ?. The Challenge.

sora
Download Presentation

Building Single Page Application Ori Calvo ori.calvo@gmail.com

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building Single Page ApplicationOriCalvoori.calvo@gmail.com

  2. Client vs. Server • The web world is changing focus • We want web application not just web site • Better UX • Mobile • HTML5 • As result more application logic moves to the client side • Security ?

  3. The Challenge • Writing a lot of JavaScript is not easy • Good news • Dev Tools have better support for JavaScript • Browsers have better debugging capabilities • Libraries are far more mature then before • Bad news • Still no complier checking • Refactoring is not supported well

  4. Solution 1 • Don’t write JavaScript. • Use a Java/C#/CoffeScript/XXX to JavaScript complier • Enjoy type checking • Enjoy refactoring • Hard to simulate advanced JavaScript capabilities • Might be hard to integrate 3rd party JavaScript libraries

  5. Solution 2 • Become JavaScript expert • Master the language until it feels natural • JavaScript has cons and pros • Embrace the good things. Ignore the bad • Wait for a new language specification

  6. Structuring Web Application • No matter the approach you choose • Dealing with a lot of client side code requires structure and discipline • Currently, there is no dominate library/framework for structuring web application • AngularJS, Backbone • Batman, CanJS • Ember, Meteor • Knockout, Spine

  7. Demo • Demonstrate how we can use well known libraries to create Single Page Application • While keeping reasonable design and maintainable code

  8. Architecture • Model – logical class the manages state and rules • View – Class that manages UI (DOM element) • App – Class that co-ordinate Models and Views • Controller like • All code and views are uploaded up front • Server is used only for • Fetching startup code • Loading/Saving data

  9. Architecture • Model – Plain JavaScript class • View – A wrapper around KnockoutJS template • App – Plain… • Router – A wrapper around Backnone’s router to manage browser URL • Template – A CSHTML managed by ASP.NET MVC

  10. Let’s Script Something …

More Related