SlideShare a Scribd company logo
1 of 55
Download to read offline
HENDRIK EBBERS 
JAVAFX ENTERPRISE 
Do they match?
ABOUT ME 
• Hendrik Ebbers 
! 
• Senior Java Architect @ Canoo Engineering AG 
• Lead of JUG Dortmund 
@hendrikEbbers 
www.guigarage.com 
hendrik.ebbers@web.de
CONTENT 
• JavaFX 
• Enterprise Development 
• JavaFX Enterprise 
some basics 
Best of JEE Spec 
Let’s test the mix
NEXT GENERATION UI WITH 
JAVAFX
BASICS 
• Scene Graph 
• Property API 
• FXML 
• CSS 
Controls, Layout, Rendering 
Bind the Data model 
& the UI 
Separation of 
View & Controller 
Flexible & Skinnable
DEMO
THERE IS A LOT MORE STUFF 
• Controls 
• Animation 
• 3D Support 
• Printing 
• …
ORACLE PRESS 
MASTERING 
JAVAFX 8 
CONTROLS 
Sorry for the ad
BEST PRACTICE 
ENTERPRISE 
DEVELOPMENT
JAVA EE SPECIFICATIONS 
• JAX-RS 
• JAX-WS 
• JAVA BEAN VALIDATION 
• EJB 
• CDI 
• JSF Flow 
Data CRUD 
operations 
bidirectional 
communication 
just 
annotations 
Local & Remote 
manage the lifecycle & 
inject the data 
structure of view
THE SEXY MIX 
JAVAFX 
ENTERPRISE
LET’S START WITH A 
BIG PROBLEM 
CLIENT 
SERVER 
The hard part
DESKTOP DEVELOPERS NEED TO KNOW 
MULTITHREADING… 
JAVAFX APPLICATION THREAD 
REPAINT REPAINT REPAINT REPAINT 
KEY 
PRESSED REPAINT REPAINT REPAINT MOUSE 
CLICKED 
Animation 
REPAINT REPAINT REPAINT REPAINT 
Interaction 
Layout
LET’S HAVE A LOOK AT A 
SMALL USE CASE 
STORYBOARD 
„LOAD“ 
CLICKED 
BLOCK 
Loading 
Animation 
starts 
U I 
START 
GLOW 
LOAD 
DATA 
STOP 
GLOW 
RELEASE 
U I 
UPDATE 
U I 
Call a 
Webservice 
Stop 
Animation 
No user 
input
OH, THAT ONE IS SIMPLE 
CODE SNIPPET 
blockUI(); 
data = loadFromServer(); 
updateUI(data); 
unblockUI();
IT’S WORKING LIKE CHARM IN MY 
DEV ENVIRONMENT 
STORYBOARD 
„LOAD“ 
CLICKED 
BLOCK 
U I 
START 
GLOW 
LOAD 
DATA 
STOP 
GLOW 
RELEASE 
U I 
UPDATE 
U I 
DONE
BUT THE CUSTOMER HAS PROBLEMS IN THE 
REAL ENVIRONMENT 
STORYBOARD
BUT THE CUSTOMER HAS PROBLEMS IN THE 
REAL ENVIRONMENT 
STORYBOARD 
56K modem… 
JavaFX Application 
Thread
SO WE NEED A 
BACKGROUND THREAD 
APPLICATION THREAD 
„LOAD“ 
CLICKED 
BLOCK 
U I 
START 
GLOW 
REPAINT REPAINT REPAINT REPAINT REPAINT 
LOAD 
DATA 
STOP 
GLOW 
RELEASE 
U I 
UPDATE 
U I 
DONE 
Background thread
LET’S START AND CREATE SOME 
HACKED CODE 
blockUI(); 
new Thread(backgroundRunnable).start(); 
Runnable backgroundRunnable = () -> { 
data = loadFromServer(); 
! 
! 
! 
} 
Platform.runLater(() -> { 
updateUI(data); 
unblockUI(); 
}); 
How to go back to 
application thread? 
What happens if this 
throws an Exception?
WE NEED TO ADD SOME 
EXCEPTION HANDLING 
Runnable backgroundRunnable = () -> { 
try { 
data = loadFromServer(); 
} catch(Exception e) { 
Platform.runLater(() -> { 
handleException(e); 
}); 
} finally { 
Platform.runLater(() -> { 
updateUI(data); 
unblockUI(); 
}); 
} 
} 
This doesn’t work!
WHO WANTS SOME 
SPAGHETTI CODE? 
Runnable backgroundRunnable = () -> { 
try { 
data = loadFromServer(); 
Platform.runLater(() -> { 
updateUI(data); 
}); 
} catch(Exception e) { 
Platform.runLater(() -> { 
handleException(e); 
}); 
} finally { 
Platform.runLater(() -> { 
unblockUI(); 
}); 
} 
}
DON’T LIKE IT? UNTIL LAST YEAR THIS WAS 
SPAGHETTI CODE XXL 
Runnable backgroundRunnable = new Runnable() { 
! 
@Override 
public void run() { 
try { 
data = loadFromServer(); 
Platform.runLater(new Runnable() { 
! 
@Override 
public void run() { 
updateUI(data); 
} 
}); 
} catch(Exception e) { 
Platform.runLater(new Runnable() { 
! 
@Override 
public void run() { 
handleException(e); 
} 
}); 
} finally { 
Platform.runLater(new Runnable() { 
! 
@Override 
public void run() { 
unblockUI(); 
} 
}); 
} 
} 
} 
< Java 8
WE NEED A 
BETTER SOLUTION 
DataFX 8 
ProcessChain.create(). 
addRunnableInPlatformThread(() -> blockUI()). 
addSupplierInExecutor(() -> loadFromServer()). 
addConsumerInPlatformThread(d -> updateUI(d)). 
onException(e -> handleException(e)). 
withFinal(() -> unblockUI()). 
run();
DEMO
WE CAN EVEN DO IT BETTER BY USING 
REACTIVE PROGRAMMING 
ListView<Data> listView = new ListView<>(); 
! 
ProcessChain.create(). 
addRunnableInPlatformThread(() -> listView.getItems().clear()). 
addPublishingTask(() -> listView.getItems(), 
publisher -> getDataWithCallback(elem -> publisher.publish(elem)). 
onException(e -> handleException(e)). 
run(); 
use callbacks!
TRY IT TODAY AND ADD THE 
DATAFX CORE MODULE 
<dependency> 
<groupId>io.datafx</groupId> 
<artifactId>core</artifactId> 
<version>X.Y</version> 
</dependency>
LET’S PIMP THE APP BY ADDING 
TIMEOUT CHECKS 
class CommandGetData extends HystrixCommand<List<String>> { 
! 
public CommandGetData() { 
super(Config.withExecutionIsolationThreadTimeoutInMilliseconds(6000) 
.withExecutionIsolationThreadInterruptOnTimeout(true) 
.withFallbackEnabled(false))); 
} 
! 
@Override 
protected List<String> run() { 
List<String> list = new ArrayList<>(); 
for (int i = 0; i < 10; i++) { 
list.add("Value " + i); 
sleep(); 
} 
return list; 
} 
! 
} 
Netflix Hystrix
DEMO
YOU ONLY NEED TO ADD THE 
HYSTRIX DEPENDENCY 
<dependency> 
<groupId>com.netflix.hystrix</groupId> 
<artifactId>hystrix-core</artifactId> 
<version>1.3.18</version> 
</dependency>
LET’S HAVE A LOOK AT THE 
CLIENT ARCHITECTURE 
APPLICATION 
APPLICATION FRAMEWORK 
UI TOOLKIT 
Moduls & 
Workflow based 
Best Practice 
Open Source 
Extendable 
Basics 
Rendering Pipeline
ALL THE COOL PEOPLE TALK ABOUT 
MVVM ARCHITECTURE 
VIEW MODEL 
MODEL 
CLIENT 
VIEW 
Shared between 
Server and all clients 
SERVER 
CLIENT 
VIEW 
CLIENT 
VIEW 
Persistence
USE IT TODAY WITH THE HELP OF 
MVVM FRAMEWORKS 
ANKOR.IO MVVMFX
PMVC LIBRARY 
OPENDOLPHIN 
ANOTHER OPTION IS AN 
an architecture for the communication between 
view and controller in an async [remote] fashion 
with presentation models.
PRESENTATION MODEL 
Client 
VIEW 
Server 
CONTROLLER 
Model Model 
MODEL 
MODEL 
SHARED
SHARE IT ON 
MULTIPLE CLIENTS
BUT I HAVE A JAVA ENTERPRISE BACKEND AND NEED A 
CLASSIC ARCHITECTURE 
CLIENT 
MVC MVC MVC 
BUSINESS-LAYER 
PERSISTENCE 
SERVER 
MIDDLEWARE 
JavaFX 
AngularJS 
Android 
Modularization of 
Views and Workflows 
REST, 
WS & SSE 
EJB & CDI 
JPA
USE ONE OF THESE 
FRAMEWORKS 
DATAFX AFTERBURNER.FX JACPFX
OVERVIEW 
AFTERBURNER.FX 
• apache licensed 
• as lean as possible: 3 classes, no external 
dependencies 
• combines: FXML, Convention over Configuration and 
JSR-330 / @Inject 
• integrated with maven 3
OVERVIEW 
DATAFX 
• Core API with concurrency tools 
• DataReader API for fast & easy data access 
• REST, SSE, WebSocket, … 
• Flow API to create workflows 
• Injection API
MOST OF THEM PROVIDE 
• Application Framework for JavaFX 
• Supports JEE Middleware standards 
• MVC Concept 
• Implement Workflows by Flows 
• (C)DI Support 
Inject the data model 
in the view controller 
REST 
WebSocket 
RemoteEJB 
Like in JSF 2.2 or 
Spring Flow 
COOL FEATURES
APPLICATION FLOW 
OVERVIEW ITEM VIEW 
SHOPPING 
CART 
CHECK OUT 
START CREATING AN
WE CAN USE THE 
OVERVIEW ITEM VIEW 
FXML JAVA FXML JAVA 
View 
Model & 
Controller 
MVC PATTERN
DEMO
CURRENT STATE OF THE 
(C)DI IMPLEMENTATIONS 
• Afterburner.fx and DataFX supports injection 
• Afterburner.fx supports the singleton scope 
• Afterburner.fx provides injection of properties 
• DataFX supports different scopes 
(dependent, view, flow, application) 
• DataFX provides a plugin mechanism for custom scopes
THE DARK SIDE OF 
CDI IMPLEMENTATIONS 
• Qualifier, etc. are currently not supported 
• No default CDI implementation is used 
• CDI-Spec is currently Java EE specific 
• Weld and OpenWebBeans core modules 
are Java EE specific 
Hackergarten? 
We don’t need a 
RequestScope 
lots of http apis inside…
THERE ARE COOL 
BUSINESS CONTROLS 
• The community created a lot of cool 
controls 
• ControlsFX 
• FlexGanttFX
DEMO
LOGIN WITH TWITTER 
CLIENT 
AUTH 
AUTH 
user data is 
stored here 
SHIT! MY HIP CUSTOMER WANTS TO
WEB APPS SIMPLY IMPLEMENT THE 
CLIENT SERVICE PROVIDER 
REQUEST 
REQUEST TOKEN 
DIRECT USER TO 
SERVICE PROVIDER 
GRANT 
REQUEST TOKEN 
OBTAIN USER 
AUTHORIZATION 
DIRECT USER TO 
CONSUMER 
REQUEST 
ACCESS TOKEN 
GRANT 
ACCESS TOKEN 
Oh, we don’t 
have a web app 
OAUTH WORKFLOW
DEMO
BUT JAVAFX CAN 
CONTROL THE WEBVIEW 
DIRECT USER TO 
CONSUMER 
GRANT 
ACCESS TOKEN 
WEBVIEW 
LISTENER 
extract access token 
from URL
INTRODUCING A 
GUIGARAGE MODULE 
<dependency> 
<groupId>com.guigarage</groupId> 
<artifactId>login-with-fx</artifactId> 
<version>X.Y</version> 
</dependency>
THERE ARE MORE NEW 
GUIGARAGE MODULES 
WINDOW 
STYLER 
FLATTER 
RESPONSIVE-FX 
ANIMATIONS 
MATERIAL 
DESIGN 
Extreme Gui 
Makeover 
Extreme Gui 
Makeover 
Extreme Gui 
Makeover 
Smart UIs for 
Mobile and Embedded
THX FOR WATCHING 
QUESTIONS?

More Related Content

What's hot

Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...Edureka!
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 
Hinkmond's JavaFX Mobile Dojo
Hinkmond's JavaFX Mobile DojoHinkmond's JavaFX Mobile Dojo
Hinkmond's JavaFX Mobile DojoStephen Chin
 
Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)Som Prakash Rai
 
Visage Android - Cleaner APIs, Cleaner UIs
Visage Android - Cleaner APIs, Cleaner UIsVisage Android - Cleaner APIs, Cleaner UIs
Visage Android - Cleaner APIs, Cleaner UIsStephen Chin
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introductionejlp12
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java DevelopersYakov Fain
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjavaAnil Kumar
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsKaml Sah
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutesArun Gupta
 
Java EE vs Spring Framework
Java  EE vs Spring Framework Java  EE vs Spring Framework
Java EE vs Spring Framework Rohit Kelapure
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Hamed Hatami
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutesglassfish
 
Java EE 01-Servlets and Containers
Java EE 01-Servlets and ContainersJava EE 01-Servlets and Containers
Java EE 01-Servlets and ContainersFernando Gil
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondOracle
 
Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsSalesforce Developers
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 
Understanding
Understanding Understanding
Understanding Arun Gupta
 

What's hot (20)

Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
 
JavaFX Enterprise
JavaFX EnterpriseJavaFX Enterprise
JavaFX Enterprise
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Hinkmond's JavaFX Mobile Dojo
Hinkmond's JavaFX Mobile DojoHinkmond's JavaFX Mobile Dojo
Hinkmond's JavaFX Mobile Dojo
 
Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)
 
Visage Android - Cleaner APIs, Cleaner UIs
Visage Android - Cleaner APIs, Cleaner UIsVisage Android - Cleaner APIs, Cleaner UIs
Visage Android - Cleaner APIs, Cleaner UIs
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java Developers
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
 
Java EE vs Spring Framework
Java  EE vs Spring Framework Java  EE vs Spring Framework
Java EE vs Spring Framework
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
Java EE 01-Servlets and Containers
Java EE 01-Servlets and ContainersJava EE 01-Servlets and Containers
Java EE 01-Servlets and Containers
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and Beyond
 
Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service Clients
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 
Understanding
Understanding Understanding
Understanding
 

Similar to JavaFX Enterprise (JavaOne 2014)

Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOpsFrank Munz
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...Frank Munz
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...CodeMill digital skills
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard IntroductionAnthony Chen
 
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)Hendrik Ebbers
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
MVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative WebtechnologieMVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative WebtechnologieOPEN KNOWLEDGE GmbH
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptxssuser35fdf2
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh! Chalermpon Areepong
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Red Hat Developers
 
From Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaFrom Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaAlexandre Morgaut
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassPaul Withers
 
Unlocking the power of the APEX Plugin Architecture
Unlocking the power of the APEX Plugin ArchitectureUnlocking the power of the APEX Plugin Architecture
Unlocking the power of the APEX Plugin ArchitectureMatt Nolan
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaYevgeniy Brikman
 

Similar to JavaFX Enterprise (JavaOne 2014) (20)

Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOps
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
 
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
MVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative WebtechnologieMVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative Webtechnologie
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
 
Oracle OpenWorld 2014 Review Part Four - PaaS Middleware
Oracle OpenWorld 2014 Review Part Four - PaaS MiddlewareOracle OpenWorld 2014 Review Part Four - PaaS Middleware
Oracle OpenWorld 2014 Review Part Four - PaaS Middleware
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
From Web App Model Design to Production with Wakanda
From Web App Model Design to Production with WakandaFrom Web App Model Design to Production with Wakanda
From Web App Model Design to Production with Wakanda
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
Unlocking the power of the APEX Plugin Architecture
Unlocking the power of the APEX Plugin ArchitectureUnlocking the power of the APEX Plugin Architecture
Unlocking the power of the APEX Plugin Architecture
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 

More from Hendrik Ebbers

Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)Hendrik Ebbers
 
Beauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScriptBeauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScriptHendrik Ebbers
 
Java APIs - the missing manual
Java APIs - the missing manualJava APIs - the missing manual
Java APIs - the missing manualHendrik Ebbers
 
Multidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UXMultidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UXHendrik Ebbers
 
Java WebStart Is Dead: What Should We Do Now?
Java WebStart Is Dead: What Should We Do Now?Java WebStart Is Dead: What Should We Do Now?
Java WebStart Is Dead: What Should We Do Now?Hendrik Ebbers
 
Java ap is you should know
Java ap is you should knowJava ap is you should know
Java ap is you should knowHendrik Ebbers
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016Hendrik Ebbers
 
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ DevoxxBUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ DevoxxHendrik Ebbers
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Hendrik Ebbers
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)Hendrik Ebbers
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
Feature driven development
Feature driven developmentFeature driven development
Feature driven developmentHendrik Ebbers
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Hendrik Ebbers
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIHendrik Ebbers
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundHendrik Ebbers
 
Lightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetLightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetHendrik Ebbers
 

More from Hendrik Ebbers (20)

Java Desktop 2019
Java Desktop 2019Java Desktop 2019
Java Desktop 2019
 
Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)
 
Beauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScriptBeauty & the Beast - Java VS TypeScript
Beauty & the Beast - Java VS TypeScript
 
Java 11 OMG
Java 11 OMGJava 11 OMG
Java 11 OMG
 
Java APIs - the missing manual
Java APIs - the missing manualJava APIs - the missing manual
Java APIs - the missing manual
 
Multidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UXMultidevice Controls: A Different Approach to UX
Multidevice Controls: A Different Approach to UX
 
Java WebStart Is Dead: What Should We Do Now?
Java WebStart Is Dead: What Should We Do Now?Java WebStart Is Dead: What Should We Do Now?
Java WebStart Is Dead: What Should We Do Now?
 
Java ap is you should know
Java ap is you should knowJava ap is you should know
Java ap is you should know
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016
 
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ DevoxxBUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
BUILDING MODERN WEB UIS WITH WEB COMPONENTS @ Devoxx
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
Feature driven development
Feature driven developmentFeature driven development
Feature driven development
 
Extreme Gui Makeover
Extreme Gui MakeoverExtreme Gui Makeover
Extreme Gui Makeover
 
Bonjour for Java
Bonjour for JavaBonjour for Java
Bonjour for Java
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
 
Lightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and PuppetLightweight and reproducible environments with vagrant and Puppet
Lightweight and reproducible environments with vagrant and Puppet
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
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 educationjfdjdjcjdnsjd
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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 Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
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, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 

JavaFX Enterprise (JavaOne 2014)

  • 1. HENDRIK EBBERS JAVAFX ENTERPRISE Do they match?
  • 2. ABOUT ME • Hendrik Ebbers ! • Senior Java Architect @ Canoo Engineering AG • Lead of JUG Dortmund @hendrikEbbers www.guigarage.com hendrik.ebbers@web.de
  • 3. CONTENT • JavaFX • Enterprise Development • JavaFX Enterprise some basics Best of JEE Spec Let’s test the mix
  • 4. NEXT GENERATION UI WITH JAVAFX
  • 5. BASICS • Scene Graph • Property API • FXML • CSS Controls, Layout, Rendering Bind the Data model & the UI Separation of View & Controller Flexible & Skinnable
  • 7. THERE IS A LOT MORE STUFF • Controls • Animation • 3D Support • Printing • …
  • 8. ORACLE PRESS MASTERING JAVAFX 8 CONTROLS Sorry for the ad
  • 10. JAVA EE SPECIFICATIONS • JAX-RS • JAX-WS • JAVA BEAN VALIDATION • EJB • CDI • JSF Flow Data CRUD operations bidirectional communication just annotations Local & Remote manage the lifecycle & inject the data structure of view
  • 11. THE SEXY MIX JAVAFX ENTERPRISE
  • 12. LET’S START WITH A BIG PROBLEM CLIENT SERVER The hard part
  • 13. DESKTOP DEVELOPERS NEED TO KNOW MULTITHREADING… JAVAFX APPLICATION THREAD REPAINT REPAINT REPAINT REPAINT KEY PRESSED REPAINT REPAINT REPAINT MOUSE CLICKED Animation REPAINT REPAINT REPAINT REPAINT Interaction Layout
  • 14. LET’S HAVE A LOOK AT A SMALL USE CASE STORYBOARD „LOAD“ CLICKED BLOCK Loading Animation starts U I START GLOW LOAD DATA STOP GLOW RELEASE U I UPDATE U I Call a Webservice Stop Animation No user input
  • 15. OH, THAT ONE IS SIMPLE CODE SNIPPET blockUI(); data = loadFromServer(); updateUI(data); unblockUI();
  • 16. IT’S WORKING LIKE CHARM IN MY DEV ENVIRONMENT STORYBOARD „LOAD“ CLICKED BLOCK U I START GLOW LOAD DATA STOP GLOW RELEASE U I UPDATE U I DONE
  • 17. BUT THE CUSTOMER HAS PROBLEMS IN THE REAL ENVIRONMENT STORYBOARD
  • 18. BUT THE CUSTOMER HAS PROBLEMS IN THE REAL ENVIRONMENT STORYBOARD 56K modem… JavaFX Application Thread
  • 19. SO WE NEED A BACKGROUND THREAD APPLICATION THREAD „LOAD“ CLICKED BLOCK U I START GLOW REPAINT REPAINT REPAINT REPAINT REPAINT LOAD DATA STOP GLOW RELEASE U I UPDATE U I DONE Background thread
  • 20. LET’S START AND CREATE SOME HACKED CODE blockUI(); new Thread(backgroundRunnable).start(); Runnable backgroundRunnable = () -> { data = loadFromServer(); ! ! ! } Platform.runLater(() -> { updateUI(data); unblockUI(); }); How to go back to application thread? What happens if this throws an Exception?
  • 21. WE NEED TO ADD SOME EXCEPTION HANDLING Runnable backgroundRunnable = () -> { try { data = loadFromServer(); } catch(Exception e) { Platform.runLater(() -> { handleException(e); }); } finally { Platform.runLater(() -> { updateUI(data); unblockUI(); }); } } This doesn’t work!
  • 22. WHO WANTS SOME SPAGHETTI CODE? Runnable backgroundRunnable = () -> { try { data = loadFromServer(); Platform.runLater(() -> { updateUI(data); }); } catch(Exception e) { Platform.runLater(() -> { handleException(e); }); } finally { Platform.runLater(() -> { unblockUI(); }); } }
  • 23. DON’T LIKE IT? UNTIL LAST YEAR THIS WAS SPAGHETTI CODE XXL Runnable backgroundRunnable = new Runnable() { ! @Override public void run() { try { data = loadFromServer(); Platform.runLater(new Runnable() { ! @Override public void run() { updateUI(data); } }); } catch(Exception e) { Platform.runLater(new Runnable() { ! @Override public void run() { handleException(e); } }); } finally { Platform.runLater(new Runnable() { ! @Override public void run() { unblockUI(); } }); } } } < Java 8
  • 24. WE NEED A BETTER SOLUTION DataFX 8 ProcessChain.create(). addRunnableInPlatformThread(() -> blockUI()). addSupplierInExecutor(() -> loadFromServer()). addConsumerInPlatformThread(d -> updateUI(d)). onException(e -> handleException(e)). withFinal(() -> unblockUI()). run();
  • 25. DEMO
  • 26. WE CAN EVEN DO IT BETTER BY USING REACTIVE PROGRAMMING ListView<Data> listView = new ListView<>(); ! ProcessChain.create(). addRunnableInPlatformThread(() -> listView.getItems().clear()). addPublishingTask(() -> listView.getItems(), publisher -> getDataWithCallback(elem -> publisher.publish(elem)). onException(e -> handleException(e)). run(); use callbacks!
  • 27. TRY IT TODAY AND ADD THE DATAFX CORE MODULE <dependency> <groupId>io.datafx</groupId> <artifactId>core</artifactId> <version>X.Y</version> </dependency>
  • 28. LET’S PIMP THE APP BY ADDING TIMEOUT CHECKS class CommandGetData extends HystrixCommand<List<String>> { ! public CommandGetData() { super(Config.withExecutionIsolationThreadTimeoutInMilliseconds(6000) .withExecutionIsolationThreadInterruptOnTimeout(true) .withFallbackEnabled(false))); } ! @Override protected List<String> run() { List<String> list = new ArrayList<>(); for (int i = 0; i < 10; i++) { list.add("Value " + i); sleep(); } return list; } ! } Netflix Hystrix
  • 29. DEMO
  • 30. YOU ONLY NEED TO ADD THE HYSTRIX DEPENDENCY <dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-core</artifactId> <version>1.3.18</version> </dependency>
  • 31. LET’S HAVE A LOOK AT THE CLIENT ARCHITECTURE APPLICATION APPLICATION FRAMEWORK UI TOOLKIT Moduls & Workflow based Best Practice Open Source Extendable Basics Rendering Pipeline
  • 32. ALL THE COOL PEOPLE TALK ABOUT MVVM ARCHITECTURE VIEW MODEL MODEL CLIENT VIEW Shared between Server and all clients SERVER CLIENT VIEW CLIENT VIEW Persistence
  • 33. USE IT TODAY WITH THE HELP OF MVVM FRAMEWORKS ANKOR.IO MVVMFX
  • 34. PMVC LIBRARY OPENDOLPHIN ANOTHER OPTION IS AN an architecture for the communication between view and controller in an async [remote] fashion with presentation models.
  • 35. PRESENTATION MODEL Client VIEW Server CONTROLLER Model Model MODEL MODEL SHARED
  • 36. SHARE IT ON MULTIPLE CLIENTS
  • 37. BUT I HAVE A JAVA ENTERPRISE BACKEND AND NEED A CLASSIC ARCHITECTURE CLIENT MVC MVC MVC BUSINESS-LAYER PERSISTENCE SERVER MIDDLEWARE JavaFX AngularJS Android Modularization of Views and Workflows REST, WS & SSE EJB & CDI JPA
  • 38. USE ONE OF THESE FRAMEWORKS DATAFX AFTERBURNER.FX JACPFX
  • 39. OVERVIEW AFTERBURNER.FX • apache licensed • as lean as possible: 3 classes, no external dependencies • combines: FXML, Convention over Configuration and JSR-330 / @Inject • integrated with maven 3
  • 40. OVERVIEW DATAFX • Core API with concurrency tools • DataReader API for fast & easy data access • REST, SSE, WebSocket, … • Flow API to create workflows • Injection API
  • 41. MOST OF THEM PROVIDE • Application Framework for JavaFX • Supports JEE Middleware standards • MVC Concept • Implement Workflows by Flows • (C)DI Support Inject the data model in the view controller REST WebSocket RemoteEJB Like in JSF 2.2 or Spring Flow COOL FEATURES
  • 42. APPLICATION FLOW OVERVIEW ITEM VIEW SHOPPING CART CHECK OUT START CREATING AN
  • 43. WE CAN USE THE OVERVIEW ITEM VIEW FXML JAVA FXML JAVA View Model & Controller MVC PATTERN
  • 44. DEMO
  • 45. CURRENT STATE OF THE (C)DI IMPLEMENTATIONS • Afterburner.fx and DataFX supports injection • Afterburner.fx supports the singleton scope • Afterburner.fx provides injection of properties • DataFX supports different scopes (dependent, view, flow, application) • DataFX provides a plugin mechanism for custom scopes
  • 46. THE DARK SIDE OF CDI IMPLEMENTATIONS • Qualifier, etc. are currently not supported • No default CDI implementation is used • CDI-Spec is currently Java EE specific • Weld and OpenWebBeans core modules are Java EE specific Hackergarten? We don’t need a RequestScope lots of http apis inside…
  • 47. THERE ARE COOL BUSINESS CONTROLS • The community created a lot of cool controls • ControlsFX • FlexGanttFX
  • 48. DEMO
  • 49. LOGIN WITH TWITTER CLIENT AUTH AUTH user data is stored here SHIT! MY HIP CUSTOMER WANTS TO
  • 50. WEB APPS SIMPLY IMPLEMENT THE CLIENT SERVICE PROVIDER REQUEST REQUEST TOKEN DIRECT USER TO SERVICE PROVIDER GRANT REQUEST TOKEN OBTAIN USER AUTHORIZATION DIRECT USER TO CONSUMER REQUEST ACCESS TOKEN GRANT ACCESS TOKEN Oh, we don’t have a web app OAUTH WORKFLOW
  • 51. DEMO
  • 52. BUT JAVAFX CAN CONTROL THE WEBVIEW DIRECT USER TO CONSUMER GRANT ACCESS TOKEN WEBVIEW LISTENER extract access token from URL
  • 53. INTRODUCING A GUIGARAGE MODULE <dependency> <groupId>com.guigarage</groupId> <artifactId>login-with-fx</artifactId> <version>X.Y</version> </dependency>
  • 54. THERE ARE MORE NEW GUIGARAGE MODULES WINDOW STYLER FLATTER RESPONSIVE-FX ANIMATIONS MATERIAL DESIGN Extreme Gui Makeover Extreme Gui Makeover Extreme Gui Makeover Smart UIs for Mobile and Embedded
  • 55. THX FOR WATCHING QUESTIONS?