Rich HTML5 Web Apps: Typesafe Edition

C
Rich HTML5 Web Apps:
Typesafe Edition

Christian Sadilek (@csadilek)
Jonathan Fuerth (@jfuerth)
JBoss / Red Hat
RIP
Java™ Programming Language
1995-2009

Photo by: Crismatos From: Flickr
RIP
Google Web Toolkit
2006-2011

Photo by: Crismatos From: Flickr
RIP
JBoss Errai Framework
2010-2013

Photo by: Crismatos From: Flickr
The rumors of my
demise are greatly
exaggerated!
1. WHY YOUR JOB IS HARD
LARGE DEVELOPMENT TEAMS
MAKE THINGS HARD
Who is working on what?
Skill-segregation causes duplicate work.
Code rots over time.
LARGE OR COMPLEX CODE BASES
MAKE THINGS HARD
Where is code actually used?
What can safely be changed?
Code rots over time.
LARGE CUSTOMERS
MAKE THINGS HARD
Requests big changes frequently.
Want mobile NOW.
Want super-high performance NOW.
2. HOW ERRAI HELPS
USE THE BEST TOOLS AND
STANDARDS
HTML5 and CSS for layout
Java for enterprise development
JavaScript for the nitty-gritty
SHARE CODE EFFECTIVELY
Don’t repeat yourself
Don’t clone other people’s code
Share data model and validation logic
BUST THAT BOILERPLATE!!!
Declarative, simple code
A little goes a long way
Less code == more time
Rich HTML5 Web Apps: Typesafe Edition
#JavaStillWins

Typesafe language
Refactoring
Code analysis
Extremely testable
Experienced people with the right skills
3. ERRAI CORE CONCEPTS
HTML5 TEMPLATING
Use HTML5/CSS templates directly from the designer or
brand team.
<!DOCTYPE html>
<link href="css/bootstrap.css" rel="stylesheet">
<form id="app-template">
<input id="name" type="text" placeholder="Full Name">
<input id="email" type="text" placeholder="you@example.com">
<textarea id="text" rows="10"></textarea>
<button id="submit">Submit</button>
</form>

...and just attach it!
@Templated
public class ComplaintForm extends Composite {
@Inject @DataField
private TextBox name;
...
}
NAVIGATION AND BOOKMARKING
Declare a page:
@Page
@Templated
public class ComplaintForm extends Composite {
...
}

And navigate:
@Page
public class WelcomePage extends Composite {
@Inject
private TransitionTo<ComplaintForm> complaintForm;
@EventHandler
private void onComplaint(ClickEvent e) {
complaintForm.go();
}
}
TWO-WAY DATA BINDING
Remove boilerplate code and bring forms to life with
a few simple annotations.
@Templated
public class ComplaintForm extends Composite {
@Inject @Model private UserComplaint model;
@Inject
@Inject
@Inject
@Inject
}

@Bound @DataField private
@Bound @DataField private
@Bound @DataField private
@DataField private Button

TextBox name;
TextBox email;
TextArea complaint;
submit;
TYPESAFE DISTRIBUTED EVENTS
Injecting
@Inject
private Event<Document> updatedDocEvent;

firing
updatedDocEvent.fire(document);

and observing events
public void onUpdatedDocument(@Observes Document doc) {
}
TYPESAFE RPC AND REST
Simple and powerful to set up, leaving a foundation
of confidence to refactor, test, and maintain.
@Inject
private Caller<UserComplaintEndpoint> endpoint;

...and with the bound model:
endpoint.call().create(model);
JPA, OFFLINE MODE AND DATA SYNC
Stay connected, even when you can’t. Satisfy rising
demands for online collaboration.
@Inject
private EntityManager entityManager;
@Inject
private ClientSyncManager syncManager;
GO MOBILE NOW!
Use native Android, iPhone, and BlackBerry features.
@Inject
private Camera camera;

public void onBatteryLow(@Observes BatteryLowEvent e) {
}
THE BIG INSPIRATIONAL DEMO!
THE END?

THE BEGINNING - OF YOUR ADVENTURE WITH ERRAI!
Get in touch!
Website: http://jboss.org/errai
IRC: #errai on freenode
Twitter: @jbosserrai

We ❤ Pull Requests

Photo by: CHIN.DENG
From: Flickr

http://github.com/errai
QUESTIONS?
1 of 27

Recommended

Add profile to project v2 by
Add profile to project v2Add profile to project v2
Add profile to project v2Shayna Bentkover
219 views6 slides
Introduction to Delve and Office Graph by
Introduction to Delve and Office GraphIntroduction to Delve and Office Graph
Introduction to Delve and Office GraphKanwal Khipple
1.4K views47 slides
Ppt to Website by
Ppt to WebsitePpt to Website
Ppt to WebsiteNoemi Longjas-Ampong
94 views25 slides
How to use projeqt--my final presentation by
How to use projeqt--my final presentationHow to use projeqt--my final presentation
How to use projeqt--my final presentationalliek5
223 views7 slides
.How to Use Projeqt--my final by
.How to Use Projeqt--my final .How to Use Projeqt--my final
.How to Use Projeqt--my final alliek5
2.5K views7 slides
Azure Mobile Services with Xamarin.Forms by
Azure Mobile Services with Xamarin.FormsAzure Mobile Services with Xamarin.Forms
Azure Mobile Services with Xamarin.FormsCheah Eng Soon
322 views10 slides

More Related Content

Similar to Rich HTML5 Web Apps: Typesafe Edition

Daniel Egan Msdn Tech Days Oc Day2 by
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan
682 views49 slides
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl by
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And DxlBp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxldominion
605 views23 slides
Silverlight 2 for Developers - TechEd New Zealand 2008 by
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Jonas Follesø
7.1K views51 slides
Building Data Centric Apps in WPF by
Building Data Centric Apps in WPFBuilding Data Centric Apps in WPF
Building Data Centric Apps in WPFFrank La Vigne
734 views36 slides
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins by
Hnd201 Building Ibm Lotus Domino Applications With Ajax PluginsHnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
Hnd201 Building Ibm Lotus Domino Applications With Ajax Pluginsdominion
605 views18 slides
Moving from Web 1.0 to Web 2.0 by
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Estelle Weyl
1.7K views42 slides

Similar to Rich HTML5 Web Apps: Typesafe Edition(20)

Daniel Egan Msdn Tech Days Oc Day2 by Daniel Egan
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan682 views
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl by dominion
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And DxlBp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
dominion605 views
Silverlight 2 for Developers - TechEd New Zealand 2008 by Jonas Follesø
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø7.1K views
Building Data Centric Apps in WPF by Frank La Vigne
Building Data Centric Apps in WPFBuilding Data Centric Apps in WPF
Building Data Centric Apps in WPF
Frank La Vigne734 views
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins by dominion
Hnd201 Building Ibm Lotus Domino Applications With Ajax PluginsHnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
dominion605 views
Moving from Web 1.0 to Web 2.0 by Estelle Weyl
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
Estelle Weyl1.7K views
WebMatrix, see what the matrix can do for you!! by Frédéric Harper
WebMatrix, see what the matrix can do for you!!WebMatrix, see what the matrix can do for you!!
WebMatrix, see what the matrix can do for you!!
Frédéric Harper1.7K views
WordPress in the Enterprise, WordCampUK 2011 by johnthegeo
WordPress in the Enterprise, WordCampUK 2011WordPress in the Enterprise, WordCampUK 2011
WordPress in the Enterprise, WordCampUK 2011
johnthegeo745 views
Serverless Finland Meetup 16.11.2016: Messenger Bot Workshop by Mikael Puittinen
Serverless Finland Meetup 16.11.2016: Messenger Bot WorkshopServerless Finland Meetup 16.11.2016: Messenger Bot Workshop
Serverless Finland Meetup 16.11.2016: Messenger Bot Workshop
Mikael Puittinen3.7K views
Beyond the Browser: Widgets and Rich Internet/Desktop Applications (RIDAs) by hiddenreflex
Beyond the Browser: Widgets and Rich Internet/Desktop Applications (RIDAs)Beyond the Browser: Widgets and Rich Internet/Desktop Applications (RIDAs)
Beyond the Browser: Widgets and Rich Internet/Desktop Applications (RIDAs)
hiddenreflex1.9K views
Getting the Most out of Data Page and Rich Data Definition in Portlet Factory by Davalen LLC
Getting the Most out of Data Page and Rich Data Definition in Portlet FactoryGetting the Most out of Data Page and Rich Data Definition in Portlet Factory
Getting the Most out of Data Page and Rich Data Definition in Portlet Factory
Davalen LLC2K views
iWeb NJECC June 28, 2011 DAndrea by D'Andrea
iWeb NJECC June 28, 2011 DAndreaiWeb NJECC June 28, 2011 DAndrea
iWeb NJECC June 28, 2011 DAndrea
D'Andrea332 views
Building Social Enterprise with Ruby and Salesforce by Raymond Gao
Building Social Enterprise with Ruby and SalesforceBuilding Social Enterprise with Ruby and Salesforce
Building Social Enterprise with Ruby and Salesforce
Raymond Gao1.6K views
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0 by Thomas Conté
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
Thomas Conté1.3K views
Practical Field Experience: Using Ajax / Dojo with WebSphere Portlet Factory by Davalen LLC
Practical Field Experience: Using Ajax / Dojo with WebSphere Portlet FactoryPractical Field Experience: Using Ajax / Dojo with WebSphere Portlet Factory
Practical Field Experience: Using Ajax / Dojo with WebSphere Portlet Factory
Davalen LLC1.2K views
JavaScript and DOM Pattern Implementation by davejohnson
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementation
davejohnson2.1K views
Getting Started in Custom Programming for Talent Sourcing by Glenn Gutmacher
Getting Started in Custom Programming for Talent SourcingGetting Started in Custom Programming for Talent Sourcing
Getting Started in Custom Programming for Talent Sourcing
Glenn Gutmacher447 views

Recently uploaded

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
56 views34 slides
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...ShapeBlue
63 views13 slides
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
29 views38 slides
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlueShapeBlue
50 views23 slides
Data Integrity for Banking and Financial Services by
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial ServicesPrecisely
56 views26 slides
The Research Portal of Catalonia: Growing more (information) & more (services) by
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)CSUC - Consorci de Serveis Universitaris de Catalunya
136 views25 slides

Recently uploaded(20)

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue56 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue63 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro29 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue50 views
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
Precisely56 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue96 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue96 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman40 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue62 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue91 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue74 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
DianaGray10369 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 Software344 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu141 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc77 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue111 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue145 views

Rich HTML5 Web Apps: Typesafe Edition

  • 1. Rich HTML5 Web Apps: Typesafe Edition Christian Sadilek (@csadilek) Jonathan Fuerth (@jfuerth) JBoss / Red Hat
  • 3. RIP Google Web Toolkit 2006-2011 Photo by: Crismatos From: Flickr
  • 4. RIP JBoss Errai Framework 2010-2013 Photo by: Crismatos From: Flickr
  • 5. The rumors of my demise are greatly exaggerated!
  • 6. 1. WHY YOUR JOB IS HARD
  • 7. LARGE DEVELOPMENT TEAMS MAKE THINGS HARD Who is working on what? Skill-segregation causes duplicate work. Code rots over time.
  • 8. LARGE OR COMPLEX CODE BASES MAKE THINGS HARD Where is code actually used? What can safely be changed? Code rots over time.
  • 9. LARGE CUSTOMERS MAKE THINGS HARD Requests big changes frequently. Want mobile NOW. Want super-high performance NOW.
  • 10. 2. HOW ERRAI HELPS
  • 11. USE THE BEST TOOLS AND STANDARDS HTML5 and CSS for layout Java for enterprise development JavaScript for the nitty-gritty
  • 12. SHARE CODE EFFECTIVELY Don’t repeat yourself Don’t clone other people’s code Share data model and validation logic
  • 13. BUST THAT BOILERPLATE!!! Declarative, simple code A little goes a long way Less code == more time
  • 15. #JavaStillWins Typesafe language Refactoring Code analysis Extremely testable Experienced people with the right skills
  • 16. 3. ERRAI CORE CONCEPTS
  • 17. HTML5 TEMPLATING Use HTML5/CSS templates directly from the designer or brand team. <!DOCTYPE html> <link href="css/bootstrap.css" rel="stylesheet"> <form id="app-template"> <input id="name" type="text" placeholder="Full Name"> <input id="email" type="text" placeholder="you@example.com"> <textarea id="text" rows="10"></textarea> <button id="submit">Submit</button> </form> ...and just attach it! @Templated public class ComplaintForm extends Composite { @Inject @DataField private TextBox name; ... }
  • 18. NAVIGATION AND BOOKMARKING Declare a page: @Page @Templated public class ComplaintForm extends Composite { ... } And navigate: @Page public class WelcomePage extends Composite { @Inject private TransitionTo<ComplaintForm> complaintForm; @EventHandler private void onComplaint(ClickEvent e) { complaintForm.go(); } }
  • 19. TWO-WAY DATA BINDING Remove boilerplate code and bring forms to life with a few simple annotations. @Templated public class ComplaintForm extends Composite { @Inject @Model private UserComplaint model; @Inject @Inject @Inject @Inject } @Bound @DataField private @Bound @DataField private @Bound @DataField private @DataField private Button TextBox name; TextBox email; TextArea complaint; submit;
  • 20. TYPESAFE DISTRIBUTED EVENTS Injecting @Inject private Event<Document> updatedDocEvent; firing updatedDocEvent.fire(document); and observing events public void onUpdatedDocument(@Observes Document doc) { }
  • 21. TYPESAFE RPC AND REST Simple and powerful to set up, leaving a foundation of confidence to refactor, test, and maintain. @Inject private Caller<UserComplaintEndpoint> endpoint; ...and with the bound model: endpoint.call().create(model);
  • 22. JPA, OFFLINE MODE AND DATA SYNC Stay connected, even when you can’t. Satisfy rising demands for online collaboration. @Inject private EntityManager entityManager; @Inject private ClientSyncManager syncManager;
  • 23. GO MOBILE NOW! Use native Android, iPhone, and BlackBerry features. @Inject private Camera camera; public void onBatteryLow(@Observes BatteryLowEvent e) { }
  • 25. THE END? THE BEGINNING - OF YOUR ADVENTURE WITH ERRAI!
  • 26. Get in touch! Website: http://jboss.org/errai IRC: #errai on freenode Twitter: @jbosserrai We ❤ Pull Requests Photo by: CHIN.DENG From: Flickr http://github.com/errai