SlideShare a Scribd company logo
Best Practices
Bootstrap GWT Projects
for Beginners
B. Lofi Dewanto, 2017
GWTCon 2017 - Best Practices for Beginners | 2017Seite 2
Blasius Lofi Dewanto
Team Leader Application Development @ Interseroh
Zero Waste Solutions
https://www.interseroh.de
Agenda
GWTCon 2017 - Best Practices for Beginners | 2017Seite 3
• Challenges and Objectives
• Best Practices
• Summary
• Discussion
GWT User Perspective
• Junior, intermediate Java developers
• Experiences in Servlet, JSP also Spring MVC
• No GWT experience
• Reviewed projects: 5 domain projects
• Team: 3 – 10 developers
• Timeline: 3 years
• Web apps with Spring, REST and JPA
• Web apps – Microservices with Spring Boot, REST and
JPA
Challenges
GWTCon 2017 - Best Practices for Beginners | 2017Seite 4
Intermediate in Java, Beginner in GWT
GWT
because of
Java!
Technology Stack - Example
GWTCon 2017 - Best Practices for Beginners | 2017Seite 5
Today: Microservice with Docker Container
Java Virtual Maschine
App Server: Tomcat (contained in Spring Boot)
Docker - Rancher
Presentation Layer: Java2JavaScript Transpiler
mit GWT und GwtBootstrap3
Data Access: Hibernate Database: Oracle
BPMN: Signavio, Camunda,
UML: MagicDraw, KissMDA
Operating System: Linux
Business Logic: Spring Boot – Swagger
– REST / JSON
• How to make GWT easily accessible for beginners?
• How to bootstrap your GWT project successfully?
• Fast
• Easy
• Secure
• Fun!
Objectives
GWTCon 2017 - Best Practices for Beginners | 2017Seite 6
Successful GWT Project
GWTCon 2017 - Best Practices for Beginners | 2017Seite 7
Best Practices
Best Practices
• Environment and Architecture (EA)
• Microservice-oriented and Integration with available web
apps (MSAI)
• Programming Model (PROGM)
• Module, Structure and Components (MSC)
• Security (SEC)
GWTCon 2017 - Best Practices for Beginners | 2017Seite 8
Categories
Choose your UI Framework
Problem: a lot of choices in GWT planet, difficult to
bootstrap
• UI frameworks
• Standard
• GwtBootstrap3, GwtMaterialDesign
• GXT, Smart GWT, Vaadin, …
• Basic frameworks
• Errai Framework
• ArcBees GWTP
• Vaadin (with server-side implementation), …
GWTCon 2017 - Best Practices for Beginners | 2017Seite 9
EA: Standard, GwtBootstrap3, GXT, …
Struts
Spring
MVC
Enhydra
Stripes
Wicket
JSF
Tapestry
Echo
RIFE
Java Oldies:
Choice of UI
Frameworks!
Choose your UI Framework
Solution: choose it directly in the beginning, start simple!
• Start simple, create a reference implementation for your
team, extend and migrate as you go
• Interseroh simple reference example:
https://github.com/interseroh/demo-gwt-springboot
• Good start GWT Project Generator:
https://gwt-project-generator.cfapps.io
GWTCon 2017 - Best Practices for Beginners | 2017Seite 10
EA: Standard, GwtBootstrap3, GXT, …
User Interface with Composition
Problem: Microservice == Micro UI, no simple example
how to do this
• Communication
between
Micro UIs?
GWTCon 2017 - Best Practices for Beginners | 2017Seite 11
MSAI: Microservice-based UI
Microservice: Top Menu Bar
Microservice:
Search
Microservice: Footer
Microservice: Order
Microservice: Rating
Microservice:
Advertisement
One Web Page
==
many
Microservices
Web Page
Source: http://microservices.io/patterns/ui/client-side-ui-composition.html
User Interface with Composition
Solution: TURDUCKEN
• Easy to begin with: ScriptInjector, no communication
between Micro UIs
• Communication: begin with InterApp EventBus
GWTCon 2017 - Best Practices for Beginners | 2017Seite 12
MSAI: Microservice-based UI
TURDUCKEN: http://www.slideshare.net/robertkeane1/turducken-divide-and-conquer-large-gwt-apps-with-multiple-teams
GWT InterApp EventBus: https://github.com/sambathl/interapp-eventbus
Excursion: Interseroh TopMenuBar
GWTCon 2017 - Best Practices for Beginners | 2017Seite 13
AppLauncher, Messaging, SSO, Profile
Top Menu Bar: https://github.com/interseroh/topmenubar
TopMenuBar
Problem: calling the services through server-side
component (A) or directly to the microservices (B) needed
Server
Calling Business Services
GWTCon 2017 - Best Practices for Beginners | 2017Seite 14
MSAI: Microservice-based UI
Web browser
Order Service Order UI Service
Order UI JavaScript
Product Service
A
A A
B
B
B
Calling Business Services
Solution: calling directly the microservices needed (B)
• (A): Order UI Service only forwards the request, nonsense!
• Do not afraid to implement presentation logic in GWT, Java
logic
GWTCon 2017 - Best Practices for Beginners | 2017Seite 15
MSAI: Microservice-based UI
Run One UI in One Time independently
Problem: possibility to run the UI stand-alone to develop
UI faster
• In Microservice architecture: standalone UI development is
important!
GWTCon 2017 - Best Practices for Beginners | 2017Seite 16
MSAI: Microservice-based UI
Server
Web browser
Order Service Order UI Service
Order UI JavaScript
Product Service
Run One UI in One Time independently
Solution: Mocking all the RESTful services (RestyGWT)
• Mocking the services
• Requirement: no dead code,
no test code in the production JavaScript!
• On the server-side:
use Spring profile to move the calls
to one service
• On the client-side:
wrap RestyGWT call with a mock call,
build a ModuleDevMock.gwt.xml
which choose a mock implementation
for the service call, using Maven profile
GWTCon 2017 - Best Practices for Beginners | 2017Seite 17
MSAI: Microservice-based UI
Server
Web browser
Order UI Service
Order UI JavaScript
Problem: best practice in Maven module, separation of UI
and Service BUT actually better to put them together!
• It feels “natural” for Microservice
UI and Service in One Maven Module
GWTCon 2017 - Best Practices for Beginners | 2017Seite 18
MSAI: Microservice-based UI
Web browser
Order ServiceOrder UI Service
Order UI JavaScript
UI and Service in One Maven Module
Solution: none sofar
• UI and Service together in Maven: problem with
dependencies?
• You can “copy” the JavaScript result to the service…
• It makes your dependencies complex and not a Maven
standard
• No A depends on B, but A must be built before B!
• Sofar it works fine with Spring Boot
GWTCon 2017 - Best Practices for Beginners | 2017Seite 19
MSAI: Microservice-based UI
UI Integration - Copy or Download?
Problem: Web app already available, how to extend with
GWT Micro UI?
• Actually easily
possible…
Two choices:
• Copy JavaScript to
the web app
• Download the
JavaScript from
remote location
GWTCon 2017 - Best Practices for Beginners | 2017Seite 20
MSAI: With available web apps
Customer
Portal Grails
UI Integration
UI Integration - Copy or Download?
Solution: download from remote location
• Integration JavaScript (GWT-based) in available web app
useful!
• Both ways have advantages and disadvantages
• Download from remote location:
• Microservice-oriented
• Easier to update
GWTCon 2017 - Best Practices for Beginners | 2017Seite 21
MSAI: With available web apps
Table and Grid Component Darn Difficult!
Problem: table and grid component difficult for beginners
• UI components like grid, table, treeview are always difficult
to use, no matter which technologies you are using!
• Borland Delphi, Visual Basic, Struts, HTML, ...
GWTCon 2017 - Best Practices for Beginners | 2017Seite 22
PROGM: Cell-based UI
Table and Grid Component Darn Difficult!
Solution: make a better documentation for those
components; learn, learn and learn
• Luckily good StackOverflow answers
• Vaadin has a good a good Grid component but the GWT
(client-side) part does not have a good documentation
GWTCon 2017 - Best Practices for Beginners | 2017Seite 23
PROGM: Cell-based UI
Vaadin Grid Client-side: https://vaadin.com/docs/framework/v8/clientsidewidgets/clientsidewidgets-grid.html
Asynchronous Programming Model
Problem: async calls are not predictable (no order) from
caller perspective - “callback hell”
• Quite a new concept for developers, who only has
experiences in Java server-side web framework!
• Ugly cascading if you need the order:
public void onSuccess(Void result) {
call();
…
public void onSuccess(Void result) {
…
GWTCon 2017 - Best Practices for Beginners | 2017Seite 24
PROGM: Ugly cascading callbacks
Asynchronous Programming Model
Solution: no general solution sofar
• Wrap Async Callback with Promise
GWTCon 2017 - Best Practices for Beginners | 2017Seite 25
PROGM: Ugly cascading callbacks
Promise GWT: http://www.classicode.net/2017/02/gwts-asynccallback-and-promises
getCars(city).onSuccess(r -> { /* code here */ });
UI Security
Problem: how to secure GWT web app?
• Same as any Single Page Applications
• … it’s own topic ...
GWTCon 2017 - Best Practices for Beginners | 2017Seite 26
SEC: Token-based OAuth 2 – OpenID Connect
UI Security
Solution: OAuth 2, token-based security, OpenID Connect
GWTCon 2017 - Best Practices for Beginners | 2017Seite 27
SEC: Token-based OAuth 2 – OpenID Connect
OAuth 2
OAuth 2: https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
GWTCon 2017 - Best Practices for Beginners | 2017Seite 28
Summary
Summary (1)
• GWT Swing-based programming model: is here to stay!
• Very easy for beginners!
• GWT uses Java semantic as near as possible
• Very good show cases and examples
• Table, Grid and Treeview difficult
• But this is everywhere…
• No designer (GWT Designer is still somewhere…)
Seite 29 GWTCon 2017 - Best Practices for Beginners | 2017
GWT Designer: https://stackoverflow.com/questions/27175381/why-does-gwt-2-7-discontinue-the-gwt-designer
Summary (2)
● Documentation needs rework and cleaning
• General features
• Versions overview
• Documentation (API and reference) per version
• Quick start
• … the rest
• See Spring Framework documentation!
Seite 30 GWTCon 2017 - Best Practices for Beginners | 2017
Summary (3)
GWT still the BEST for
Java-based Single Page Application!
Seite 31 GWTCon 2017 - Best Practices for Beginners | 2017
Discussion
Dr. Blasius Lofi Dewanto
ITbyServices / Manager Application Development
Phone: +49 (02203) 9147 - 1705
Fax: +49 (02203) 9157 - 9773
Mobile: +49 (0151) 6135 - 7172
E-Mail: blasius.dewanto@interseroh.com
Web: www.interseroh.com

More Related Content

PDF
Unirex Lean tools By Dario Carotenuto
GWTcon
 
PDF
The future of GWT 2.x - By Colin Alworth
GWTcon
 
PDF
Present and Future of GWT from a developer perspective
Manuel Carrasco Moñino
 
PPTX
"Jclays, A global solution for application design and automatic GWT code gene...
GWTcon
 
PDF
GWT and PWA
Manuel Carrasco Moñino
 
PPTX
Moving to microservices from idea to production - GitLabJP meetup
Guenjun Yoo
 
PDF
In defense of GWT-RPC By Colin Alworth
GWTcon
 
PDF
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
Igalia
 
Unirex Lean tools By Dario Carotenuto
GWTcon
 
The future of GWT 2.x - By Colin Alworth
GWTcon
 
Present and Future of GWT from a developer perspective
Manuel Carrasco Moñino
 
"Jclays, A global solution for application design and automatic GWT code gene...
GWTcon
 
Moving to microservices from idea to production - GitLabJP meetup
Guenjun Yoo
 
In defense of GWT-RPC By Colin Alworth
GWTcon
 
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
Igalia
 

What's hot (20)

PDF
Building our Component Library
Clement Ho
 
PDF
GWT Contributor Workshop
Manuel Carrasco Moñino
 
PDF
The Java alternative to Javascript
Manuel Carrasco Moñino
 
PDF
JHipster Code 2020 keynote
Julien Dubois
 
PPT
Introduction to Google Web Toolkit
Didier Girard
 
PDF
Driving and virtualizing control systems: the Open Source approach used in Wh...
Igalia
 
PPTX
GWTcon 2015 - Best development practices for GWT web applications
Arcbees
 
PPT
MVP with GWT and GWTP
Christian Goudreau
 
PDF
Introduction à GWT
Arcbees
 
PDF
VueJS Best Practices
Fatih Acet
 
PDF
Devoxx Belgium 2017 - easy microservices with JHipster
Julien Dubois
 
PDF
Webkit overview
Eun Cho
 
PDF
Devoxx : being productive with JHipster
Julien Dubois
 
PDF
Front end microservices - October 2019
Mikhail Kuznetcov
 
PDF
Finding the Jelly in the JAMstack
Tessa Mero
 
PPTX
Meet Qt 6.2 LTS - Ask Us Anything!
Qt
 
PPTX
Qt 6.2 lts vs. qt 5.15 the big feature parity comparison
Qt
 
PPT
GWT + Gears : The browser is the platform
Didier Girard
 
PPTX
JS digest. February 2017
ElifTech
 
PDF
GWT Reloaded
Marcin Szałomski
 
Building our Component Library
Clement Ho
 
GWT Contributor Workshop
Manuel Carrasco Moñino
 
The Java alternative to Javascript
Manuel Carrasco Moñino
 
JHipster Code 2020 keynote
Julien Dubois
 
Introduction to Google Web Toolkit
Didier Girard
 
Driving and virtualizing control systems: the Open Source approach used in Wh...
Igalia
 
GWTcon 2015 - Best development practices for GWT web applications
Arcbees
 
MVP with GWT and GWTP
Christian Goudreau
 
Introduction à GWT
Arcbees
 
VueJS Best Practices
Fatih Acet
 
Devoxx Belgium 2017 - easy microservices with JHipster
Julien Dubois
 
Webkit overview
Eun Cho
 
Devoxx : being productive with JHipster
Julien Dubois
 
Front end microservices - October 2019
Mikhail Kuznetcov
 
Finding the Jelly in the JAMstack
Tessa Mero
 
Meet Qt 6.2 LTS - Ask Us Anything!
Qt
 
Qt 6.2 lts vs. qt 5.15 the big feature parity comparison
Qt
 
GWT + Gears : The browser is the platform
Didier Girard
 
JS digest. February 2017
ElifTech
 
GWT Reloaded
Marcin Szałomski
 
Ad

Similar to Best Practices - By Lofi Dewanto (20)

PDF
Javaland 2014 / GWT architectures and lessons learned
pgt technology scouting GmbH
 
PDF
Introduction to Google Web Toolkit - part 1
Muhammad Ghazali
 
PDF
Gwt create2013 Frankfurt: How we built a million dollar business with GWT
infoqafe
 
PPTX
Ext GWT - Overview and Implementation Case Study
Avi Perez
 
PPT
Google Web Toolkit Introduction - eXo Platform SEA
nerazz08
 
PPT
Google Dev Day2007
lucclaes
 
PPT
GWT is Smarter Than You
Robert Cooper
 
PDF
GWT Architectures and Lessons Learned (WJAX 2013)
pgt technology scouting GmbH
 
PPT
Google Web Toolkits
Yiguang Hu
 
PPTX
GWT HJUG Presentation
Derrick Bowen
 
PPTX
YaJUG: What's new in GWT2
Olivier Gérardin
 
PDF
GWT architecture best practices and lessons learned
pgt technology scouting GmbH
 
PPT
GWT
Lorraine JUG
 
PPTX
Gwt session
Ahmed Akl
 
PDF
First steps with GWT @ Google IO Extended - Pordenone
Giampaolo Trapasso
 
PPTX
GWT = easy AJAX
Olivier Gérardin
 
PPTX
Gwt session
Mans Jug
 
PDF
Javascript as a target language - GWT kickoff - part1/2
JooinK
 
PPTX
Mobile Java with GWT: Still "Write Once, Run Everywhere"
Alex Theedom
 
PPT
Gwt training presentation
MUFIX Community
 
Javaland 2014 / GWT architectures and lessons learned
pgt technology scouting GmbH
 
Introduction to Google Web Toolkit - part 1
Muhammad Ghazali
 
Gwt create2013 Frankfurt: How we built a million dollar business with GWT
infoqafe
 
Ext GWT - Overview and Implementation Case Study
Avi Perez
 
Google Web Toolkit Introduction - eXo Platform SEA
nerazz08
 
Google Dev Day2007
lucclaes
 
GWT is Smarter Than You
Robert Cooper
 
GWT Architectures and Lessons Learned (WJAX 2013)
pgt technology scouting GmbH
 
Google Web Toolkits
Yiguang Hu
 
GWT HJUG Presentation
Derrick Bowen
 
YaJUG: What's new in GWT2
Olivier Gérardin
 
GWT architecture best practices and lessons learned
pgt technology scouting GmbH
 
Gwt session
Ahmed Akl
 
First steps with GWT @ Google IO Extended - Pordenone
Giampaolo Trapasso
 
GWT = easy AJAX
Olivier Gérardin
 
Gwt session
Mans Jug
 
Javascript as a target language - GWT kickoff - part1/2
JooinK
 
Mobile Java with GWT: Still "Write Once, Run Everywhere"
Alex Theedom
 
Gwt training presentation
MUFIX Community
 
Ad

More from GWTcon (11)

PDF
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
PDF
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
GWTcon
 
PDF
Web components with java by Haijian Wang
GWTcon
 
PDF
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
GWTcon
 
PDF
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
GWTcon
 
PPTX
GWT Development for Handheld Devices
GWTcon
 
PPTX
GWT vs CSS3
GWTcon
 
PDF
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
GWTcon
 
PDF
GWT Web Socket and data serialization
GWTcon
 
PPTX
GWTcon 2014 - Apertura
GWTcon
 
PPTX
GWT videocall: power-up your mobile & web app with WebRTC
GWTcon
 
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
GWTcon
 
Web components with java by Haijian Wang
GWTcon
 
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
GWTcon
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
GWTcon
 
GWT Development for Handheld Devices
GWTcon
 
GWT vs CSS3
GWTcon
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
GWTcon
 
GWT Web Socket and data serialization
GWTcon
 
GWTcon 2014 - Apertura
GWTcon
 
GWT videocall: power-up your mobile & web app with WebRTC
GWTcon
 

Recently uploaded (20)

PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Doc9.....................................
SofiaCollazos
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Doc9.....................................
SofiaCollazos
 

Best Practices - By Lofi Dewanto

  • 1. Best Practices Bootstrap GWT Projects for Beginners B. Lofi Dewanto, 2017
  • 2. GWTCon 2017 - Best Practices for Beginners | 2017Seite 2 Blasius Lofi Dewanto Team Leader Application Development @ Interseroh Zero Waste Solutions https://www.interseroh.de
  • 3. Agenda GWTCon 2017 - Best Practices for Beginners | 2017Seite 3 • Challenges and Objectives • Best Practices • Summary • Discussion GWT User Perspective
  • 4. • Junior, intermediate Java developers • Experiences in Servlet, JSP also Spring MVC • No GWT experience • Reviewed projects: 5 domain projects • Team: 3 – 10 developers • Timeline: 3 years • Web apps with Spring, REST and JPA • Web apps – Microservices with Spring Boot, REST and JPA Challenges GWTCon 2017 - Best Practices for Beginners | 2017Seite 4 Intermediate in Java, Beginner in GWT GWT because of Java!
  • 5. Technology Stack - Example GWTCon 2017 - Best Practices for Beginners | 2017Seite 5 Today: Microservice with Docker Container Java Virtual Maschine App Server: Tomcat (contained in Spring Boot) Docker - Rancher Presentation Layer: Java2JavaScript Transpiler mit GWT und GwtBootstrap3 Data Access: Hibernate Database: Oracle BPMN: Signavio, Camunda, UML: MagicDraw, KissMDA Operating System: Linux Business Logic: Spring Boot – Swagger – REST / JSON
  • 6. • How to make GWT easily accessible for beginners? • How to bootstrap your GWT project successfully? • Fast • Easy • Secure • Fun! Objectives GWTCon 2017 - Best Practices for Beginners | 2017Seite 6 Successful GWT Project
  • 7. GWTCon 2017 - Best Practices for Beginners | 2017Seite 7 Best Practices
  • 8. Best Practices • Environment and Architecture (EA) • Microservice-oriented and Integration with available web apps (MSAI) • Programming Model (PROGM) • Module, Structure and Components (MSC) • Security (SEC) GWTCon 2017 - Best Practices for Beginners | 2017Seite 8 Categories
  • 9. Choose your UI Framework Problem: a lot of choices in GWT planet, difficult to bootstrap • UI frameworks • Standard • GwtBootstrap3, GwtMaterialDesign • GXT, Smart GWT, Vaadin, … • Basic frameworks • Errai Framework • ArcBees GWTP • Vaadin (with server-side implementation), … GWTCon 2017 - Best Practices for Beginners | 2017Seite 9 EA: Standard, GwtBootstrap3, GXT, … Struts Spring MVC Enhydra Stripes Wicket JSF Tapestry Echo RIFE Java Oldies: Choice of UI Frameworks!
  • 10. Choose your UI Framework Solution: choose it directly in the beginning, start simple! • Start simple, create a reference implementation for your team, extend and migrate as you go • Interseroh simple reference example: https://github.com/interseroh/demo-gwt-springboot • Good start GWT Project Generator: https://gwt-project-generator.cfapps.io GWTCon 2017 - Best Practices for Beginners | 2017Seite 10 EA: Standard, GwtBootstrap3, GXT, …
  • 11. User Interface with Composition Problem: Microservice == Micro UI, no simple example how to do this • Communication between Micro UIs? GWTCon 2017 - Best Practices for Beginners | 2017Seite 11 MSAI: Microservice-based UI Microservice: Top Menu Bar Microservice: Search Microservice: Footer Microservice: Order Microservice: Rating Microservice: Advertisement One Web Page == many Microservices Web Page Source: http://microservices.io/patterns/ui/client-side-ui-composition.html
  • 12. User Interface with Composition Solution: TURDUCKEN • Easy to begin with: ScriptInjector, no communication between Micro UIs • Communication: begin with InterApp EventBus GWTCon 2017 - Best Practices for Beginners | 2017Seite 12 MSAI: Microservice-based UI TURDUCKEN: http://www.slideshare.net/robertkeane1/turducken-divide-and-conquer-large-gwt-apps-with-multiple-teams GWT InterApp EventBus: https://github.com/sambathl/interapp-eventbus
  • 13. Excursion: Interseroh TopMenuBar GWTCon 2017 - Best Practices for Beginners | 2017Seite 13 AppLauncher, Messaging, SSO, Profile Top Menu Bar: https://github.com/interseroh/topmenubar TopMenuBar
  • 14. Problem: calling the services through server-side component (A) or directly to the microservices (B) needed Server Calling Business Services GWTCon 2017 - Best Practices for Beginners | 2017Seite 14 MSAI: Microservice-based UI Web browser Order Service Order UI Service Order UI JavaScript Product Service A A A B B B
  • 15. Calling Business Services Solution: calling directly the microservices needed (B) • (A): Order UI Service only forwards the request, nonsense! • Do not afraid to implement presentation logic in GWT, Java logic GWTCon 2017 - Best Practices for Beginners | 2017Seite 15 MSAI: Microservice-based UI
  • 16. Run One UI in One Time independently Problem: possibility to run the UI stand-alone to develop UI faster • In Microservice architecture: standalone UI development is important! GWTCon 2017 - Best Practices for Beginners | 2017Seite 16 MSAI: Microservice-based UI Server Web browser Order Service Order UI Service Order UI JavaScript Product Service
  • 17. Run One UI in One Time independently Solution: Mocking all the RESTful services (RestyGWT) • Mocking the services • Requirement: no dead code, no test code in the production JavaScript! • On the server-side: use Spring profile to move the calls to one service • On the client-side: wrap RestyGWT call with a mock call, build a ModuleDevMock.gwt.xml which choose a mock implementation for the service call, using Maven profile GWTCon 2017 - Best Practices for Beginners | 2017Seite 17 MSAI: Microservice-based UI Server Web browser Order UI Service Order UI JavaScript
  • 18. Problem: best practice in Maven module, separation of UI and Service BUT actually better to put them together! • It feels “natural” for Microservice UI and Service in One Maven Module GWTCon 2017 - Best Practices for Beginners | 2017Seite 18 MSAI: Microservice-based UI Web browser Order ServiceOrder UI Service Order UI JavaScript
  • 19. UI and Service in One Maven Module Solution: none sofar • UI and Service together in Maven: problem with dependencies? • You can “copy” the JavaScript result to the service… • It makes your dependencies complex and not a Maven standard • No A depends on B, but A must be built before B! • Sofar it works fine with Spring Boot GWTCon 2017 - Best Practices for Beginners | 2017Seite 19 MSAI: Microservice-based UI
  • 20. UI Integration - Copy or Download? Problem: Web app already available, how to extend with GWT Micro UI? • Actually easily possible… Two choices: • Copy JavaScript to the web app • Download the JavaScript from remote location GWTCon 2017 - Best Practices for Beginners | 2017Seite 20 MSAI: With available web apps Customer Portal Grails UI Integration
  • 21. UI Integration - Copy or Download? Solution: download from remote location • Integration JavaScript (GWT-based) in available web app useful! • Both ways have advantages and disadvantages • Download from remote location: • Microservice-oriented • Easier to update GWTCon 2017 - Best Practices for Beginners | 2017Seite 21 MSAI: With available web apps
  • 22. Table and Grid Component Darn Difficult! Problem: table and grid component difficult for beginners • UI components like grid, table, treeview are always difficult to use, no matter which technologies you are using! • Borland Delphi, Visual Basic, Struts, HTML, ... GWTCon 2017 - Best Practices for Beginners | 2017Seite 22 PROGM: Cell-based UI
  • 23. Table and Grid Component Darn Difficult! Solution: make a better documentation for those components; learn, learn and learn • Luckily good StackOverflow answers • Vaadin has a good a good Grid component but the GWT (client-side) part does not have a good documentation GWTCon 2017 - Best Practices for Beginners | 2017Seite 23 PROGM: Cell-based UI Vaadin Grid Client-side: https://vaadin.com/docs/framework/v8/clientsidewidgets/clientsidewidgets-grid.html
  • 24. Asynchronous Programming Model Problem: async calls are not predictable (no order) from caller perspective - “callback hell” • Quite a new concept for developers, who only has experiences in Java server-side web framework! • Ugly cascading if you need the order: public void onSuccess(Void result) { call(); … public void onSuccess(Void result) { … GWTCon 2017 - Best Practices for Beginners | 2017Seite 24 PROGM: Ugly cascading callbacks
  • 25. Asynchronous Programming Model Solution: no general solution sofar • Wrap Async Callback with Promise GWTCon 2017 - Best Practices for Beginners | 2017Seite 25 PROGM: Ugly cascading callbacks Promise GWT: http://www.classicode.net/2017/02/gwts-asynccallback-and-promises getCars(city).onSuccess(r -> { /* code here */ });
  • 26. UI Security Problem: how to secure GWT web app? • Same as any Single Page Applications • … it’s own topic ... GWTCon 2017 - Best Practices for Beginners | 2017Seite 26 SEC: Token-based OAuth 2 – OpenID Connect
  • 27. UI Security Solution: OAuth 2, token-based security, OpenID Connect GWTCon 2017 - Best Practices for Beginners | 2017Seite 27 SEC: Token-based OAuth 2 – OpenID Connect OAuth 2 OAuth 2: https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2
  • 28. GWTCon 2017 - Best Practices for Beginners | 2017Seite 28 Summary
  • 29. Summary (1) • GWT Swing-based programming model: is here to stay! • Very easy for beginners! • GWT uses Java semantic as near as possible • Very good show cases and examples • Table, Grid and Treeview difficult • But this is everywhere… • No designer (GWT Designer is still somewhere…) Seite 29 GWTCon 2017 - Best Practices for Beginners | 2017 GWT Designer: https://stackoverflow.com/questions/27175381/why-does-gwt-2-7-discontinue-the-gwt-designer
  • 30. Summary (2) ● Documentation needs rework and cleaning • General features • Versions overview • Documentation (API and reference) per version • Quick start • … the rest • See Spring Framework documentation! Seite 30 GWTCon 2017 - Best Practices for Beginners | 2017
  • 31. Summary (3) GWT still the BEST for Java-based Single Page Application! Seite 31 GWTCon 2017 - Best Practices for Beginners | 2017
  • 32. Discussion Dr. Blasius Lofi Dewanto ITbyServices / Manager Application Development Phone: +49 (02203) 9147 - 1705 Fax: +49 (02203) 9157 - 9773 Mobile: +49 (0151) 6135 - 7172 E-Mail: [email protected] Web: www.interseroh.com