1 / 29

Real World SPA

Real World SPA. A Knockout Case Study. Cory House | bitnative.com | @housecor | speakerrate.com/talks/27181. Hi, I’m Cory. @ housecor. What monthly payment would you like?. JavaScript Configuration Object Pattern. Config Object Pattern: A justification. Separation of concerns

luka
Download Presentation

Real World SPA

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. Real World SPA A Knockout Case Study Cory House | bitnative.com | @housecor | speakerrate.com/talks/27181

  2. Hi, I’m Cory. @housecor

  3. What monthly payment would you like?

  4. JavaScript Configuration Object Pattern

  5. Config Object Pattern: A justification • Separation of concerns • Caching  • Minimizes string parsing overhead • Code coloring • Syntax checking • Reusable • Reduced payload • Less abstraction • More at bitnative.com/2013/10/06/javascript-configuration-object-pattern/

  6. Unobtrusive JavaScript: Have we come full circle?

  7. Stay DRY by Mapping • http://jsfiddle.net/housecor/uAe3k

  8. Databinding advantages • Discoverability • Clarity • Less Code – Separation of tightly bound concerns without a strong interface abstracts rather than clarifies.

  9. And pick a language?!

  10. And a testing framework…

  11. Network Transport • AJAX • Go 2-way: • WebSocket • AJAX Long-polling • Adobe® Flash® Socket • AJAX multipart streaming • Forever Iframe • JSONP Polling • Or punt:

  12. Service Layer • WebAPI

  13. Utility Libraries

  14. Data

  15. NoSQL?

  16. Cross Browser Testing XP-More Many options: http://bit.ly/16cXevo

  17. Convention • Composition<div data-bind=“compose: ‘viewmodels/vehicle’></div> <!-- ko compose: ‘viewmodels/vehicle’ --><!-- /ko --> • Dependency Management • Routing

  18. RequireJs • Utilizes AMD pattern • Dynamically load JS • Inject dependencies • Watch for circular dependencies

  19. DOM Weight • Traditional: Every element is rendered on the server and thus on the client. • Client-side: Elements are rendered real-time as needed.

  20. Key: Centralized AJAX Calls

  21. Why? • Responsive • Rich Interactivity • Separation of concerns • Efficient • Simple - Less abstraction • Debugging • No compile wait • Faster page load

  22. Why not? • Proprietary business logic • Low interactivity • Slower page load • Page is rarely called • Complex – Too many choices! • Debugging pain • Runtime errors • Cryptic • One mistake and nothing loads

  23. SPA Experience Complete • Back to the real world. • Cory House • bitnative.com • @housecor • speakerrate.com/talks/27181

More Related