More Related Content Similar to JavaScript Frameworks and Java EE – A Great Match (20) JavaScript Frameworks and Java EE – A Great Match2. CapTech
Full-service US national IT consulting firm that focuses on client best interests,
trust, servant leadership, culture, professionalism and technical excellence.
#28 in Vault's Consulting Top 50
#3 Best Consulting Internship
#9 Best Overall Internship
#1 in Meeting Client’s Needs
#7 Best Firm to Work For
#1 in Career Development
Ranked for the
7th
Consecutive Year
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
3. Agenda
• JavaScript Frameworks in Perspective
• Java EE Capabilities
• Java EE + JavaScript Frameworks
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
4. JavaScript Frameworks in Perspective
• Thin client vs. rich client debate is very old
• Server-side web frameworks have ruled for a while
• JSF, Spring MVC
• AJAX mild shift to client
• PrimeFaces, GWT
• Rich clients powered by JavaScript frameworks making a comeback
• Improving JavaScript engines
• Better tools (jQuery, MV* frameworks, Chrome, FireFox)
• Standards advancement (CSS3, HTML5, WebSocket, HTML
Components…)
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
5. Computer Science is About Tradeoffs
• Rich clients clearly better at some things
• Complex, dense, dynamic interfaces
• “Single page applications” (Applets ;-))
• Not a panacea
• Heavily form, workflow driven applications
• Server-side rendering still better in terms of maturity, reliability, security,
accessibility, internationalization, SEO
• JavaScript development not without it’s pains…
• Likely co-existence in the long term
• Maybe even in the same application!
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
6. My Big Fat Rich-Client Architecture
• Very similar to client/server architecture of lore
• Client responsible for UI rendering, basic input validation, logic and state
• Server responsible for business logic, domain model, persistence
• Communication protocols
• REST for majority of cases
• WebSocket when full-duplex communication needed
• Server-Sent Events (SSE) when only server streaming needed
• JavaScript frameworks support REST well, but not WebSocket/SSE
• Typical interchange format is JSON
Java EE is a great server-side platform for this architecture.
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
7. Java EE + JavaScript
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
EJB 3EJB 3
ServletServlet
CDICDI JPAJPA
JAX-RSJAX-RS
BeanValidationBeanValidation
WebSocketWebSocket
JSON-BJSON-B
JavaScript FrameworkJavaScript Framework
JAXBJAXB
SSESSE
JSON-PJSON-P
8. Java EE + JavaScript Demo
https://github.com/m-reza-rahman/javaee-javascript
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
9. Summary
• JavaScript frameworks gaining traction
• Java EE well positioned as a JavaScript rich client backend, especially with
JAX-RS, the Java API for WebSocket and JSON-P
• Support will be even stronger with Java EE 8
• You can use demo code as a starting point
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
10. Resources
• Angular Tutorial
• https://docs.angularjs.org/tutorial
• Java EE Tutorials
• https://docs.oracle.com/javaee/7/tutorial/
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.