JavaScript Frameworks and Java EE – Match Made in Heaven

Cd94eaef7b2860c41cb0612720137e2b?s=47 Reza Rahman
February 04, 2018

JavaScript Frameworks and Java EE – Match Made in Heaven

A sea change in JavaScript frameworks is shifting the pendulum away from server-side web frameworks like Spring MVC and JSF. With strong support for REST, Sever-Sent Events (SSE), WebSocket and JSON, Java EE is well positioned to adapt to this landscape.

In this heavily code driven workshop, we will show you how you can utilize today's most popular JavaScript frameworks like AngularJS and React to utilize the core strengths of Java EE using JAX-RS, WebSocket, JSON-P, JSON-B, CDI and Bean Validation.

Cd94eaef7b2860c41cb0612720137e2b?s=128

Reza Rahman

February 04, 2018
Tweet

Transcript

  1. Others Talk, We Listen. JavaScript Frameworks and Java EE –

    A Great Match Reza Rahman Senior Architect rrahman@captechconsulting.com @reza_rahman
  2. 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 3 Servlet CDI JPA JAX-RS Bean Validation WebSocket JSON-B JavaScript Framework JAXB SSE JSON-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.
  11. Copyright © 2015 CapTech Ventures, Inc. All rights reserved.