single page application presentation

22
Single Page Applications – A journey About Me About the company Single Page Applications AngularJS BreezeJS Application demo Unit Testing Conclusion Any questions?

Upload: john-staveley

Post on 10-May-2015

299 views

Category:

Technology


29 download

DESCRIPTION

The journey of creating a single page application using AngularJS with BreezeJS.

TRANSCRIPT

Page 1: Single Page Application presentation

Single Page Applications – A journey

About Me About the company Single Page Applications AngularJS BreezeJS Application demo Unit Testing Conclusion Any questions?

Page 2: Single Page Application presentation

Biography – John Staveley

13 years C#.net MVC HTML5 Strong on backend Increasingly working on front end projects

https://www.linkedin.com/in/johnstaveley@johnstaveley

Page 3: Single Page Application presentation

Toriga Energy – Who, what, why?

Who are Toriga Energy? Compliance business

What they were trying to achieve? Cross platform mobile app Offline Bootstrap

Why? Fast adaptation to the marketplace Avoid app stores

Page 4: Single Page Application presentation

How - Single Page Application?

CSS/HTML5 web page – all action takes place 'in page' Don't get access to device features e.g. address book Communication via $.ajax Manifest Local Storage to persist offline data App settings for HTML5 – chrome removal, icon, splash

Page 5: Single Page Application presentation

What - Initial solution

Jquery with Bootstrap– Single page with tabbed control

Page 6: Single Page Application presentation
Page 7: Single Page Application presentation

Jobs view

Page 8: Single Page Application presentation

Problems

jQuery– No Navigation from job view to project view– No Two way binding– No deep linking

We need a framework...

Page 9: Single Page Application presentation

But, which framework to choose?

Page 10: Single Page Application presentation

AngularJS

Solves two way binding problem

Page 11: Single Page Application presentation

AngularJS – How it works

Controller

View

Result!

Page 12: Single Page Application presentation

AngularJS - Benefits

Routing – solves deep linking problem Directives e.g. navigation control <navigation /> AngularJS versions of jquery libraries such as jquery ui,

bootstrap, kendo, signature pad - give example More...

Page 13: Single Page Application presentation

Demo of deep linking

Page 14: Single Page Application presentation

Data – Initial solution

First there was: WCF web services with SQL Not good at Rest Inflexible Verbose No Metadata – validation

Page 15: Single Page Application presentation

BreezeJS – solves data problems

To simplify creating the model on the client and persisting changes

Client side queries Validation Extending the model Only saves data that has changed

Page 16: Single Page Application presentation

BreezeJS – get rid of the boiler plate!

Removes verbosity of web layer

Page 17: Single Page Application presentation

Data access – Entity Framework

Page 18: Single Page Application presentation

Unit Testing

Angular enforces separation of concerns Angular allows Dependency injection BDD with Jasmine and Sinon for mocking Example

Page 19: Single Page Application presentation

Controller to Unit Test

Page 20: Single Page Application presentation

Unit testing code

Page 21: Single Page Application presentation

Conclusion

Single Page Applications are great for cross platform apps which avoid the app store

Don't benefit from intellisense AngularJS makes your code testable BreezeJS removes a lot of data access code

https://www.linkedin.com/in/johnstaveley@johnstaveley

Page 22: Single Page Application presentation

Any questions?