b u i l d i n g r e a c t i v e w e b a p p s i n j a v a
play

B U I L D I N G R E A C T I V E W E B A P P S I N J A V A @ M A - PowerPoint PPT Presentation

B U I L D I N G R E A C T I V E 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 @marcushellberg T O D A Y Quick intro to Vaadin, Spring & Project Reactor Hands-on programming public class MainView extends


  1. B U I L D I N G R E A C T I V E 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. � @marcushellberg

  3. T O D A Y ⚡ Quick intro to Vaadin, Spring & Project Reactor 🙍 Hands-on programming

  4. public class MainView extends VerticalLayout { private MessageBean bean = new MessageBean(); public MainView() { Button button = new Button("Click me", e �-? Notification.show(bean.getMessage())); add(button); } }

  5. public class MainView extends VerticalLayout { public MainView(@Autowired MessageBean bean) { Button button = new Button("Click me", e �-? Notification.show(bean.getMessage())); add(button); } }

  6. public class MainView extends VerticalLayout { public MainView(MessageBean bean) { Button button = new Button("Click me", e �-? Notification.show(bean.getMessage())); add(button); } }

  7. mvn spring-boot:run

  8. PROJECT REACTOR

  9. public class MainView extends VerticalLayout { public MainView() { getMessages().forEach(System.out �:; println); } public List<ChatMessage> getMessages() { ��../ } }

  10. Guest 1: Hello there? Guest 2: Hi! Guest 3: Hi there! Guest 3: How's it going? Guest 1: Pretty good. Nice weather outside! Guest 2: It's raining here...

  11. public class MainView extends VerticalLayout { public MainView() { getMessages().subscribe(System.out �:; println); } public Flux<ChatMessage> getMessages() { return null; } }

  12. Guest 1: Hello there? Guest 2: Hi! Guest 3: Hi there! Guest 3: How's it going? Guest 1: Pretty good. Nice weather outside! Guest 2: It's raining here...

  13. V A A D I N

  14. C O M P O N E N T S A N D T O O L S F O R B U I L D I N G W E B A P P S I N J A V A

  15. F O C U S O N P R O D U C T I V I T Y

  16. G R E AT U X T H R O U G H G R E AT D X

  17. J A V A ♥ W E B

  18. 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>

  19. new ComboBox(); J A V A F R A M E W O R K

  20. V A A D I N U I C O M P O N E N T S C O M P O N E N T S V A A D I N J A V A A P I F L O W VAADIN 8 VAADIN 10+

  21. O P E N S O U R C E Apache 2.0

  22. C O R E C O N C E P T S

  23. new Button("I'm a button") new DatePicker("Select a date") new ComboBox �<? ("Select an option") new Span("I'm a <span>")

  24. new VerticalLayout( new Button("I'm a button"), new DatePicker("Select a date"), new ComboBox �<? ("Select an option"), new Span("I'm a <span>") );

  25. var nameField = new TextField("Name"); var button = new Button("Click me"); button.addClickListener(click �-? { add(new Span(nameField.getValue())); });

  26. @Route("demo") public class Demo extends VerticalLayout { ��../ }

  27. 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); } }

  28. 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"); }

  29. 🔦 D E M O T I M E 🔦

  30. � github.com/marcushellberg/vaadin-chat

  31. TextField name = new TextField(); Button button = new Button("Greet"); layout.addComponents(name, button); button.addClickListener(click -> { Notification.show("Hi, " + name.getValue()); });

  32. Initial HTML CSS JavaScript

  33. {name: {value: 'Marcus'}, button: {event: 'clicked'}} 261 bytes 


  34. TextField name = new TextField(); Button button = new Button("Greet"); layout.add(name, button); button.addClickListener(click -> { Notification.show("Hi, " + name.getValue()); });

  35. {name: {value: 'Marcus'}, button: {event: 'clicked'}} 261 bytes 
 {updates: [ {notification: 'Hi, Marcus'} ]} 267 bytes 


  36. F E AT U R E S

  37. A U T O M AT E D C O M M U N I C AT I O N @Push @Route("") public class MainView extends Div { ... } ui.access(() -> Notification.show("Alert!"));

  38. P W A S U P P O R T @PWA(name = "Vaadin Chat", shortName = "Chat") public class MainView extends Div { ... }

  39. new VerticalLayout( new TextField("Text Field"), new Button("Button") ) <vaadin - vertical - layout> <vaadin - text - field label="Text Field"> �<0 vaadin - text - field> <vaadin - button>Button �<0 vaadin - button> �<0 vaadin - vertical - layout>

  40. A C C E S S I B L E �

  41. S T R O N G S E C U R I T Y �

  42. � S TA B L E A P I

  43. ♥ T H E J V M

  44. � � � �

  45. E X T E N D A B L E �

  46. Always happy to help you.

  47. $

  48. $

  49. � vaadin.com/start

  50. 🤕

  51. T H A N K S � @ M A R C U S H E L L B E R G

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend