T1301

Ladda ner som PDF

Using Knockout To Build Dynamic, Testable Web UIs

The Knockout library provides support for data binding in a JavaScript and HTML environment. This in turn enables web developers to put the the MVVM (Model, View, View-Model) presentation pattern to use. Much of Knockout's popularity is thanks to the way it simplifies writing dynamic UIs. It has also been embraced by Microsoft, and is now included with ASP.NET MVC. Applying the MVVM pattern also offers another great benefit: the ability to easily write good unit tests for interaction logic!

This course will teach you how to use Knockout effectively - but it doesn't stop there. It also teaches you what a view model is, what it should be responsible for, and how to factor it. And, perhaps most importantly, you will learn how to write tests for your view models.

Along with explanations of the patterns and techniques involved and many code walkthroughs, the course also has a series of practical labs, providing an opportunity for you to dig in to Knockout and try writing view model tests for yourself.

Audience

For web developers who want to learn how to secure web sites

Prior knowledge

Participants should have a working knowledge of HTML and some prior JavaScript programming experience. Knowing the basic syntax and being comfortable with functions will be sufficient; JavaScript's Object Orientation support will be covered in the course to the degree that is required for writing and testing view models.

Courseware

Course material in English included.

Course outline:

Preliminaries

  • The architecture of the web
  • The rise of the Single Page Application
  • The challenge of user experience
  • The need for testability
  • The role of design patterns, and how they help

The MVVM Presentation Pattern

  • So what is a model, anyway?
  • RESTful models
  • Views
  • View Models
  • Data binding
  • The observer pattern

Introducing Knockout

  • What is Knockout?
  • Declarative data binding in HTML
  • Creating simple view models with observables
  • Binding the view model to the view
  • Exercise: your first view model

Basic View Model Testing

  • What is unit testing?
  • Why write automated tests?
  • Introduction to QUnit
  • Writing basic view model unit tests
  • Exercise: writing some basic view model tests

Computed Observables

  • What is a computed observable?
  • How dependency tracking works
  • Writing tests
  • Writable computed observables
  • Exercise: using a testing computed observables

Event Binding and Server Interaction

  • Client side view model, server side model
  • Event binding
  • How to factor the server interaction for testability
  • Implementing the call to the server
  • Testing the interaction without really calling the server
  • Exercise: event binding and server interaction

Course outline:

Preliminaries

  • The architecture of the web
  • The rise of the Single Page Application
  • The challenge of user experience
  • The need for testability
  • The role of design patterns, and how they help

The MVVM Presentation Pattern

  • So what is a model, anyway?
  • RESTful models
  • Views
  • View Models
  • Data binding
  • The observer pattern

Introducing Knockout

  • What is Knockout?
  • Declarative data binding in HTML
  • Creating simple view models with observables
  • Binding the view model to the view
  • Exercise: your first view model

Basic View Model Testing

  • What is unit testing?
  • Why write automated tests?
  • Introduction to QUnit
  • Writing basic view model unit tests
  • Exercise: writing some basic view model tests

Computed Observables

  • What is a computed observable?
  • How dependency tracking works
  • Writing tests
  • Writable computed observables
  • Exercise: using a testing computed observables

Event Binding and Server Interaction

  • Client side view model, server side model
  • Event binding
  • How to factor the server interaction for testability
  • Implementing the call to the server
  • Testing the interaction without really calling the server
  • Exercise: event binding and server interaction

Utbildningen levereras i samarbete med

Kurs-ID: T1301
Längd: 2 dagar
Kan betalas med:
TRAINING CARD

Lämna dina kontaktuppgifter om du önskar en företagsintern utbildning.

Tipsa