SlideShare une entreprise Scribd logo
1  sur  60
Télécharger pour lire hors ligne
B U I L D I N G M O D E R N
W E B A P P S I N J A V A
@ M A R C U S H E L L B E R G
@ M A R C U S H E L L B E R G
A G E N D A
⚡ Quick intro to Vaadin 10
🙌 Hands-on programming
5
V A A D I N 1 0
F O C U S O N
P R O D U C T I V I T Y
G R E AT U X T H R O U G H
G R E AT D X
J A V A ♥ W E B
S TA N D A R D S - B A S E D
W E B C O M P O N E N T S
<vaadin-combo-box>

</vaadin-combo-box>
J A V A F R A M E W O R K
new ComboBox();
VAADIN 8
U I C O M P O N E N T S
J A V A A P I
VAADIN 10
V A A D I N
C O M P O N E N T S
V A A D I N
F L O W
O P E N S O U R C E
Apache 2.0
C O R E C O N C E P T S
new Span("I'm a <span>")
new Button("I'm a button")
new DatePicker("Select a date")
new ComboBox <>("Select an option")
new VerticalLayout(
new Button("I'm a button"),
new DatePicker("Select a date"),
new ComboBox <>("Select an option"),
new Span("I'm a <span>")
);
var nameField = new TextField("Name");
var button = new Button("Click me");
button.addClickListener(click -> {
add(new Span(nameField.getValue()));
});
var nameField = new TextField("Name");
var button = new Button("Click me");
button.addClickListener(click -> {
add(new Span(nameField.getValue()));
});
@Route("demo")
public class Demo extends VerticalLayout {
...
}
// Parent layout for all views under /users
@RoutePrefix("users")
class UsersView extends Div
implements RouterLayout {
// ... implementation ...
}
// matches /users/edit/123
@Route(value = "edit", layout = UsersView.class)
class UserEditorView extends Div
implements HasUrlParameter<Integer> {
@Override
public void setParameter(BeforeEvent event,
Integer userId) {
// ... fetch user ...
}
}
public class SignupForm extends VerticalLayout {
static class Person {
@NotEmpty private String name;
@Email @NotEmpty private String email;
}
private TextField name = new TextField("Name");
private TextField email = new TextField("Email");
private Person person = new Person();
public SignupForm() {
Binder<Person> binder
= new BeanValidationBinder <>(Person.class);
binder.bindInstanceFields(this);
binder.setBean(person);
Button save = new Button("Save");
add(name, email, save);
}
}
public class SignupForm extends VerticalLayout {
static class Person {
@NotEmpty private String name;
@Email @NotEmpty private String email;
}
private TextField name = new TextField("Name");
private TextField email = new TextField("Email");
private Person person = new Person();
public SignupForm() {
Binder<Person> binder
= new BeanValidationBinder <>(Person.class);
binder.bindInstanceFields(this);
binder.setBean(person);
Button save = new Button("Save");
add(name, email, save);
}
}
public Demo(PersonService service) {
Grid<Person> grid = new Grid <>();
grid.setItems(service.getPeople());
grid.addColumn(Person ::getName)
.setHeader("Name");
grid.addColumn(Person ::getAge)
.setHeader("Age");
}
public Demo(PersonService service) {
Grid<Person> grid = new Grid <>();
grid.setItems(service.getPeople());
grid.addColumn(Person ::getName)
.setHeader("Name");
grid.addColumn(Person ::getAge)
.setHeader("Age");
}
🔥 D E M O T I M E 🔥
github.com/marcushellberg/vaadin-chat
TextField name = new TextField();
Button button = new Button("Greet");
layout.addComponents(name, button);
button.addClickListener(click -> {
Notification.show("Hi, " + name.getValue());
});
Initial HTML
CSS
JavaScript
{name: {value: 'Marcus'},
button: {event: 'clicked'}}
261 bytes

TextField name = new TextField();
Button button = new Button("Greet");
layout.add(name, button);
button.addClickListener(click -> {
Notification.show("Hi, " + name.getValue());
});
TextField name = new TextField();
Button button = new Button("Greet");
layout.add(name, button);
button.addClickListener(click -> {
Notification.show("Hi, " + name.getValue());
});
{name: {value: 'Marcus'},
button: {event: 'clicked'}}
261 bytes

{updates: [
{notification: 'Hi, Marcus'}
]}
267 bytes

F E AT U R E S
A U T O M AT E D C O M M U N I C AT I O N
public class MainView extends Div {
...
}
@Route("")
A U T O M AT E D C O M M U N I C AT I O N
public class MainView extends Div {
...
}
@Push
@Route("")
A U T O M AT E D C O M M U N I C AT I O N
public class MainView extends Div {
...
}
@Push
ui.access(() -> Notification.show("Alert!"));
@Route("")
new VerticalLayout(
new TextField("Text Field"),
new Button("Button")
)
<vaadin-vertical-layout>
<vaadin-text-field label="Text Field">
</vaadin-text-field>
<vaadin-button>Button </vaadin-button>
</vaadin-vertical-layout>
A C C E S S I B L E
S T R O N G S E C U R I T Y
S TA B L E A P I
T H E J V M♥
E X T E N D A B L E
$
$
$
2 0 1 8 2 0 2 12 0 1 9 2 0 2 0 2 0 2 2 2 0 2 52 0 2 3 2 0 2 4 • • •2 0 2 6 2 0 2 7
LT S- V10
LTS-V23
LT S-V3 1
LT S-V3 9
V1 2
V1 1
V1 3
V14
LTS-V17
V15
V16
+ 5 year support (bug fixes)
F A S T R E L E A S E C Y C L E + S T A B I L I T Y
R O A D M A P
- Better Progressive Web App support
- More components
- More starters
Always happy to help you.
vaadin.com/start
github.com/vaadin
gitter.im/vaadin
T H A N K S
@ M A R C U S H E L L B E R G

Contenu connexe

Similaire à Building web apps with vaadin 10

10 awt event model
10 awt event model10 awt event model
10 awt event model
Bayarkhuu
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
Jussi Pohjolainen
 
Yolygambas
YolygambasYolygambas
Yolygambas
rosyp
 
Android Studio (Java)The SimplePaint app (full code given below).docx
Android Studio (Java)The SimplePaint app (full code given below).docxAndroid Studio (Java)The SimplePaint app (full code given below).docx
Android Studio (Java)The SimplePaint app (full code given below).docx
amrit47
 

Similaire à Building web apps with vaadin 10 (20)

Day 5
Day 5Day 5
Day 5
 
Android Animation (in tamil)
Android Animation (in tamil)Android Animation (in tamil)
Android Animation (in tamil)
 
Project fast food automaton
Project fast food automatonProject fast food automaton
Project fast food automaton
 
10 awt event model
10 awt event model10 awt event model
10 awt event model
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
Voices That Matter: JavaScript Events
Voices That Matter: JavaScript EventsVoices That Matter: JavaScript Events
Voices That Matter: JavaScript Events
 
STYLISH FLOOR
STYLISH FLOORSTYLISH FLOOR
STYLISH FLOOR
 
Baitap tkw
Baitap tkwBaitap tkw
Baitap tkw
 
Testing TYPO3 Applications
Testing TYPO3 ApplicationsTesting TYPO3 Applications
Testing TYPO3 Applications
 
안드로이드 세미나 2
안드로이드 세미나 2안드로이드 세미나 2
안드로이드 세미나 2
 
안드로이드 세미나 2
안드로이드 세미나 2안드로이드 세미나 2
안드로이드 세미나 2
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
Vaadin 7 by Joonas Lehtinen
Vaadin 7 by Joonas LehtinenVaadin 7 by Joonas Lehtinen
Vaadin 7 by Joonas Lehtinen
 
Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intent
 
Android Studio (Java)The SimplePaint app (full code given below).docx
Android Studio (Java)The SimplePaint app (full code given below).docxAndroid Studio (Java)The SimplePaint app (full code given below).docx
Android Studio (Java)The SimplePaint app (full code given below).docx
 

Plus de Marcus Hellberg

Plus de Marcus Hellberg (9)

Building performant web apps
Building performant web appsBuilding performant web apps
Building performant web apps
 
Going web native - Feb 2018
Going web native - Feb 2018Going web native - Feb 2018
Going web native - Feb 2018
 
Going web native
Going web nativeGoing web native
Going web native
 
Going web native
Going web nativeGoing web native
Going web native
 
Demystifying progressive web apps
Demystifying progressive web appsDemystifying progressive web apps
Demystifying progressive web apps
 
Progressive web apps with polymer
Progressive web apps with polymerProgressive web apps with polymer
Progressive web apps with polymer
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Vaadin NYC Meetup
Vaadin NYC MeetupVaadin NYC Meetup
Vaadin NYC Meetup
 

Dernier

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 

Building web apps with vaadin 10

  • 1. B U I L D I N G M O D E R N W E B A P P S I N J A V A @ M A R C U S H E L L B E R G
  • 2. @ M A R C U S H E L L B E R G
  • 3. A G E N D A ⚡ Quick intro to Vaadin 10 🙌 Hands-on programming
  • 4. 5 V A A D I N 1 0
  • 5. F O C U S O N P R O D U C T I V I T Y
  • 6. G R E AT U X T H R O U G H G R E AT D X
  • 7. J A V A ♥ W E B
  • 8.
  • 9. S TA N D A R D S - B A S E D W E B C O M P O N E N T S <vaadin-combo-box>
 </vaadin-combo-box>
  • 10. J A V A F R A M E W O R K new ComboBox();
  • 11. VAADIN 8 U I C O M P O N E N T S J A V A A P I VAADIN 10 V A A D I N C O M P O N E N T S V A A D I N F L O W
  • 12. O P E N S O U R C E Apache 2.0
  • 13. C O R E C O N C E P T S
  • 14. new Span("I'm a <span>") new Button("I'm a button") new DatePicker("Select a date") new ComboBox <>("Select an option")
  • 15. new VerticalLayout( new Button("I'm a button"), new DatePicker("Select a date"), new ComboBox <>("Select an option"), new Span("I'm a <span>") );
  • 16. var nameField = new TextField("Name"); var button = new Button("Click me"); button.addClickListener(click -> { add(new Span(nameField.getValue())); });
  • 17. var nameField = new TextField("Name"); var button = new Button("Click me"); button.addClickListener(click -> { add(new Span(nameField.getValue())); });
  • 18. @Route("demo") public class Demo extends VerticalLayout { ... }
  • 19. // Parent layout for all views under /users @RoutePrefix("users") class UsersView extends Div implements RouterLayout { // ... implementation ... } // matches /users/edit/123 @Route(value = "edit", layout = UsersView.class) class UserEditorView extends Div implements HasUrlParameter<Integer> { @Override public void setParameter(BeforeEvent event, Integer userId) { // ... fetch user ... } }
  • 20. public class SignupForm extends VerticalLayout { static class Person { @NotEmpty private String name; @Email @NotEmpty private String email; } private TextField name = new TextField("Name"); private TextField email = new TextField("Email"); private Person person = new Person(); public SignupForm() { Binder<Person> binder = new BeanValidationBinder <>(Person.class); binder.bindInstanceFields(this); binder.setBean(person); Button save = new Button("Save"); add(name, email, save); } }
  • 21. public class SignupForm extends VerticalLayout { static class Person { @NotEmpty private String name; @Email @NotEmpty private String email; } private TextField name = new TextField("Name"); private TextField email = new TextField("Email"); private Person person = new Person(); public SignupForm() { Binder<Person> binder = new BeanValidationBinder <>(Person.class); binder.bindInstanceFields(this); binder.setBean(person); Button save = new Button("Save"); add(name, email, save); } }
  • 22. public Demo(PersonService service) { Grid<Person> grid = new Grid <>(); grid.setItems(service.getPeople()); grid.addColumn(Person ::getName) .setHeader("Name"); grid.addColumn(Person ::getAge) .setHeader("Age"); }
  • 23. public Demo(PersonService service) { Grid<Person> grid = new Grid <>(); grid.setItems(service.getPeople()); grid.addColumn(Person ::getName) .setHeader("Name"); grid.addColumn(Person ::getAge) .setHeader("Age"); }
  • 24. 🔥 D E M O T I M E 🔥
  • 25.
  • 26.
  • 28. TextField name = new TextField(); Button button = new Button("Greet"); layout.addComponents(name, button); button.addClickListener(click -> { Notification.show("Hi, " + name.getValue()); });
  • 30.
  • 31.
  • 32. {name: {value: 'Marcus'}, button: {event: 'clicked'}} 261 bytes

  • 33. TextField name = new TextField(); Button button = new Button("Greet"); layout.add(name, button); button.addClickListener(click -> { Notification.show("Hi, " + name.getValue()); });
  • 34. TextField name = new TextField(); Button button = new Button("Greet"); layout.add(name, button); button.addClickListener(click -> { Notification.show("Hi, " + name.getValue()); });
  • 35.
  • 36. {name: {value: 'Marcus'}, button: {event: 'clicked'}} 261 bytes
 {updates: [ {notification: 'Hi, Marcus'} ]} 267 bytes

  • 37. F E AT U R E S
  • 38. A U T O M AT E D C O M M U N I C AT I O N public class MainView extends Div { ... } @Route("")
  • 39. A U T O M AT E D C O M M U N I C AT I O N public class MainView extends Div { ... } @Push @Route("")
  • 40. A U T O M AT E D C O M M U N I C AT I O N public class MainView extends Div { ... } @Push ui.access(() -> Notification.show("Alert!")); @Route("")
  • 41. new VerticalLayout( new TextField("Text Field"), new Button("Button") ) <vaadin-vertical-layout> <vaadin-text-field label="Text Field"> </vaadin-text-field> <vaadin-button>Button </vaadin-button> </vaadin-vertical-layout>
  • 42.
  • 43. A C C E S S I B L E
  • 44. S T R O N G S E C U R I T Y
  • 45. S TA B L E A P I
  • 46. T H E J V M♥
  • 47.
  • 48. E X T E N D A B L E
  • 49.
  • 50. $
  • 51. $
  • 52. $
  • 53. 2 0 1 8 2 0 2 12 0 1 9 2 0 2 0 2 0 2 2 2 0 2 52 0 2 3 2 0 2 4 • • •2 0 2 6 2 0 2 7 LT S- V10 LTS-V23 LT S-V3 1 LT S-V3 9 V1 2 V1 1 V1 3 V14 LTS-V17 V15 V16 + 5 year support (bug fixes) F A S T R E L E A S E C Y C L E + S T A B I L I T Y
  • 54. R O A D M A P - Better Progressive Web App support - More components - More starters
  • 55.
  • 56.
  • 57.
  • 58. Always happy to help you.
  • 60. T H A N K S @ M A R C U S H E L L B E R G