SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
Building scalable
applications with AngularJS
and modern applications infrastructure
Based on real life stories
Andrey Alpert
andrey.alpert@dataart.com
linkedin.com/in/andreyalpert
The way it was…
Mixed client server leads to
increased complexity
Presentation logic will require a lot
of interactions with the server
Not a real application, just another
website
The way it should be
Client Server Data
MV* JS framework, Business
logic, Mobile-ready layout
Data storage.
Treated like a black box.
Thin-Server, REST, Event
The stack of technologies
The stack of technologies
The stack of technologies
DRY1
Declarative2
Designers friendly5
Dependency injection4
Data binding3
The stack of technologies
UI Bootstrap1
UI Router2
… and others5
NG Grid4
UI Utils3
Seed projects are sprouting like weeds
They all suck
Organizing your app
Files Logic Code
BROS DON’T LET BROS
ORGANIZE FILES
BY TYPE
– the angularjs bro code
Organizing by type
Organize by services, controllers, views, etc.1
One module per directory.2
Directories become bloated.4
Poor control over your DI configuration.3
Folders-by-Feature Structure
Organize by component / feature.1
Directory structure mirrors app structure.2
Can create angular modules that more
accurately reflect injection dependencies.
4
Easier to extract / share components.3
Folders-by-Feature Structure
All files related to a feature live together (html,
css, tests).
Application-level files live directly under app/
Each section / page of the app has its own folder
under app/
Things used throughout the app live under
common/
Files related to the app live outside of
app/
! super-dooper-project/
|- src/
| |- app/
| | |- <app logic>
| |- assets/
| | |- <static files>
| |- common/
| | |- components/
| | |- services/
| |- less/
| | |- main.less
|- bower_components/
| |- bootstrap_components/
| |- angular-bootstrap/
| |- bootstrap/
|- karma/
|- .bowerrc
|- bower.json
|- build.config.js
|- Gruntfile.js
|- module.prefix
|- module.suffix
|- package.json
1
2
4
3
5
Application layout
Modules should mirror URL
Submodules live near main module
Submodules listed as dependencies to main
module
src/
|- app/
| |- user/
| | |- create/
| | |- search/
| | |- user.js
| | |- user.ctrl.js
| | |- user.less
| | |- user.spec.js
| | |- user.tpl.html
1
2
3
https://github.com/ngbp/ngbp by Josh Miller
angular.module(‘app.user', [‘app.user.create’, ‘app.user.search’]);
angular.module(‘app.user.create’, []);
Organizing your logic
Angular talks about…
Services
are app-‐wide
injected
singletons.
Controllers
are bridge between
template and the rest of
your application logic.
Directives
are encapsulation of
some widget or DOM
element behavior.
Filters
are simple
output formatting

functions.
That's great!
Now you know
exactly how to
break up your
code
UNTIL…
That's great!
Now you know
exactly how to
break up your
code
The problem with controllers
Common functionality
List pages, properties pages, etc.
1
Very complicated views can end up having multi-thousand line
controllers.
2
How can you break up logic that is going to be used in many
controllers?
3
Option 1 – inheritance
What is it?
Traditional OOP inheritance
e.g. BaseListController → sorting, paging, filtering…
Cons
Hierarchy can become too deep and confusing
Some controllers in our app are 5 levels deep
Some logic doesn't fit neatly into a generic parent
Imperfect encapsulation
Option 2 – mixins
What is it?
Object whose properties are mixed into another.
Cons
It becomes unclear where code comes from.
Mixins could potentially conflict with or overwrite each other.
Mixin is tightly coupled to the mixed-‐into object.
!
  angular.extend(ctrl,  ListMixin);    
Option 3 – object composition
What is it?
Traditional object composition that takes advantage of Angular's dependency injection.
Cons
Can’t inject the objects themselves (﴾until angular 2.0)﴿
!
  ctrl.listManager  =  $injector.instantiate(app.ListManager,  {});    
Pros
Better encapsulation
Easier reuse
Forces more coherent API design
Organizing your code
Technical debt
Tests will be in the next release
Code entropy: “if touch that code everything
will break”
Docs? My code is state of art!
TODO/FIXME statements
Let’s just copy/paste for now
1
2
4
3
5
Can be found in any project
Do NOT let it grow
http://en.wikipedia.org/wiki/Technical_debt
QUALITY
Code style
Readability
Good names
Tabs/Spaces convention
Clear logic
Docs and comments
1
2
4
3
5
!
• jshint+stylish
• plato
• code painter
• editorconfig
• jscs
• eslint
These are your friends
Tools
Single responsibility
File per each component1
• Gives the most control over how the injector is configured
• Much easier to extract code into shared components
• When testing, only have to load specific module under test
angular.module('app', ['ngRoute']);
angular.module(‘app’).controller('SomeController', SomeController);
!
function SomeController() { }
angular.module(‘app’).factory('someFactory', SomeFactory);
!
function SomeFactory() { }
IIFE
Wrap components in an Immediately Invoked Function Expression1
• An IIFE removes variables from the global scope.
• Protects us from having collisions of variables and many global variables.
(function() {
'use strict';
angular.module(‘app’)
.controller('SomeController', SomeController);
!
function SomeController() { }
})();
ControllerAs Controller Syntax
• Use the controllerAs syntax over the classic controller with $scope syntax.
• The controllerAs syntax uses this inside controllers which gets bound to
$scope
• controllerAs is syntactic sugar over $scope. You can still bind to the View
and still access $scope methods.
• Use a capture variable for this when using the controllerAs syntax.
(function() {
'use strict';
angular.module(‘app’)
.controller('SomeController', SomeController);
!
function SomeController() {
var ctrl = this;
ctrl.name = {};
ctrl.sendMessage = function() { };
}
})();
Resolve promises for your controllers
A controller may require data before
it loads. That data may come from a
promise via a custom factory or
$http. Using a route resolve allows
the promise to resolve before the
controller logic executes, so it might
take action based on that data from
the promise.
(function() {
'use strict';
angular.module(‘app’).config(myConfig);
! function myConfig($routeProvider) {
$routeProvider
.when('/avengers', {
templateUrl: 'avengers.html',
controller: 'AvengersCtrl',
controllerAs: 'av',
resolve: {
resolvedMovies: function(movieService) {
return movieService.getMovies();
}
}
});
}
})();
(function() {
'use strict';
angular.module(‘app’).controller(‘AvengersCtrl’, Avengers);
! function Avengers(resolvedMovies) {
var ctrl = this;
ctrl.moviesList = resolvedMovies.data;
}
})();
Really good for testing as you can
mock injectable data
RED
(Fail)
GREEN
(Pass)
REFACTOR
1. Write a test
that fails
2. Make only enough
code for it to pass
3. Improve code
quality
REPEAT
PROCESS
Test driven development
TDD/BDD
Better code understanding
Release faster
Motivation
Reliability
1
2
4
3
5
Long (﴾hours)﴿
Medium (﴾minutes)﴿
Fast (﴾seconds)﴿
UIEnd 2 End
API
Services
Database
Headless
Smoke tests
unit tests
Till first failed
Remote
Local.
Stubs+Mocks
Safe refactoring
Test driven development
TDD/BDD
Better code understanding
Release faster
Motivation
Reliability
1
2
4
3
5
Fast (seconds)
it('should have Avengers controller', function() {
//TODO
});
!it('should find 1 Avenger when filtered by name', function() {
//TODO
});
!it('should have 10 Avengers', function() {}
//TODO (mock data?)
});
!it('should return Avengers via XHR', function() {}
//TODO ($httpBackend?)
});
!// and so on
Сode coverage
Not tested area of application
Dead code detection
Acceptance threshold 70-90%
Testing quality
Reports
1
2
4
3
5
Tools
Istanbul
JSCoverage
Blanket
coverage > 80% is AWESOME
coverals.io
codeclimate
History and stats service
TDD with…
+
Cool for E2E
tests
I’m your test
runner.
!
The best one.
These two guys are
GOOD.
Laziness is
the mother
of INVENTION
What tasks to automate
Source
Concatenate
Uglify
SourceMaps
Watch
LiveReload
Rebuild
Serve
Preprocess
LESS
SASS
Compass
Test
Karma
Mocha
Coverage
Assets
Templates
HTML processing
Images optimization
Custom
ChangeLog
Notifications
console.debug
Task runner: grunt
FILE BASED
Good for file operations like copy/move/save. Configuration is
over the code
1
TONS OF PLUGINS
Many of the tasks you need are already available as Grunt Plugins, 

and new plugins are published every day.
2
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %>*/n'
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
}
}
});
http://gruntjs.com
http://gruntjs.com/plugins
The streaming build system: gulp
Fast (seconds)
EASY TO USE
By preferring code over configuration, gulp keeps simple things
simple and makes complex tasks manageable.
1
STREAM BASED
Much more faster then Grunt for file-‐content processing operations
2
var gulp = require('gulp');
!gulp.task('default', function() {
// place code for your default task here
});
http://gulpjs.com
http://gulpjs.com/plugins
Deployment
Continues integration
Builds history
Last successful/failed build
Multiple environments
Parallel builds
Rollback
1
2
4
3
5
Fast (seconds)
Server as platform
Customizable stack and environment
Own services to use
Infrastructure
Need for DevOps
1
2
4
3
Fast (seconds)
Amazon, Digital Ocean or
Rackspace
Platform as a Service
Takes care of infrastructure for you
Updating packages and installing security
patches
Technical support 24/7
Reliability and Monitoring
1
2
4
3
Azure

Heroku
Nodejitsu
CloudFoundry
Docker
Your own PaaS
Open Source
Ready to use stacks
Easy Scale
Easy to migrate
1
2
4
3
5
Deis
Flynn
Tsuru
Octohost
Tools
Application + Platform = Container
SUMMARY
THANKS. QUESTIONS?

Weitere ähnliche Inhalte

Was ist angesagt?

AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 
Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications  Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications Juliana Lucena
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIVisual Engineering
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJSWei Ru
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
Good karma: UX Patterns and Unit Testing in Angular with Karma
Good karma: UX Patterns and Unit Testing in Angular with KarmaGood karma: UX Patterns and Unit Testing in Angular with Karma
Good karma: UX Patterns and Unit Testing in Angular with KarmaExoLeaders.com
 
Dependency Injection @ AngularJS
Dependency Injection @ AngularJSDependency Injection @ AngularJS
Dependency Injection @ AngularJSRan Mizrahi
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceParashuram N
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.jsJosh Staples
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Codemotion
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingVisual Engineering
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSNicolas Embleton
 

Was ist angesagt? (20)

Angularjs
AngularjsAngularjs
Angularjs
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 
Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications  Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
Angular2 for Beginners
Angular2 for BeginnersAngular2 for Beginners
Angular2 for Beginners
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
Angularjs Performance
Angularjs PerformanceAngularjs Performance
Angularjs Performance
 
Zenly - Reverse geocoding
Zenly - Reverse geocodingZenly - Reverse geocoding
Zenly - Reverse geocoding
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Good karma: UX Patterns and Unit Testing in Angular with Karma
Good karma: UX Patterns and Unit Testing in Angular with KarmaGood karma: UX Patterns and Unit Testing in Angular with Karma
Good karma: UX Patterns and Unit Testing in Angular with Karma
 
Dependency Injection @ AngularJS
Dependency Injection @ AngularJSDependency Injection @ AngularJS
Dependency Injection @ AngularJS
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.js
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JS
 

Andere mochten auch

Presentation aalpert v6а+++
Presentation aalpert v6а+++Presentation aalpert v6а+++
Presentation aalpert v6а+++Natalia Gorak
 
angularJS Practicle Explanation
angularJS Practicle ExplanationangularJS Practicle Explanation
angularJS Practicle ExplanationAbhishek Sahu
 
Modern web applications infrastructure
Modern web applications infrastructureModern web applications infrastructure
Modern web applications infrastructureEPAM
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Max Klymyshyn
 
Google Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.jsGoogle Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.jsAlmog Koren
 
Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)kbekessy
 
Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...
Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...
Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...2ГИС Технологии
 
최근 Javascript framework 조사
최근 Javascript framework 조사최근 Javascript framework 조사
최근 Javascript framework 조사Kichul Jung
 
Il complemento predicativo del soggetto
Il complemento predicativo del soggettoIl complemento predicativo del soggetto
Il complemento predicativo del soggettoLaProf76
 
Live Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS FeatuesLive Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS FeatuesEdureka!
 
Angular js best practice
Angular js best practiceAngular js best practice
Angular js best practiceMatteo Scandolo
 
Building single page applications with angular.js
Building single page applications with angular.jsBuilding single page applications with angular.js
Building single page applications with angular.jsDieter De Mesmaeker
 
Scalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureScalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureFDConf
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationEdureka!
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular jsMindfire Solutions
 

Andere mochten auch (20)

Presentation aalpert v6а+++
Presentation aalpert v6а+++Presentation aalpert v6а+++
Presentation aalpert v6а+++
 
angularJS Practicle Explanation
angularJS Practicle ExplanationangularJS Practicle Explanation
angularJS Practicle Explanation
 
Modern web applications infrastructure
Modern web applications infrastructureModern web applications infrastructure
Modern web applications infrastructure
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
 
Google Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.jsGoogle Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.js
 
Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)
 
Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...
Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...
Особенности автоматизации тестирования: Single-page vs Multi-page (Seleniumca...
 
Linguaggi audiovisivi - Analisi testuale
Linguaggi audiovisivi  - Analisi testualeLinguaggi audiovisivi  - Analisi testuale
Linguaggi audiovisivi - Analisi testuale
 
Scheda filmica
Scheda filmicaScheda filmica
Scheda filmica
 
최근 Javascript framework 조사
최근 Javascript framework 조사최근 Javascript framework 조사
최근 Javascript framework 조사
 
Il complemento predicativo del soggetto
Il complemento predicativo del soggettoIl complemento predicativo del soggetto
Il complemento predicativo del soggetto
 
Analisi Film Versione Divulgativa Rev
Analisi Film Versione Divulgativa RevAnalisi Film Versione Divulgativa Rev
Analisi Film Versione Divulgativa Rev
 
Complemento predicativo del soggetto
Complemento predicativo del soggettoComplemento predicativo del soggetto
Complemento predicativo del soggetto
 
Angular js
Angular jsAngular js
Angular js
 
Live Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS FeatuesLive Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS Featues
 
Angular js best practice
Angular js best practiceAngular js best practice
Angular js best practice
 
Building single page applications with angular.js
Building single page applications with angular.jsBuilding single page applications with angular.js
Building single page applications with angular.js
 
Scalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureScalable Angular 2 Application Architecture
Scalable Angular 2 Application Architecture
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 

Ähnlich wie Building scalable applications with angular js

Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
Evolving your api architecture with the strangler pattern
Evolving your api architecture with the strangler patternEvolving your api architecture with the strangler pattern
Evolving your api architecture with the strangler patterndwcarter74
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0Michael Vorburger
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...Maarten Balliauw
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript Corley S.r.l.
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the EnterpriseJames Williams
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kuberneteskloia
 
OORPT Dynamic Analysis
OORPT Dynamic AnalysisOORPT Dynamic Analysis
OORPT Dynamic Analysislienhard
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Fwdays
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type scriptRavi Mone
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...DicodingEvent
 
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceCOMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceAntonio García-Domínguez
 

Ähnlich wie Building scalable applications with angular js (20)

Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Evolving your api architecture with the strangler pattern
Evolving your api architecture with the strangler patternEvolving your api architecture with the strangler pattern
Evolving your api architecture with the strangler pattern
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
Spring boot
Spring bootSpring boot
Spring boot
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
.net Framework
.net Framework.net Framework
.net Framework
 
Angular 2
Angular 2Angular 2
Angular 2
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
OORPT Dynamic Analysis
OORPT Dynamic AnalysisOORPT Dynamic Analysis
OORPT Dynamic Analysis
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
KaranDeepSinghCV
KaranDeepSinghCVKaranDeepSinghCV
KaranDeepSinghCV
 
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceCOMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
 

Kürzlich hochgeladen

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 

Building scalable applications with angular js

  • 1. Building scalable applications with AngularJS and modern applications infrastructure Based on real life stories
  • 3. The way it was… Mixed client server leads to increased complexity Presentation logic will require a lot of interactions with the server Not a real application, just another website
  • 4. The way it should be Client Server Data MV* JS framework, Business logic, Mobile-ready layout Data storage. Treated like a black box. Thin-Server, REST, Event
  • 5. The stack of technologies
  • 6. The stack of technologies
  • 7. The stack of technologies DRY1 Declarative2 Designers friendly5 Dependency injection4 Data binding3
  • 8. The stack of technologies UI Bootstrap1 UI Router2 … and others5 NG Grid4 UI Utils3
  • 9. Seed projects are sprouting like weeds They all suck
  • 11. BROS DON’T LET BROS ORGANIZE FILES BY TYPE – the angularjs bro code
  • 12. Organizing by type Organize by services, controllers, views, etc.1 One module per directory.2 Directories become bloated.4 Poor control over your DI configuration.3
  • 13. Folders-by-Feature Structure Organize by component / feature.1 Directory structure mirrors app structure.2 Can create angular modules that more accurately reflect injection dependencies. 4 Easier to extract / share components.3
  • 14. Folders-by-Feature Structure All files related to a feature live together (html, css, tests). Application-level files live directly under app/ Each section / page of the app has its own folder under app/ Things used throughout the app live under common/ Files related to the app live outside of app/ ! super-dooper-project/ |- src/ | |- app/ | | |- <app logic> | |- assets/ | | |- <static files> | |- common/ | | |- components/ | | |- services/ | |- less/ | | |- main.less |- bower_components/ | |- bootstrap_components/ | |- angular-bootstrap/ | |- bootstrap/ |- karma/ |- .bowerrc |- bower.json |- build.config.js |- Gruntfile.js |- module.prefix |- module.suffix |- package.json 1 2 4 3 5
  • 15. Application layout Modules should mirror URL Submodules live near main module Submodules listed as dependencies to main module src/ |- app/ | |- user/ | | |- create/ | | |- search/ | | |- user.js | | |- user.ctrl.js | | |- user.less | | |- user.spec.js | | |- user.tpl.html 1 2 3 https://github.com/ngbp/ngbp by Josh Miller angular.module(‘app.user', [‘app.user.create’, ‘app.user.search’]); angular.module(‘app.user.create’, []);
  • 17. Angular talks about… Services are app-‐wide injected singletons. Controllers are bridge between template and the rest of your application logic. Directives are encapsulation of some widget or DOM element behavior. Filters are simple output formatting
 functions.
  • 18. That's great! Now you know exactly how to break up your code
  • 19. UNTIL… That's great! Now you know exactly how to break up your code
  • 20. The problem with controllers Common functionality List pages, properties pages, etc. 1 Very complicated views can end up having multi-thousand line controllers. 2 How can you break up logic that is going to be used in many controllers? 3
  • 21. Option 1 – inheritance What is it? Traditional OOP inheritance e.g. BaseListController → sorting, paging, filtering… Cons Hierarchy can become too deep and confusing Some controllers in our app are 5 levels deep Some logic doesn't fit neatly into a generic parent Imperfect encapsulation
  • 22. Option 2 – mixins What is it? Object whose properties are mixed into another. Cons It becomes unclear where code comes from. Mixins could potentially conflict with or overwrite each other. Mixin is tightly coupled to the mixed-‐into object. !  angular.extend(ctrl,  ListMixin);    
  • 23. Option 3 – object composition What is it? Traditional object composition that takes advantage of Angular's dependency injection. Cons Can’t inject the objects themselves (﴾until angular 2.0)﴿ !  ctrl.listManager  =  $injector.instantiate(app.ListManager,  {});     Pros Better encapsulation Easier reuse Forces more coherent API design
  • 25. Technical debt Tests will be in the next release Code entropy: “if touch that code everything will break” Docs? My code is state of art! TODO/FIXME statements Let’s just copy/paste for now 1 2 4 3 5 Can be found in any project Do NOT let it grow http://en.wikipedia.org/wiki/Technical_debt QUALITY
  • 26. Code style Readability Good names Tabs/Spaces convention Clear logic Docs and comments 1 2 4 3 5 ! • jshint+stylish • plato • code painter • editorconfig • jscs • eslint These are your friends Tools
  • 27. Single responsibility File per each component1 • Gives the most control over how the injector is configured • Much easier to extract code into shared components • When testing, only have to load specific module under test angular.module('app', ['ngRoute']); angular.module(‘app’).controller('SomeController', SomeController); ! function SomeController() { } angular.module(‘app’).factory('someFactory', SomeFactory); ! function SomeFactory() { }
  • 28. IIFE Wrap components in an Immediately Invoked Function Expression1 • An IIFE removes variables from the global scope. • Protects us from having collisions of variables and many global variables. (function() { 'use strict'; angular.module(‘app’) .controller('SomeController', SomeController); ! function SomeController() { } })();
  • 29. ControllerAs Controller Syntax • Use the controllerAs syntax over the classic controller with $scope syntax. • The controllerAs syntax uses this inside controllers which gets bound to $scope • controllerAs is syntactic sugar over $scope. You can still bind to the View and still access $scope methods. • Use a capture variable for this when using the controllerAs syntax. (function() { 'use strict'; angular.module(‘app’) .controller('SomeController', SomeController); ! function SomeController() { var ctrl = this; ctrl.name = {}; ctrl.sendMessage = function() { }; } })();
  • 30. Resolve promises for your controllers A controller may require data before it loads. That data may come from a promise via a custom factory or $http. Using a route resolve allows the promise to resolve before the controller logic executes, so it might take action based on that data from the promise. (function() { 'use strict'; angular.module(‘app’).config(myConfig); ! function myConfig($routeProvider) { $routeProvider .when('/avengers', { templateUrl: 'avengers.html', controller: 'AvengersCtrl', controllerAs: 'av', resolve: { resolvedMovies: function(movieService) { return movieService.getMovies(); } } }); } })(); (function() { 'use strict'; angular.module(‘app’).controller(‘AvengersCtrl’, Avengers); ! function Avengers(resolvedMovies) { var ctrl = this; ctrl.moviesList = resolvedMovies.data; } })(); Really good for testing as you can mock injectable data
  • 31. RED (Fail) GREEN (Pass) REFACTOR 1. Write a test that fails 2. Make only enough code for it to pass 3. Improve code quality REPEAT PROCESS
  • 32. Test driven development TDD/BDD Better code understanding Release faster Motivation Reliability 1 2 4 3 5 Long (﴾hours)﴿ Medium (﴾minutes)﴿ Fast (﴾seconds)﴿ UIEnd 2 End API Services Database Headless Smoke tests unit tests Till first failed Remote Local. Stubs+Mocks Safe refactoring
  • 33. Test driven development TDD/BDD Better code understanding Release faster Motivation Reliability 1 2 4 3 5 Fast (seconds) it('should have Avengers controller', function() { //TODO }); !it('should find 1 Avenger when filtered by name', function() { //TODO }); !it('should have 10 Avengers', function() {} //TODO (mock data?) }); !it('should return Avengers via XHR', function() {} //TODO ($httpBackend?) }); !// and so on
  • 34. Сode coverage Not tested area of application Dead code detection Acceptance threshold 70-90% Testing quality Reports 1 2 4 3 5 Tools Istanbul JSCoverage Blanket coverage > 80% is AWESOME coverals.io codeclimate History and stats service
  • 35. TDD with… + Cool for E2E tests I’m your test runner. ! The best one. These two guys are GOOD.
  • 37. What tasks to automate Source Concatenate Uglify SourceMaps Watch LiveReload Rebuild Serve Preprocess LESS SASS Compass Test Karma Mocha Coverage Assets Templates HTML processing Images optimization Custom ChangeLog Notifications console.debug
  • 38. Task runner: grunt FILE BASED Good for file operations like copy/move/save. Configuration is over the code 1 TONS OF PLUGINS Many of the tasks you need are already available as Grunt Plugins, 
 and new plugins are published every day. 2 grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { options: { banner: '/*! <%= pkg.name %>*/n' }, build: { src: 'src/<%= pkg.name %>.js', dest: 'build/<%= pkg.name %>.min.js' } } }); http://gruntjs.com http://gruntjs.com/plugins
  • 39. The streaming build system: gulp Fast (seconds) EASY TO USE By preferring code over configuration, gulp keeps simple things simple and makes complex tasks manageable. 1 STREAM BASED Much more faster then Grunt for file-‐content processing operations 2 var gulp = require('gulp'); !gulp.task('default', function() { // place code for your default task here }); http://gulpjs.com http://gulpjs.com/plugins
  • 41. Continues integration Builds history Last successful/failed build Multiple environments Parallel builds Rollback 1 2 4 3 5 Fast (seconds)
  • 42. Server as platform Customizable stack and environment Own services to use Infrastructure Need for DevOps 1 2 4 3 Fast (seconds) Amazon, Digital Ocean or Rackspace
  • 43. Platform as a Service Takes care of infrastructure for you Updating packages and installing security patches Technical support 24/7 Reliability and Monitoring 1 2 4 3 Azure
 Heroku Nodejitsu CloudFoundry
  • 44. Docker Your own PaaS Open Source Ready to use stacks Easy Scale Easy to migrate 1 2 4 3 5 Deis Flynn Tsuru Octohost Tools Application + Platform = Container