Presentation by Jörg Herbst / 10m
Java since JDK 0.92
Professional since 2002
JavaScript since 2014
twitter:@terrible_herbst
github: terribleherbst
Short round trips
None blocking IO with node
Present on low cost hosting
Deployment und compilation
Servlet API
Heavy application server
Great stable core libraries
Professional managed frameworks
Great virtual maschine
An awesome community
Poor useability
Slow interaction
Lots of roundtrips
Search engine visible
Better useabilty
Lots of roundtrips
Difficult to maintain
Search engine visible
Better useabilty
Good interaction
Few roundtrips
Difficult beside the basics
Vendor lock in (GWT or Vaadin)
Maintainable Frontend
Testable Code
Performance and Scalability
Vendor idependence
JavaScript is on every major site
There is Standard Comitee ECMA
There is npm as a Package Manager
There are build systems like Grunt
function BookListCtrl($scope, $http, $templateCache) {
$scope.listBooks = function() {
$http({method: 'GET', url: './api/book', cache: $templateCache}).
success(function(data, status, headers, config) {
$scope.books = data; //set view model
$scope.view = './Partials/list.html'; //set to list view
}).
error(function(data, status, headers, config) {
$scope.books = data || "Request failed";
$scope.status = status;
$scope.view = './Partials/list.html';
});
}
}
BookListCtrl.$inject = ['$scope', '$http', '$templateCache'];
describe('myApp.view2 module', function() {
beforeEach(module('myApp.view2'));
describe('view2 controller', function(){
it('should ....', inject(function($controller) {
//spec body
var view2Ctrl = $controller('View2Ctrl');
expect(view2Ctrl).toBeDefined();
}));
});
});
Source: Angular Seed
Simple Karma Demo
JVM ist more than Java
No more Pets in the store
Java Web is more than servlets
Async IO using netty
Fast roundtrip using groovy
Gradle for easy builds
Hystrix for managing micro services
Jackson for JSON
Not related to any type on Frontend
handler("talk/:id") {
def query = pathTokens["id"]
byMethod {
get {
render json (talks.find { talk -> talk.id = query})
}
put {
def talk = parse (fromJson(Talk))
talks.put(query,talk)
}
delete {
talks.remove(query)
}
}
}
Source: Ratpack REST