Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vaadin for Desktop Applications

Vaadin for Desktop Applications

How to use Vaadin, Jetty and Electron for Desktop application development

See tutorial at https://github.com/cuba-labs/java-electron-tutorial

Yuriy Artamonov

October 04, 2017
Tweet

More Decks by Yuriy Artamonov

Other Decks in Programming

Transcript

  1. HELLO! I am Yuriy Artamonov I am here because I

    develop Vaadin applications for 7 years at https://cuba-platform.com 2
  2. GitHub Electron How to use it with Java? There are

    two ways: ▪ Old-fashioned GWT client side ▪ Write code on Vaadin and bundle servlet container inside of an application Let’s try to use the second way! What is it all about? Electron is a well-known on-ramp for web developers to build desktop apps using familiar web technologies: HTML, CSS, and JavaScript. In a nutshell: Node JS backend + Chromium web browser in a single application with additional Desktop integrations: native menus, installers, notifications, etc. 3
  3. Why do we need this approach? 1. Usually desktop applications

    written in Java are horrible 2. Java Desktop technologies do not evolve 3. Web technologies are way better for UI 4. We can use all CSS / JS libraries 5. We develop web applications on Vaadin, so why not to reuse the same code/experience? 4
  4. Demo Simple task manager based on Jetty + Vaadin +

    Electron https://github.com/jreznot/electron-java-app 7
  5. Tips and tricks 1. Use Jetty servlet container as it

    can be embedded easily 2. Enable @Push(transport = Transport.WEBSOCKET) for UI to speed up communication and strip useless HTTP headers 3. Unpack all the static files and serve them directly from a file system instead of sending them via HTTP 4. Use Gradle node plugin com.moowork.node instead of manual Node installation 8
  6. Our real-life use case CUBA Studio - a powerful enterprise

    application development tool for applications based on CUBA Platform. With Studio, applications are up and running within minutes. We used Vaadin for CUBA Studio for 3 years and all the time it was a web application inside of a web browser. Let’s fix it! Convert it all to a desktop installable app. 9
  7. CREDITS Special thanks to all the people who made and

    released these awesome resources for free: ▪ Presentation template by SlidesCarnival 11