SlideShare a Scribd company logo
1 of 38
Download to read offline
HOW TO IMPROVE
YOUR PRODUCTIVITY
USING GWTP
CHRISTIAN GOUDREAU
GWT.create 2015
Motivations
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ Scalability
➔ Maintainability
➔ Extensibility
Architecture
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ SOLID - Uncle Bob
➔ MVP - Martin Fowler
➔ Iterative and incremental
development - Craig
Larman
THERE’S JUST
TOO MANY
GOOD PRACTICES
Frontend
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ GWTP
➔ REST-Dispatch
➔ GSS
MODEL
PRESENTER
VIEW
MVP
PATTERN
Presenter
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public class ApplicationPresenter
extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy> {
interface MyView extends View {
}
@ProxyStandard
interface MyProxy extends Proxy<ApplicationPresenter> {
}
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_MAIN = new Type<RevealContentHandler<?>>();
@Inject
ApplicationPresenter(EventBus eventBus,
MyView view,
MyProxy proxy) {
super(eventBus, view, proxy, RevealType.RootLayout);
}
@Override
protected void onReveal() {
}
@Override
protected void onBind() {
}
}
View
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public class ApplicationView extends ViewImpl implements ApplicationPresenter.MyView {
interface Binder extends UiBinder<Widget, ApplicationView> {
}
@UiField
SimplePanel main;
@Inject
ApplicationView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
}
@Override
public void setInSlot(Object slot, IsWidget content) {
if (slot == ApplicationPresenter.SLOT_MAIN) {
main.setWidget(content);
}
}
}
Model
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public class Dashboard {
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
GWTP
Lifecycle
Tips
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ Use UiHandlers
➔ Use the EventBus
➔ Use collaborators
UiHandlers and Presenter
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public interface FeedbackUiHandlers extends UiHandlers {
void performMail(Feedback currentFeedback);
}
public class FeedbackPresenter
extends Presenter<FeedbackPresenter.MyView, FeedbackPresenter.MyProxy>
implements FeedbackUiHandlers {
...
@Inject
FeedbackPresenter(...) {
super(...);
getView().setUiHandlers(this);
}
@Override
public void performMail(Feedback currentFeedback) {
...
}
}
View
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public class FeedbackView
extends ViewWithUiHandlers<FeedbackUiHandlers>
implements FeedbackPresenter.MyView {
...
@UiHandler("submit")
void onClick(ClickEvent e) {
getUiHandlers().performMail(feedback);
}
}
EventBus
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
@Override
protected void onReveal() {
themeService.withCallback(new AbstractAsyncCallback<Theme>() {
@Override
public void onSuccess(Theme result) {
super.onSuccess(result);
getView().edit(result);
}
}).getByOrganizationId(currentUser.getOrganizationId());
UpdateBreadcrumbEvent.fire(this, breadcrumbBuilder.theme());
}
Collaborators
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public interface LocationFacade {
/**
* Adds a new browser history entry. Calling this method will cause
* {@link com.google.gwt.event.logical.shared.ValueChangeHandler
* #onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
* to be called as well if and only if issueEvent is true.
*
* @param historyToken the token to associate with the new history item
* @param issueEvent true if a
* {@link com.google.gwt.event.logical.shared.ValueChangeHandler
* #onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
* event should be issued
*/
void newItem(String historyToken, boolean issueEvent);
/**
* Reloads the current browser window. All GWT state will be lost.
*/
void reload();
String getCurrentHash();
}
public class LocationFacadeImpl implements LocationFacade {
@Override
public void newItem(String newUrl, boolean fireEvent) {
History.newItem(newUrl, fireEvent);
}
@Override
public native void reload() /*-{
$wnd.location.reload(true);
}-*/;
@Override
public String getCurrentHash() {
return Location.getHash();
}
}
REST
Dispatch
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ JAX-RS
➔ Command pattern
➔ Simplest implementation
REST
Dispatch
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ JAX-RS
➔ Command pattern
➔ Simplest implementation
Bonus
➔ Response - RestCallback
➔ GWTP-Extensions - Rest-
delegates
Downside - not type safe
REST Dispatch setup
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
public class ServiceModule extends AbstractGinModule {
@Override
protected void configure() {
install(new RestDispatchAsyncModule.Builder().build());
}
@Provides
@RestApplicationPath
String getApplicationPath() {
String baseUrl = GWT.getHostPageBaseURL();
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
}
return baseUrl + API;
}
}
<inherits name="com.gwtplatform.dispatch.rest.delegates.ResourceDelegate"/>
<inherits name='com.gwtplatform.mvp.MvpWithEntryPoint'/>
REST Dispatch usage
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
@Path(DASHBOARDS)
public interface DashboardService {
@GET
@Path(DASHBOARD)
Dashboard getByOrganizationId(@PathParam(ORGANIZATION_ID) int organizationId);
@PUT
@Path(DASHBOARD)
void update(@PathParam(ORGANIZATION_ID) int organizationId, Dashboard dashboard);
}
private void loadTemplate() {
dashboardService.withCallback(new AbstractAsyncCallback<Dashboard>() {
@Override
public void onSuccess(Dashboard result) {
setInSlot(SLOT_TEMPLATE, templateSelector.createTemplate(result));
}
}).getByOrganizationId(currentUser.getOrganizationId());
}
UIDesign
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ GSS + GSSS
➔ UiBinder
➔ CSS expert
GSS + GSSS
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
@Source({"com/arcbees/gsss/mixin/client/mixins.gss", "css/colors.gss", "fonts/geometria/geometria.gss", "css/style.gss"})
Style style();
@Source({"com/arcbees/website/client/resources/css/gridSettings.gss", "com/arcbees/gsss/grid/client/grid.gss"})
GridResources.Grid grid();
http://dev.arcbees.com/gsss/mixins/
@require "colors";
@require "geometria";
@require "gsss-mixins";
* {
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
@media (max-width: 979px) {
html {
font-size: 59%;
}
}
.selectedFile {
background-color: C_PRIMARY;
color: #fff;
display: inline-block;
padding: .5rem .5rem .5rem 1rem;
@mixin rounded(4px);
}
What’s next?
HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
➔ Full JAX-RS coverage
➔ XML and custom
serializers/deserializers
➔ New way of writing Presenters
➔ Generator rewrite for extensibility
➔ Pushstate
https://docs.google.com/a/arcbees.com/document/d/1N9dMDxTFmZzF3xNTpnP3HIuwZC9OGtPPm_QVEikMP4g/
@Presenter(token = HOME, for = MyView.class, slot = ApplicationPresenter.SLOT_MAIN)
@UseCodeSplit
@UseGatekeeper(AclGatekeeper.class)
@GatekeeperParams(ORGANIZATION_SETTINGS_DASHBOARD_READ)
public class DashboardPresenter {
interface MyView extends View {
}
@Inject
DashboardPresenter() {
}
@OnReveal
void onReveal() {
}
@OnBind
void onBind() {
}
...
}
THANK YOU
Christian Goudreau
Co-Founder and Bee-EO
at Arcbees
+ChristianGoudreau
@imchrisgoudreau
QUESTIONS ?

More Related Content

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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 businesspanagenda
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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 FMESafe Software
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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 Takeoffsammart93
 
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...DianaGray10
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
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 TerraformAndrey Devyatkin
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
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...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

How to improve your productivity using GWTP

  • 1. HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP CHRISTIAN GOUDREAU GWT.create 2015
  • 2. Motivations HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ Scalability ➔ Maintainability ➔ Extensibility
  • 3. Architecture HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ SOLID - Uncle Bob ➔ MVP - Martin Fowler ➔ Iterative and incremental development - Craig Larman
  • 5. Frontend HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ GWTP ➔ REST-Dispatch ➔ GSS
  • 7. Presenter HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 8. public class ApplicationPresenter extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy> { interface MyView extends View { } @ProxyStandard interface MyProxy extends Proxy<ApplicationPresenter> { } @ContentSlot public static final Type<RevealContentHandler<?>> SLOT_MAIN = new Type<RevealContentHandler<?>>(); @Inject ApplicationPresenter(EventBus eventBus, MyView view, MyProxy proxy) { super(eventBus, view, proxy, RevealType.RootLayout); } @Override protected void onReveal() { } @Override protected void onBind() { } }
  • 9. View HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 10. public class ApplicationView extends ViewImpl implements ApplicationPresenter.MyView { interface Binder extends UiBinder<Widget, ApplicationView> { } @UiField SimplePanel main; @Inject ApplicationView(Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); } @Override public void setInSlot(Object slot, IsWidget content) { if (slot == ApplicationPresenter.SLOT_MAIN) { main.setWidget(content); } } }
  • 11. Model HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 12. public class Dashboard { private int id; public int getId() { return id; } public void setId(int id) { this.id = id; } }
  • 14. Tips HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ Use UiHandlers ➔ Use the EventBus ➔ Use collaborators
  • 15. UiHandlers and Presenter HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 16. public interface FeedbackUiHandlers extends UiHandlers { void performMail(Feedback currentFeedback); } public class FeedbackPresenter extends Presenter<FeedbackPresenter.MyView, FeedbackPresenter.MyProxy> implements FeedbackUiHandlers { ... @Inject FeedbackPresenter(...) { super(...); getView().setUiHandlers(this); } @Override public void performMail(Feedback currentFeedback) { ... } }
  • 17. View HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 18. public class FeedbackView extends ViewWithUiHandlers<FeedbackUiHandlers> implements FeedbackPresenter.MyView { ... @UiHandler("submit") void onClick(ClickEvent e) { getUiHandlers().performMail(feedback); } }
  • 19. EventBus HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 20. @Override protected void onReveal() { themeService.withCallback(new AbstractAsyncCallback<Theme>() { @Override public void onSuccess(Theme result) { super.onSuccess(result); getView().edit(result); } }).getByOrganizationId(currentUser.getOrganizationId()); UpdateBreadcrumbEvent.fire(this, breadcrumbBuilder.theme()); }
  • 21. Collaborators HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 22. public interface LocationFacade { /** * Adds a new browser history entry. Calling this method will cause * {@link com.google.gwt.event.logical.shared.ValueChangeHandler * #onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)} * to be called as well if and only if issueEvent is true. * * @param historyToken the token to associate with the new history item * @param issueEvent true if a * {@link com.google.gwt.event.logical.shared.ValueChangeHandler * #onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)} * event should be issued */ void newItem(String historyToken, boolean issueEvent); /** * Reloads the current browser window. All GWT state will be lost. */ void reload(); String getCurrentHash(); }
  • 23. public class LocationFacadeImpl implements LocationFacade { @Override public void newItem(String newUrl, boolean fireEvent) { History.newItem(newUrl, fireEvent); } @Override public native void reload() /*-{ $wnd.location.reload(true); }-*/; @Override public String getCurrentHash() { return Location.getHash(); } }
  • 24. REST Dispatch HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ JAX-RS ➔ Command pattern ➔ Simplest implementation
  • 25. REST Dispatch HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ JAX-RS ➔ Command pattern ➔ Simplest implementation Bonus ➔ Response - RestCallback ➔ GWTP-Extensions - Rest- delegates Downside - not type safe
  • 26. REST Dispatch setup HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 27. public class ServiceModule extends AbstractGinModule { @Override protected void configure() { install(new RestDispatchAsyncModule.Builder().build()); } @Provides @RestApplicationPath String getApplicationPath() { String baseUrl = GWT.getHostPageBaseURL(); if (baseUrl.endsWith("/")) { baseUrl = baseUrl.substring(0, baseUrl.length() - 1); } return baseUrl + API; } } <inherits name="com.gwtplatform.dispatch.rest.delegates.ResourceDelegate"/> <inherits name='com.gwtplatform.mvp.MvpWithEntryPoint'/>
  • 28. REST Dispatch usage HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 29. @Path(DASHBOARDS) public interface DashboardService { @GET @Path(DASHBOARD) Dashboard getByOrganizationId(@PathParam(ORGANIZATION_ID) int organizationId); @PUT @Path(DASHBOARD) void update(@PathParam(ORGANIZATION_ID) int organizationId, Dashboard dashboard); } private void loadTemplate() { dashboardService.withCallback(new AbstractAsyncCallback<Dashboard>() { @Override public void onSuccess(Dashboard result) { setInSlot(SLOT_TEMPLATE, templateSelector.createTemplate(result)); } }).getByOrganizationId(currentUser.getOrganizationId()); }
  • 30. UIDesign HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ GSS + GSSS ➔ UiBinder ➔ CSS expert
  • 31. GSS + GSSS HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP
  • 32. @Source({"com/arcbees/gsss/mixin/client/mixins.gss", "css/colors.gss", "fonts/geometria/geometria.gss", "css/style.gss"}) Style style(); @Source({"com/arcbees/website/client/resources/css/gridSettings.gss", "com/arcbees/gsss/grid/client/grid.gss"}) GridResources.Grid grid(); http://dev.arcbees.com/gsss/mixins/
  • 33. @require "colors"; @require "geometria"; @require "gsss-mixins"; * { box-sizing: border-box; } html { font-size: 62.5%; } @media (max-width: 979px) { html { font-size: 59%; } } .selectedFile { background-color: C_PRIMARY; color: #fff; display: inline-block; padding: .5rem .5rem .5rem 1rem; @mixin rounded(4px); }
  • 34. What’s next? HOW TO IMPROVE YOUR PRODUCTIVITY USING GWTP ➔ Full JAX-RS coverage ➔ XML and custom serializers/deserializers ➔ New way of writing Presenters ➔ Generator rewrite for extensibility ➔ Pushstate https://docs.google.com/a/arcbees.com/document/d/1N9dMDxTFmZzF3xNTpnP3HIuwZC9OGtPPm_QVEikMP4g/
  • 35. @Presenter(token = HOME, for = MyView.class, slot = ApplicationPresenter.SLOT_MAIN) @UseCodeSplit @UseGatekeeper(AclGatekeeper.class) @GatekeeperParams(ORGANIZATION_SETTINGS_DASHBOARD_READ) public class DashboardPresenter { interface MyView extends View { } @Inject DashboardPresenter() { } @OnReveal void onReveal() { } @OnBind void onBind() { } ... }
  • 37. Christian Goudreau Co-Founder and Bee-EO at Arcbees +ChristianGoudreau @imchrisgoudreau