DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini

GWTcon
GWTcon Firenze, Italy
DIY:
Split GWT Applications using
TURDUCKEN approach.
Alberto Mancini
alberto@jooink.com +AlbertoMancini
Who I am.
FREELANCE
- SOFTWARE DEVELOPER (WEB&MOBILE)
- LINUX SYSADMIN
- DEVOPS
#JOOINK TEAM
#GDG-FIRENZE
#INTEL SOFTWARE INNOVATOR
#GWTCON
2
alberto@jooink.com +AlbertoMancini
Problem Statement
3
alberto@jooink.com +AlbertoMancini
4
alberto@jooink.com +AlbertoMancini
No rocket science
5
alberto@jooink.com +AlbertoMancini
A work where details Matter!
6
alberto@jooink.com +AlbertoMancini
A good way
to start working/training
with
JsInterop!
7
alberto@jooink.com +AlbertoMancini
TURDUCKEN
Turducken - Divide and Conquer large GWT apps with
multiple teams
Rob Keane, GWT.create 2013
https://www.slideshare.net/RobertKeane1/turducken-divide
-and-conquer-large-gwt-apps-with-multiple-teams
8
alberto@jooink.com +AlbertoMancini
9
alberto@jooink.com +AlbertoMancini
10
alberto@jooink.com +AlbertoMancini
This was true back in 2012 ...
11
alberto@jooink.com +AlbertoMancini
Have you checked the state of the
SEAMLESS attribute for IFRAME ?
12
alberto@jooink.com +AlbertoMancini
Problems back from the past …
A problem investigated around 2010 ...
An pattern for GWT applications proposed in 2013 ...
A 2012 workaround for a ‘forthcoming’ HTML5 feature ….
that eventually disappeared and never really born :|
13
alberto@jooink.com +AlbertoMancini
2017 architecture
Service channel
App channel
14
APP_1 APP_2
alberto@jooink.com +AlbertoMancini
Window.postMessage
As in the Turducken pattern Window.postMessage is our
swiss-knife; the one that opens the possibility of
communications in the browser (even Cross Origin :))
The first idea was to multiplex this communication channel to
drive both service and app messages but …
15
alberto@jooink.com +AlbertoMancini
Window.postMessage
- A lot of security concerns, target and origin to take care of
Well, definitely something we will prefer not to leave in the hands
of the users of this code if we can but …
16
alberto@jooink.com +AlbertoMancini
JsInterop(ping) MessageChannel
package com.jooink.gwt.innerapp.support.jsi;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
@JsType(isNative = true, name="MessageChannel", namespace =
JsPackage.GLOBAL)
public class MessageChannel {
@JsProperty
public native MessagePort getPort1();
@JsProperty
public native MessagePort getPort2();
}
17
alberto@jooink.com +AlbertoMancini
MessagePort
package com.jooink.gwt.innerapp.support.jsi;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
@JsType(isNative = true, name="MessagePort", namespace =
JsPackage.GLOBAL)
public abstract class MessagePort {
public native void postMessage(Object payload);
public native void start();
public native void close();
@JsProperty(name = "onmessage")
public native void setOnMessage(Consumer<MessageEvent> consumer);
}
18
alberto@jooink.com +AlbertoMancini
CanIuse http://caniuse.com/#feat=channel-messaging
19
alberto@jooink.com +AlbertoMancini
Revised architecture
The applications during the first contact (done via
Window.postMessage) exchange a messageChannel;
Later, postMessage is used for service messages (the library
handles this kind of messages) and the message channel is on
the other hand left available, untouched, for the business
messages. So the picture with 2 channels was not really
misleading.
20
alberto@jooink.com +AlbertoMancini
Host Application
AppWidget:
...
AppWidget appWidget = new AppWidget(OTHER_URL);
appWidget.asWidget().setSize("500px","300px");
view.add(appWidget);
…
21
alberto@jooink.com +AlbertoMancini
Host Application
For instance per default we allow resizing
protected void handleResizeRequest(int width, int height) {
this.frame.setPixelSize(width, height);
}
22
alberto@jooink.com +AlbertoMancini
Host Application
But it is straightforward to change the behavior
AppWidget appWidget = new AppWidget(OTHER_URL) {
@Override
protected void handleResizeRequest(int width, int height) {
this.setHeight(height + "px"); //keep width 100%;
}
};
appWidget.asWidget().setSize("100%","500px");
this.add(appWidget);
23
alberto@jooink.com +AlbertoMancini
Host Application
Messaging
AppWidget appWidget = new AppWidget(OTHER_URL)
…
appWidget.postMessage("Ciao da GWT (outer)");
..
appWidget.addMessageReceivedHandler( event -> ...);
24
alberto@jooink.com +AlbertoMancini
Guest Application
The Guest Package
…
GuestPackage.get().addStatusChangeHandler(
event -> GWT.log("Guest Status:" + event.getValue()));
GuestPackage.get().init();
…
25
alberto@jooink.com +AlbertoMancini
Guest Application
The Guest Package (in action)
GuestPackage guestPackage = GuestPackage.get();
...
guestPackage.askForFullSize();
...
guestPackage.postMessage("Ciao Host, I’m the Guest");
...
guestPackage.addMessageReceivedHandler(event -> …);
…
26
alberto@jooink.com +AlbertoMancini
Note on JSNI (helpful, Good Old JSNI)
Way simpler than using jsinterop here …
private native MyEventRegistration
addWindowMessageHandler(Consumer<MessageEvent> handler) /*-{
$wnd.addEventListener('message', handler, false);
return {
remove: function () {
$wnd.removeEventListener('message', handler, false);
}
};
}-*/;
27
alberto@jooink.com +AlbertoMancini
DEMO
28
Thanks !!
alberto@jooink.com
+AlbertoMancini
1 of 29

Recommended

Hacktoberfest 2020 - Open source for beginners by
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersDeepikaRana30
333 views31 slides
GerritHub.io - present, past, future by
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, futureLuca Milanesio
8.2K views37 slides
Let's Git Together! - Hacktoberfest 2020 by
Let's Git Together! - Hacktoberfest 2020Let's Git Together! - Hacktoberfest 2020
Let's Git Together! - Hacktoberfest 2020EqraKhattak
84 views7 slides
"Jclays, A global solution for application design and automatic GWT code gene... by
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...GWTcon
1.2K views19 slides
In defense of GWT-RPC By Colin Alworth by
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthGWTcon
1.7K views47 slides
The future of GWT 2.x - By Colin Alworth by
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthGWTcon
3.1K views20 slides

More Related Content

Similar to DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini

DIY: Computer Vision with GWT. by
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.JooinK
1.1K views85 slides
DIY- computer vision with GWT by
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWTFrancesca Tosi
406 views85 slides
DESKTOP GUI APP DEVELOPMENT USING PYTHON! by
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
1.6K views70 slides
DESKTOP GUI APP DEVELOPMENT USING PYTHON! by
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
984 views70 slides
Easing offline web application development with GWT by
Easing offline web application development with GWTEasing offline web application development with GWT
Easing offline web application development with GWTArnaud Tournier
6.3K views36 slides
Droidcon thessaloniki 2015 by
Droidcon thessaloniki 2015Droidcon thessaloniki 2015
Droidcon thessaloniki 2015Raymond Chenon
311 views49 slides

Similar to DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini(20)

DIY: Computer Vision with GWT. by JooinK
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
JooinK1.1K views
DIY- computer vision with GWT by Francesca Tosi
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
Francesca Tosi406 views
DESKTOP GUI APP DEVELOPMENT USING PYTHON! by Umar Yusuf
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
Umar Yusuf1.6K views
DESKTOP GUI APP DEVELOPMENT USING PYTHON! by Umar Yusuf
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
Umar Yusuf984 views
Easing offline web application development with GWT by Arnaud Tournier
Easing offline web application development with GWTEasing offline web application development with GWT
Easing offline web application development with GWT
Arnaud Tournier6.3K views
IOT SOLUTIONS FROM INTEL by onebee kumar
IOT SOLUTIONS FROM INTELIOT SOLUTIONS FROM INTEL
IOT SOLUTIONS FROM INTEL
onebee kumar79 views
Build your first Monster APP by 2600Hz
Build your first Monster APPBuild your first Monster APP
Build your first Monster APP
2600Hz3.6K views
Developing Mobile Application using Phonegap by Fahim Abdullah
Developing Mobile Application using PhonegapDeveloping Mobile Application using Phonegap
Developing Mobile Application using Phonegap
Fahim Abdullah242 views
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5 by Amanda Lam
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Amanda Lam1.6K views
Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016 by Loïc Knuchel
Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016
Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016
Loïc Knuchel705 views
publishing INSPIRE services with deegree by Sebastian Goerke
publishing INSPIRE services with deegreepublishing INSPIRE services with deegree
publishing INSPIRE services with deegree
Sebastian Goerke929 views
Hands On With OpenSocial and Embedded Experiences by Ryan Baxter
Hands On With OpenSocial and Embedded ExperiencesHands On With OpenSocial and Embedded Experiences
Hands On With OpenSocial and Embedded Experiences
Ryan Baxter1.2K views
Android Development with Kotlin, Part 2 - Internet Services and JSON by Andreas Jakl
Android Development with Kotlin, Part 2 - Internet Services and JSONAndroid Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSON
Andreas Jakl733 views

More from GWTcon

"Xapi-lang For declarative code generation" By James Nelson by
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James NelsonGWTcon
833 views23 slides
Unirex Lean tools By Dario Carotenuto by
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoGWTcon
868 views27 slides
Web components with java by Haijian Wang by
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
1.6K views49 slides
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh by
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhUI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhGWTcon
1.6K views22 slides
Best Practices - By Lofi Dewanto by
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoGWTcon
1.2K views32 slides
"Migrate large gwt applications - Lessons Learned" By Harald Pehl by
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald PehlGWTcon
1.9K views42 slides

More from GWTcon (12)

"Xapi-lang For declarative code generation" By James Nelson by GWTcon
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
GWTcon 833 views
Unirex Lean tools By Dario Carotenuto by GWTcon
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario Carotenuto
GWTcon 868 views
Web components with java by Haijian Wang by GWTcon
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
GWTcon 1.6K views
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh by GWTcon
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhUI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
GWTcon 1.6K views
Best Practices - By Lofi Dewanto by GWTcon
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi Dewanto
GWTcon 1.2K views
"Migrate large gwt applications - Lessons Learned" By Harald Pehl by GWTcon
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
GWTcon 1.9K views
GWT Development for Handheld Devices by GWTcon
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld Devices
GWTcon 674 views
GWT vs CSS3 by GWTcon
GWT vs CSS3GWT vs CSS3
GWT vs CSS3
GWTcon 1.2K views
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un... by GWTcon
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
GWTcon 987 views
GWT Web Socket and data serialization by GWTcon
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
GWTcon 6.5K views
GWTcon 2014 - Apertura by GWTcon
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - Apertura
GWTcon 699 views
GWT videocall: power-up your mobile & web app with WebRTC by GWTcon
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTC
GWTcon 1.9K views

Recently uploaded

Voice Logger - Telephony Integration Solution at Aegis by
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at AegisNirmal Sharma
39 views1 slide
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
40 views69 slides
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
280 views86 slides
virtual reality.pptx by
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
14 views15 slides
Vertical User Stories by
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
14 views16 slides
Info Session November 2023.pdf by
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdfAleksandraKoprivica4
13 views15 slides

Recently uploaded(20)

Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker40 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software280 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely25 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10300 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays17 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab21 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views

DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini