Intro on Errai 4

Arnaud Tournier, le 11-11-2015

Speaker : Max XXX

Why errai ?

GWT is fantastic. But still the more code you have, more painful becomes the maintenance.

GWT projects can get really large and compile time gets too big.

  • Declarative good, boilerplate bad. – Dependency injection (consistent with CDI) – 2 way data binding – Dynamic runtime modules

Dependency injection

@Inject, @Alternative, @Specializes, @Produces, circular dependencies…

Declarative templating

View is a plain HTML file

Templated bean is a normal bean associated with a HTML view.

Can select a fragment from any html file and use it as a template :

public calss ContactView extends Composite{

Data binding

Synchronizes view and beans.

Can be used in @Templated elements

class User {
	private String field;

	// getter and setter

class MyForm {
	@Inject @AutoBound
	DataBinder<User> binder;

	TextBox userName;

	DateBox dob;


	void t(){
		User user = binder.getModel();

Binding a list of values

ListWidget<User, UserView> userList;

List<User> models = userList.getValue();
models.add(new User());

Dynamic Runtime modules

Hwo to breakup your big application into several compiled sub-modules and then re-assemble them at runtime

Uses JsInterop as the foundation for that.


2 projects : consumer producer; bother are compiled withthe MySimpleService interface in (which is a JsType)


Arnaud Tournier, le 11-11-2015