Top Banner
“good” = “awesome” “Honesty - Invented in Finland” https://vimeo.com/113102755
21

Vaadin and Spring at Devoxx UK 2015

Aug 13, 2015

Download

Technology

Sami Ekblad
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Vaadin and Spring at Devoxx UK 2015

“good” = “awesome”“Honesty - Invented in Finland” https://vimeo.com/113102755

Page 2: Vaadin and Spring at Devoxx UK 2015

How to rock your web apps

with Spring and Vaadin

Page 3: Vaadin and Spring at Devoxx UK 2015

what isVaadin

all about??

Page 4: Vaadin and Spring at Devoxx UK 2015

Make building (good)

webapplications

easy

Page 5: Vaadin and Spring at Devoxx UK 2015
Page 6: Vaadin and Spring at Devoxx UK 2015
Page 7: Vaadin and Spring at Devoxx UK 2015
Page 8: Vaadin and Spring at Devoxx UK 2015
Page 9: Vaadin and Spring at Devoxx UK 2015

Web application layers

JavaScriptJava to

JavaScriptWeb

serverBackend

server

required optional optionalrequired

RPC

optional

Vaadin

required optionalrequired

GW

T

requiredrequiredJS

requiredrequired

required required

Page 10: Vaadin and Spring at Devoxx UK 2015

TextField name = new TextField("Name");Button greetButton = new Button("Greet"); greetButton.addClickListener(e -> { Notification.show("Hi "+name.getValue());});

Vaadin Java code:

Page 11: Vaadin and Spring at Devoxx UK 2015
Page 12: Vaadin and Spring at Devoxx UK 2015

525

Page 13: Vaadin and Spring at Devoxx UK 2015

Vaadin andSpring?

Page 14: Vaadin and Spring at Devoxx UK 2015

Build beautiful web user interfaces.

Single page application easily.

Code in Java on the server-side.

Easy binding to Spring data sources.

Vaadin

for Spring Applications?

Page 15: Vaadin and Spring at Devoxx UK 2015

One-step with Spring Boot.

IoC for modularity and testability.

Cloud-ready applications.

Full set of Spring libraries available.

Spring

for Vaadin Applications?

Page 16: Vaadin and Spring at Devoxx UK 2015

@SpringBootApplicationpublic class DemoApplication {

public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); }

@Service public static class MyService {

public String sayHi() { return "Hello Spring Initializr!"; }

}

@Theme("valo") @SpringUI(path = "") public static class VaadinUI extends UI {

@Autowired MyService myService;

@Override protected void init(VaadinRequest request) { setContent(new Label(myService.sayHi())); }

}}

Page 17: Vaadin and Spring at Devoxx UK 2015

curl start.spring.iodemo}>|

Page 18: Vaadin and Spring at Devoxx UK 2015

curl https://start.spring.io/starter.zip \ -d type=maven-project -d dependencies=vaadin,data-jpa,data-rest,h2,social-twitter \ -d baseDir=vaadin-demo -d artifactId=vaadin-demo -d javaVersion=1.8 -o vaadin-demo.zip

Page 19: Vaadin and Spring at Devoxx UK 2015

JPA

Spring Data

Spring Boot

curl -i -X POST -H "Content-Type:application/json" -d '{ "lat" : "60.205654", "lon" : "21.8838", "speed" : "6.5", "timestamp" : "2015-04-28'T'16:50:20Z" }' http://localhost:8080/gps

REST

/JSO

N

GPSData

Backend Frontend

Vaadin

Page 20: Vaadin and Spring at Devoxx UK 2015

github.com/samie/

spring-vaadin-demo

Page 21: Vaadin and Spring at Devoxx UK 2015

vaadin.com/spring

Springfor Vaadin

Vaadinfor Spring Applications