Building Java Desktop Apps with JavaFX 8 and Java EE 7
-
Upload
bruno-borges -
Category
Technology
-
view
392 -
download
3
description
Transcript of Building Java Desktop Apps with JavaFX 8 and Java EE 7
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Building Java Applications with JavaFX 8 and Java EE 7 [CON2150] Being a smart Java developer on both client and server-side
Bruno Borges Principal Product Manager – Java Evangelist Oracle Latin America September, 2014
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Speaker
• Bruno Borges
– Principal Product Manager, Java Evangelist – Oracle Latin America
– @brunoborges – [email protected]
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
JavaFX Desktop Applications Today
Exposing Server-side Data with Java EE 7
Java EE 7 APIs for Client-side
Putting all together
Summary
1
2
3
4
5
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JavaFX Desktop Applications
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Usual Desktop Architecture
Source: Wikipedia
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JavaFX Frameworks
OpenDolphin
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java EE 7 Not just for Web Development
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 10
Java EE 7 APIs
JAX-RS 2.0
JSON-P 1.0 Web Socket 1.0 Servlet 3.1
JSF 2.2 EL 3.0 JSP
JSTL
Bean
Valid
ation 1
.1
Inte
rce
pto
rs 1
.2
CD
I 1.1
Concurr
ency 1
.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
JavaMail 1.5
JAX-WS
JAXB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 11
Java EE 7 APIs for Exposing Data
JAX-RS 2.0
JSON-P 1.0 Web Socket 1.0 Servlet 3.1
JSF 2.2 EL 3.0 JSP
JSTL
Bean
Valid
ation 1
.1
Inte
rce
pto
rs 1
.2
CD
I 1.1
Concurr
ency 1
.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
JavaMail 1.5
JAX-WS
JAXB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR 356: Java API for WebSocket 1.0
@ServerEndpoint("/echo")
public class EchoServer {
@OnMessage
public void onMessage(Session session, String message) {
session.getOpenSessions() .forEach(s ->s.getAsyncRemote().sendText(message));
}
}
Annotated ServerEndpoint Example
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR 339 – JAX-RS 2.0
@Path("/chat")
public class ChatServer {
@GET @Produces(“plain/text”)
@Consumes(“plain/text”)
public String echo(String message) {
return “Echoing via REST the message: “+message;
}
...
}
Annotated REST Service
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR 372 – JavaServer Faces 2.3
• Build webpages and embed them in JavaFX applications with WebView
• Inject real Java objects by manipulating the DOM tree in WebView
– Do this instead of running Applets in webpages loaded on browsers
– Consider this for applications that require fast layout changes/evolution
• Part of your application is dynamically loaded from Web – Or even the whole screen is loaded as web page?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 15
Java EE 7 APIs for Client-side
JAX-RS 2.0
JSON-P 1.0 Web Socket 1.0 Servlet 3.1
JSF 2.2 EL 3.0 JSP
JSTL
Bean
Valid
ation 1
.1
Inte
rce
pto
rs 1
.2
CD
I 1.1
Concurr
ency 1
.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
JavaMail 1.5
JAX-WS
JAXB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 16
Java EE 7 APIs To Be Used on Client-side
JAX-RS 2.0
JSON-P 1.0 Web Socket 1.0 Servlet 3.1
JSF 2.2 EL 3.0 JSP
JSTL
Bean
Valid
ation 1
.1
Inte
rce
pto
rs 1
.2
CD
I 1.1
Concurr
ency 1
.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
JavaMail 1.5
JAX-WS
JAXB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 17
Java EE 7 APIs You Can Use but Likely Won’t...
JAX-RS 2.0
JSON-P 1.0 Web Socket 1.0 Servlet 3.1
JSF 2.2 EL 3.0 JSP
JSTL
Bean
Valid
ation 1
.1
Inte
rce
pto
rs 1
.2
CD
I 1.1
Concurr
ency 1
.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
JavaMail 1.5
JAX-WS
JAXB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 18
Hybrid JavaFX Desktop Application – Architecture
Windows Mac OS X Linux
Oracle JRE
JavaFX
Application
Embedded Browser
Native UI Controls
Native Hardware
Access
An HTML5 (remote/local) application
Native Controls in JavaFX with Themes and CSS Styles
Java libraries for hardware integration
Bundle the JRE with your application for native
installers
One unified desktop
application
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JavaFX Hybrid Apps Building Desktop Apps instead of Web Apps with Applets
Web Browser
Your Web Page * that requires applets
Applets
JavaFX Desktop “Hybrid” Application
Embedded Browser – JavaFX’s WebView
Native Features
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Demo
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Adopt-A-JSR
• Want Java EE APIs to be aligned with Desktop/JavaFX Applications?
• Want a Java EE “Client Profile”?
Oracle Confidential – Internal/Restricted/Highly
23
glassfish.org/adoptajsr