Vaadin intro

104
Vaadin 7 intro @joonaslehtinen Founder & CEO

description

Updated Vaadin introductory presentation given at DevNexus Atlanta on Feb 24, 2014.

Transcript of Vaadin intro

Page 1: Vaadin intro

Vaadin7intro

@joonaslehtinen Founder & CEO

Page 2: Vaadin intro

Intro to Vaadin

new Label(“Hello world”)

Page 3: Vaadin intro

New in

7

Page 4: Vaadin intro

Getting started

QA

Page 5: Vaadin intro
Page 6: Vaadin intro

User interface framework for rich

web applications

Page 7: Vaadin intro

Building blocks

Page 8: Vaadin intro

Developer

Productivity

Rich

UX

Page 9: Vaadin intro

htmljava

Page 10: Vaadin intro

123Key Ideas

Page 11: Vaadin intro

1Rich Components

Page 12: Vaadin intro

User Interface Data Source

Theme

Page 13: Vaadin intro

User Interface Data Source

Theme

Page 15: Vaadin intro
Page 16: Vaadin intro

1.6 Going mobile

GWT is a versatile technology that allows developers to create application UI for desktop, tablet, and mobile consumption. As can be expected, over 98% of apps support desktop browsers, but we found it interesting that tablets had overtaken phones (at least when it came to support from GWT-based apps). In US, the number of apps supporting tablets was as high as 46%, while it was just 34% in Europe.

What kind of devices does your app support?

98.1%25.7%

Phones

36.1%

Tablets

Desktop browsers

Others

2.1%

“Since gwt is used extensively in the enterprise, this may explain why tablets are more popular than support for phones”

Daniel

Browsers developers expect to support in 2013

3.5 Browsers to support in 2012

IE 6/7 Safari Opera IE 8

6/7 8

14% 18% 36% 54%

Chrome

9 10IE 9 IE 10 Firefox

79% 80% 94% 94%Browsers developers expect to support in 2013

3.5 Browsers to support in 2012

IE 6/7 Safari Opera IE 8

6/7 8

14% 18% 36% 54%

Chrome

9 10IE 9 IE 10 Firefox

79% 80% 94% 94%

1.6 Going mobile

GWT is a versatile technology that allows developers to create application UI for

desktop, tablet, and mobile consumption. As can be expected, over 98% of apps

support desktop browsers, but we found it interesting that tablets had overtaken

phones (at least when it came to support from GWT-based apps). In US, the number

of apps supporting tablets was as high as 46%, while it was just 34% in Europe.

What kind of devices does your app support?

98.1%

25.7%

Phones

36.1%

Tablets

Desktop

browsers

Others2.1%

“Since gwt is used extensively

in the enterprise, this may

explain why tablets are more

popular than support for

phones”

Daniel

iPhone Android

WP 8

1.6 Going mobile

GWT is a versatile technology that allows developers to create application UI for

desktop, tablet, and mobile consumption. As can be expected, over 98% of apps

support desktop browsers, but we found it interesting that tablets had overtaken

phones (at least when it came to support from GWT-based apps). In US, the number

of apps supporting tablets was as high as 46%, while it was just 34% in Europe.

What kind of devices does your app support?

98.1%

25.7%

Phones

36.1%

Tablets

Desktop

browsers

Others2.1%

“Since gwt is used extensively

in the enterprise, this may

explain why tablets are more

popular than support for

phones”

Daniel

iPad Android Windows 8

Page 17: Vaadin intro

415+ add-on components

Page 18: Vaadin intro
Page 19: Vaadin intro
Page 20: Vaadin intro
Page 21: Vaadin intro

User Interface Data Source

Theme

Page 26: Vaadin intro

User Interface Data Source

Theme

Page 27: Vaadin intro
Page 28: Vaadin intro

InMemory, Bean, Method, Collection, JDBC, JPA, Hibernate, TextFile, FileSystem, Properties, EclipseLink, Lucene, Mockups, GAE, ...

Page 29: Vaadin intro

2Server + Client

Page 30: Vaadin intro

Web application layers

Backend server

Web server

Commu- nication JavaScript

Page 31: Vaadin intro

Web application layers

JavaScriptJava to JavaScript

Web server

Backend server

required optional optionalrequired

Commu- nication

optional

Vaad

in

required optionalrequired

GW

T

requiredrequiredJS

requiredrequired

required required

Page 32: Vaadin intro

Web application layers

JavaScriptJava to JavaScript

Web server

Backend server

required optional optionalrequired

Commu- nication

optional

Vaad

in

required optionalrequired

GW

T

requiredrequiredJS

requiredrequired

required required

1 layer vs

3 layers

-50% codelines -50% development -50% maintenance easier to learn

Page 33: Vaadin intro

How does it work, really?

Page 34: Vaadin intro
Page 35: Vaadin intro

• Initial HTML • CSS (theme) • Images • JavaScript !1.2M total

307k

compress

135k

reduced widgetset

Page 36: Vaadin intro

• name=”Joonas” • button clicked !261 bytes

Page 37: Vaadin intro
Page 38: Vaadin intro

• name=”Joonas” • button clicked !261 bytes

• Add notification !267 bytes

Page 39: Vaadin intro

Hello World!

Page 40: Vaadin intro
Page 41: Vaadin intro

https://github.com/vaadin/documentmanager

https://vaadin.com/learn

Source

HOWTO Screencast

Page 42: Vaadin intro

3Embracing Java

Page 43: Vaadin intro

Any language on JVM

Page 44: Vaadin intro

Internet Explorer Chrome Firefox Safari Opera

iOS Android

Page 45: Vaadin intro

No browser plugins / JRE

!

Nothing to install

Page 46: Vaadin intro

Servlet Portlet

(most) clouds ∙ ∙ ∙ ∙ ∙ Anything Java

Page 47: Vaadin intro

Eclipse IntelliJ IDEA

Netbeans Maven / Gradle / Ant

∙ ∙ ∙ ∙ ∙ Anything Java

Page 48: Vaadin intro

Java EE Spring OSGi REST

∙ ∙ ∙ Anything Java

Page 49: Vaadin intro

Vaadin7.1

Page 50: Vaadin intro

v3 2002

v0.1 2001

Open Source

Page 51: Vaadin intro

v4 2006

Ajax

v5 2007

Page 52: Vaadin intro

72013v6

2009

Page 53: Vaadin intro

934 tickets closed during 16 months of development

3939 commits made by 23 authors

Oldest ticket created 3/2008Newest ticket 2/2013

3939 commits made by 23 authors93 % by 6 persons

> 1 000 000 lines of code touched

Page 54: Vaadin intro

Complete stack

Renewed from Inside

Sass

JS

HTML5+= GWT

RPC State

UI

Field

Push

Page 55: Vaadin intro
Page 56: Vaadin intro
Page 57: Vaadin intro
Page 58: Vaadin intro
Page 59: Vaadin intro
Page 60: Vaadin intro
Page 61: Vaadin intro
Page 62: Vaadin intro
Page 63: Vaadin intro
Page 64: Vaadin intro
Page 65: Vaadin intro

vaadin.com/7

Page 66: Vaadin intro

Favorite picks7

Page 67: Vaadin intro

Vaadin += GWT

Page 68: Vaadin intro
Page 69: Vaadin intro
Page 70: Vaadin intro
Page 71: Vaadin intro

GWT Compatible

Page 72: Vaadin intro

Server-

Client-

side

Optim

ized for

Productivity

Opt

imiz

ed fo

r

Cont

rol

Page 73: Vaadin intro

Server-Client-

sideO

ptim

ized

for

Prod

uctiv

ity

Optim

ized for

Control

Page 74: Vaadin intro

Architecture

Page 75: Vaadin intro
Page 76: Vaadin intro

SassSyntactically Awesome Stylesheets

Demo

Page 77: Vaadin intro

Variables & functions

Page 78: Vaadin intro

Mixins

Page 79: Vaadin intro

Nesting

Page 80: Vaadin intro

Selector Inheritance

Page 81: Vaadin intro

Redesigned Forms

Page 82: Vaadin intro

public class Employee { String firstName; String lastName; double salary; Date birthDate; // Getters, setters, …}!

Form form = new Form();form.setItemDataSource( new BeanItem<Employee>(employee));

6

Page 83: Vaadin intro
Page 84: Vaadin intro
Page 85: Vaadin intro

form.setFormFieldFactory(new FormFieldFactory() {! public Field createField(Item item, Object propertyId, Component uiContext) {! if ("birthDate".equals(propertyId)) { DateField df = new DateField(); df.setResolution(DateField.RESOLUTION_DAY); return df; }! // ..! return DefaultFieldFactory.createFieldByPropertyType(item .getItemProperty(propertyId).getType()); } });

6

Page 86: Vaadin intro

GridLayout form = new GridLayout(2,2) {! TextField firstName = new TextField("First name"); TextField lastName = new TextField("Last name"); TextField salary = new TextField("Salary"); DateField birthDate = new DateField("Birth date");! { birthDate.setResolution(Resolution.DAY); setSpacing(true); addComponent(firstName); addComponent(lastName); addComponent(birthDate); addComponent(salary); } };! BeanFieldGroup<Employee> fieldGroup = new BeanFieldGroup<Employee>(Employee.class); fieldGroup.bindMemberFields(form); fieldGroup.setItemDataSource(new BeanItem<Employee>(employee));

7

Page 87: Vaadin intro

public class Person { ! @Size(min = 5, max = 50) private String name; ! @Min(0) @Max(100) private int age; ! // + constructor + setters + getters }

Page 88: Vaadin intro

model

presentation

“Joonas Lehtinen”

Component

firstName = “Joonas”!lastName = “Lehtinen”

Demo

Page 89: Vaadin intro

Server Push

Page 90: Vaadin intro

@Push MyUI !

!

<async-supported/> !

!

vaadin-push dependency

Page 91: Vaadin intro

getting started

Page 92: Vaadin intro

getting started

Page 93: Vaadin intro
Page 94: Vaadin intro

Eclipse

Download plugin from Martketplace

Page 95: Vaadin intro

IntelliJ IDEA

Built-in support

Page 96: Vaadin intro

Netbeans

Download plugin Netbeans Plugin Portal

Page 97: Vaadin intro

mvn archetype:generate -DarchetypeGroupId= com.vaadin -DarchetypeArtifactId= vaadin-archetype-application -DarchetypeVersion= 7.1.7

Maven

Page 98: Vaadin intro

Download for Freevaadin.com/book

728 pages

9 789529 319701

ISBN 978-952-93-1970-1

PDF, ePub, HTML

Page 99: Vaadin intro
Page 100: Vaadin intro

ApacheLicense

Page 101: Vaadin intro

community of

100.000+ developers

Ohloh #2 used

Java Web Framework

Page 102: Vaadin intro

Vaadin 7.2 See you tomorrow

Page 103: Vaadin intro

Vaadin 7.2 See you tomorrow

Page 104: Vaadin intro

? [email protected] vaadin.com/joonas

@joonaslehtinen

slideshare.com/ joonaslehtinen