SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
Turducken
Divide and conquer large GWT apps with
multiple teams

Rob Keane
Google / Ad Exchange Front End
rkeane@google.com
Turducken
Complex GWT apps can involve multiple teams with
different release cycles. Compile times can quickly
become prohibitive when your codebase grows into
millions of lines.
“Turducken” is a design pattern to combine multiple
GWT apps that can be built and released by separate
teams while providing a seamless, snappy user
experience
A note on the name...

Turkey + Duck + Chicken
For this...

...not this
Large projects
Multiple...
teams?
release cycles?
testers?
frameworks?
Terminology
In the context of this talk...

Module == GWT Module with entry point
One last note...
This is a design pattern not a library
Turducken
1. Bob’s Sticker Emporium
2. Conquering Multiple Entry Points
3. Other uses
Bob’s GWT App
Bob has a sticker site
bobs-sticker-emporium.com

BOB’S STICKERS
Stickers

BUY!

BUY!

BUY!
Success!
Bob adds more options...
bobs-sticker-emporium.com

Your Cart (2)

BOB’S STICKERS
Stickers

Create your own!

BUY!
Customize

BUY!
Customize

Sell a sticker!

BUY!
Customize
Things are getting complex
➔ Still one giant GWT module
➔ Compilation takes several minutes
➔ A few megabytes of JS
➔ 5 teams!
➔ Continuous integration
➔ Release coordination
What should Bob do?
How do you split up a large GWT project?
One GWT module
× One release
× One build
× Very large if code isn’t split properly
× Difficult to test
Many GWT modules
× Full page reloads
× Code can’t be split between modules
One GWT module?

ಠ_ಠ

Many GWT modules?

ಠ_ಠ
Ultimately multiple GWT modules
is the only real option
Multiple modules
Split into multiple GWT entry points
bobs-sticker-emporium.com

Your Cart (2)

BOB’S STICKERS
Stickers

Create your own!

BUY!
Customize

BUY!
Customize

Sell a sticker!

BUY!
Customize
Bob

Full page refresh
between each module
Research showed that

half of aggregate user latency
was due to full page reloads
Turducken
1. Bob’s Sticker Emporium
2. Conquering Multiple Entry Points
3. Other uses
Container (GWT Module)
Inter-app Event Bus (JSNI)
Virtual
historian

Virtual
historian

Virtual
historian

Tab A

Tab B

Tab C

(GWT)

(GWT)

(GWT)
The container
➔
➔
➔
➔

A GWT module (mostly)
The first thing to load on the page
Loads the other modules on demand
Communicates with modules through
inter-app event bus
Loading all of the modules?

Yes.
This actually works
Bob’s container
bobs-sticker-emporium.com

Your Cart (2)

BOB’S STICKERS
Stickers

Create your own!

Sell a sticker!

BUY!
Load multiple GWT modules?
➔ When a module is loaded, a <script> tag is added to
the <head>
➔ Everything lives in the same container
Memory usage
➔ Browsers are good at hiding elements
➔ Memory only increases marginally when
loading new modules
DOM Assumptions
// Old
RootPanel.get().add(myRootWidget);

// New
ContainerHelper.getModulePanel().add(myRootWidget);

<body>
<div id=”modules”>
<div id=”TAB_1_ROOT”>...</div>
<div id=”TAB_2_ROOT” style=”display:none”>...</div>
<div id=”TAB_3_ROOT” style=”display:none”>...</div>
</div>
</body>
CSS
➔ Avoid @external as much as possible
➔ Avoid styling tags
... unless the style is truly global
➔ Should be in a “global” CSS file
> global.css
a {
color: #999;
}
But I really want @external CSS...
When Module “TAB_1” is loaded →

When Module “TAB_2” is loaded
→
CSS example
/* no, no, no */
@external .title;
.title {
color: pink;
font-size: 72px;
}

/* that’s better */
@external .title;
#TAB_1 .title {
color: pink;
font-size: 72px;
}
There’s just one tiny, little issue...
“

All problems in computer
science can be solved by
another level of indirection

Butler Lampson
Container (GWT Module)
Inter-app Event Bus (JSNI)
Virtual
historian

Virtual
historian

Virtual
historian

Tab A

Tab B

Tab C

(GWT)

(GWT)

(GWT)
Virtual History Implementation
An history implementation that doesn’t alter
the “real” URL but instead sends an event
Container History
Produces a “safe” URL that contains
information about the module
For example:
#MODULE_A/MyPlace
instead of
#MyPlace
Container (GWT Module)
Inter-app Event Bus (JSNI)
Virtual
historian

Virtual
historian

Virtual
historian

Tab A

Tab B

Tab C

(GWT)

(GWT)

(GWT)
Event bus implementation
The event bus that broadcasts between
modules needs to be JSNI since it must
communicate between GWT modules
A simple publish/subscribe interface will do
Code example
// Container
InterAppEventBus.subscribe(“HISTORY_CHANGE”, updateUrlHandler);
// Virtual History in a submodule
InterAppEventBus.publish(“HISTORY_CHANGE”, “myNewUrl”);
Message trace for history
Virtual Historian

Event bus

Container

Browser

Change to virtual history

Module load event

Real URL is changed
Summary of Turducken
➔ Separate your app into multiple entry points
➔ A container module manages loading the
submodules
➔ Carefully manage your CSS
➔ The submodules talk to a virtual historian
➔ A JavaScript/JSNI InterAppEventBus handles
events between modules and the container
➔ Events are broadcast that the container handles
to alter the real URL
The future
➔ Shadow DOM eliminates a lot of the issues
➔ Eliminate JSNI with GWT 3.0
But wait!
There’s more.
Turducken
1. Bob’s Sticker Emporium
2. Conquering Multiple Entry Points
3. Other uses
It’s all about the event bus
An inter-app event bus opens up some
interesting doors
Inter-app communication
Load another module via an event
➔ Settings Module
◆ Change settings from other modules
◆ Global “Accept ToS” message

➔ Chat module
Example
➔ One team maintains “Chat” functionality
➔ Another team maintains a “Profile” page
➔ Launch a chat with a person from their
profile
➔ Chat module doesn’t always need to be
loaded
➔ Limited coupling between modules
Invisible Modules
There can be “background” modules that
aren’t visible but handle events
➔ Monitoring session
➔ Caching data for multiple modules
Non-GWT “modules”
➔ Follow the same CSS approach
➔ Write an virtual history implementation
➔ Add hashPrefix to $location in Angular
Where’s the code?
➔ A few small parts
➔ A design pattern, not a library
➔ Tends to be application specific
...but we are considering it
Turducken
Complex GWT apps can involve multiple teams with
different release cycles. Compile times can quickly
become prohibitive when your codebase grows into
millions of lines.
“Turducken” is a design pattern to combine multiple
GWT apps that can be built and released by separate
teams while providing a seamless, snappy user
experience
no reloads
many modules

wow

such performance
different releases

wow

Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
The kvm virtualization way
The kvm virtualization wayThe kvm virtualization way
The kvm virtualization way
 
Federation & Access Management
Federation & Access ManagementFederation & Access Management
Federation & Access Management
 
Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid  Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid
 
Vertex AI - Unified ML Platform for the entire AI workflow on Google Cloud
Vertex AI - Unified ML Platform for the entire AI workflow on Google CloudVertex AI - Unified ML Platform for the entire AI workflow on Google Cloud
Vertex AI - Unified ML Platform for the entire AI workflow on Google Cloud
 
Apache CloudStack from API to UI
Apache CloudStack from API to UIApache CloudStack from API to UI
Apache CloudStack from API to UI
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Building and deploying to an AKS cluster using Terraform and Azure DevOps wit...
Building and deploying to an AKS cluster using Terraform and Azure DevOps wit...Building and deploying to an AKS cluster using Terraform and Azure DevOps wit...
Building and deploying to an AKS cluster using Terraform and Azure DevOps wit...
 
Zero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with KubernetesZero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with Kubernetes
 
Kubernetes Networking 101
Kubernetes Networking 101Kubernetes Networking 101
Kubernetes Networking 101
 
AWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultAWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp Vault
 
Azure container instances
Azure container instancesAzure container instances
Azure container instances
 
Hadoop yarn 基本架构和发展趋势
Hadoop yarn 基本架构和发展趋势Hadoop yarn 基本架构和发展趋势
Hadoop yarn 基本架构和发展趋势
 
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
 
Prometheus course
Prometheus coursePrometheus course
Prometheus course
 
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
 
OpenStack vs VMware vCloud
OpenStack vs VMware vCloudOpenStack vs VMware vCloud
OpenStack vs VMware vCloud
 
Oracle Fusion Applications 101
Oracle Fusion Applications 101Oracle Fusion Applications 101
Oracle Fusion Applications 101
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
[오픈소스컨설팅]Atlassian Confluence User Guide_Full
[오픈소스컨설팅]Atlassian Confluence User Guide_Full[오픈소스컨설팅]Atlassian Confluence User Guide_Full
[오픈소스컨설팅]Atlassian Confluence User Guide_Full
 

Ähnlich wie Turducken - Divide and Conquer large GWT apps with multiple teams

DevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoDevHub 3 - Composer plus Magento
DevHub 3 - Composer plus Magento
Magento Dev
 
Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practices
eleksdev
 

Ähnlich wie Turducken - Divide and Conquer large GWT apps with multiple teams (20)

Create a module bundler from scratch
Create a module bundler from scratchCreate a module bundler from scratch
Create a module bundler from scratch
 
Marionette - TorontoJS
Marionette - TorontoJSMarionette - TorontoJS
Marionette - TorontoJS
 
GWT widget development
GWT widget developmentGWT widget development
GWT widget development
 
DevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoDevHub 3 - Composer plus Magento
DevHub 3 - Composer plus Magento
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practices
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
 
Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform)
Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform)Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform)
Why I ❤️ Kotlin Multiplatform (and want YOU to also ❤️ Kotlin Multiplatform)
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
Using Features
Using FeaturesUsing Features
Using Features
 
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Advanced Configuration Management with Config Split et al.
Advanced Configuration Management with Config Split et al.Advanced Configuration Management with Config Split et al.
Advanced Configuration Management with Config Split et al.
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern development
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Turducken - Divide and Conquer large GWT apps with multiple teams