SlideShare a Scribd company logo
DIGITAL Java EE 7 New
and NOTEWORTHY
Enterprise Java Lives! (18-02-2015)
Peter Pilgrim
Scala and Java EE
Independent contractor
@peter_pilgrim	
  
Xenonique @peter_pilgrim 2	
  
Xenonique @peter_pilgrim 3	
  
Agenda
•  Digital
•  Java EE 7
•  Java EE Web Technology
Xenonique @peter_pilgrim
Creative Commons 2.0
Attribution-NonCommercial-ShareAlike 2.0 UK:
England & Wales (CC BY-NC-SA 2.0 UK)
https://creativecommons.org/licenses/by-nc-sa/2.0/uk/
•  Share — copy and redistribute the material in
any medium or format
•  Adapt — remix, transform, and build upon the
material
•  The licensor cannot revoke these freedoms as
long as you follow the license terms.
4	
  
Xenonique @peter_pilgrim
About Me
•  Java EE and Scala developer independent
contractor
•  Digital transformation / e-commerce
•  Java Champion
•  Working on the JVM since 1998
5	
  
Xenonique @peter_pilgrim 6	
  
Xenonique @peter_pilgrim 7	
  
Why the fuss about so-called Digital?
Haven’t we seen this all before?
Xenonique @peter_pilgrim 8	
  
Xenonique @peter_pilgrim 9	
  
#1 Digital
Fast. Agile. User Centric.
Focus on the end-user
Emphasis on Testing
User Experience is significant
Xenonique @peter_pilgrim 10	
  
#1 Digital
Digital is the Web
Digital is refocusing ideas for
online activities
Xenonique @peter_pilgrim 11	
  
#1 Digital
Digital is an attitude
Listening to customer needs
Embracing conversation and
communication
Xenonique @peter_pilgrim 12	
  
#1 Digital
Transformation of our
traditional industrial
Economy to a 21st Century
Mobile to Default one
Xenonique @peter_pilgrim 13	
  
#1 Digital
With all of the consequences:
politics, society, technology
and web infrastructure.
Xenonique @peter_pilgrim 14	
  
Xenonique @peter_pilgrim 15	
  
Is Java EE helpful to digital
developers, designers and
architect? Still relevant?
Xenonique @peter_pilgrim 16	
  
Java EE 7 released 2013
Built products on top of a standard platform
Transactions, Concurrency, Remote
Endpoints, Lifecycle, State, Persistence
Java is a programming language.
Java is a virtual machine.
Java is a platform.
Xenonique @peter_pilgrim 17	
  
Java	
  EE	
  7	
  
Xenonique @peter_pilgrim 18	
  
Xenonique @peter_pilgrim
Main Features
•  CDI 1.1
•  JAX-RS 2
•  JSF 2.2
•  Servlet 3.1
•  EJB 3.1
•  JPA 2.1
19	
  
Xenonique @peter_pilgrim 20	
  
#2 WAR is king (or queen)
WAR files are now the prefer way to deploy
applications for most set-ups
EAR files are still supported however
RAR files are even rarer (Resource ARchive)
PAR files are even rarer still (Persistence ARchive)
Xenonique @peter_pilgrim 21	
  
#2 Containerless
Suits the Docker / chef / Puppet vis-à-vis the
provisioning generation
Prefer starting up embeddable application
server GlassFish or WildFly server over
deployment WARs
Sadly: Code Hale’s DropWizard only supports Java EE 6
Xenonique @peter_pilgrim 22	
  
#2 Containerless
Suits the Docker / chef / Puppet vis-à-vis the
provisioning generation
Prefer starting up embeddable application
server GlassFish or WildFly server over
deployment WARs
Sadly: Code Hale’s DropWizard only supports Java EE 6
Xenonique @peter_pilgrim 23	
  
#2 Testable Java EE
Arquillian
Helps with real-world integration testing
Embeddable Container
Also help with direct EJB, JPA, JMS testing
Xenonique @peter_pilgrim 24	
  
#2 Java EE better Async Support
Servlet 3.1 has Async support
Non-Blocking I/O, HTTP Upgrade mechanism
JAX RS 2.0 has Async support
Client side API with HATEOS, Filters and Handlers
WebSocket 1.0
(Async by default, by protocol)
JMS 2.0 (when used in standalone Java SE)
Asynchronous API for Reactive Programming yet to be
exploited by other frameworks
Xenonique @peter_pilgrim 25	
  
Java EE 7
Developer
Handbook
September	
  2013	
  
Packt	
  Publishing	
  
	
  
Digital
Java EE 7
Web APPS
May	
  2015	
  
Xenonique @peter_pilgrim 26	
  
Xenonique @peter_pilgrim 27	
  
Java Server Faces
An Component Oriented Framework
Xenonique @peter_pilgrim 28	
  
CDI & Faces Scopes

@RequestScoped
@SessionScoped
@ApplicationScoped
@ViewScoped*
@ConversationScoped*
@FlowScoped*
Xenonique @peter_pilgrim 29	
  
#3 View Scoped
Retained Page View Scope
HTTL Form Data lives for validation
Customer sees their input data
entered after entering errors
Helpful for digital web site
Xenonique @peter_pilgrim 30	
  
#3 View Scoped
Lifecycle dies on a new page view
Minable effort for digital developers
Helpful for single page forms
Login forms, small data entry journeys
Already in existence since Java EE 6
Xenonique @peter_pilgrim 31	
  
#3 CDI and EJB
CDI is really useful for code assembly
Depend on session EJB less
Helpful for single page forms
Login forms, small data entry journeys
Already in existence since Java EE 6
Xenonique @peter_pilgrim
View Scope
@Named("contactDetailController")
@ViewScoped
public class ContactDetailController {
@EJB ContactDetailService service;
private ContactDetail contactDetail = 

 new ContactDetail();
/* ... */
}
32	
  
Xenonique @peter_pilgrim 33	
  
#4 Conversation Scoped
Basic Customer Journey
Actually existed since Java EE 6
Transient or Persistent
Developer controls the life cycle
Xenonique @peter_pilgrim 34	
  
#4 Conversation Scoped
Complex Wizard Type Flows
Lifecycle between Request and Session Scope
Backing Bean must be Serializable
Solves a long standing problem with Java Servlet
technology with storing items in HttpSession
Xenonique @peter_pilgrim
Conversation Scope
@Named("lendingController")
@ConversationScoped
public class LendingController 
implements Serializable {
@EJB ApplicantService applicantService;
@Inject Conversation conversation;
@Inject Utility utility;
/* ... */
}
35	
  
Xenonique @peter_pilgrim 36	
  
Xenonique @peter_pilgrim
Conversation Scope
public class LendingController { /* ... */
public void checkAndStart() {
if ( conversation.isTransient()) {
conversation.begin();
}
recalculatePaymentMonthlyTerm();
}
public void checkAndEnd() {
if (!conversation.isTransient()) {
conversation.end();
}
}
}
37	
  
Xenonique @peter_pilgrim 38	
  
#5 Flow Scoped
Underrated Star of JSF 2.2
Lifecycle between Request and Session Scope
Controller, resources & page views
with protected and encapsulated
access
Xenonique @peter_pilgrim 39	
  
#5 Flow Scoped
Flow can be implicit
Can be explicitly defined with XML
A Flow has one single entry point
A Flow has at least one exit point
Xenonique @peter_pilgrim 40	
  
#5 Flow Scoped
Flow can invoke another one
Faces Flow are nestable
Inbound named parameters
Outbound named parameters
Special flowScope map collection
Xenonique @peter_pilgrim 41	
  
#5 Flow Scoped
Custom Flow Components
Distribute Faces Flows defined in 3rd party JARs
Resource Library Contracts
Apply CSS, JavaScript and resources
Special flow scope map collection
To pass data in between Faces Flows
Xenonique @peter_pilgrim
Flow Scoped (Sector)
@Named
@FlowScoped("sector-flow")
public class SectorFlow implements
Serializable {
@Inject UtilityHelper utilityHelper;
@Inject CarbonFootprintService service;
/* ... */
}
42	
  
Xenonique @peter_pilgrim
Flow Scoped (Sector)
public class SectorFlow { 
/*...*/
@PostConstruct
public void initialize() {
footprint.setApplicationId(
utilityHelper.getNextApplicationId());
}

public String gotoEndFlow() {
return "/endflow.xhtml";
}
}
43	
  
Xenonique @peter_pilgrim
Flow Scoped (Sector)
<faces-config version="2.2" ...>
<flow-definition id="sector-flow">
<flow-return id="goHome">
<from-outcome>/index</from-outcome>
</flow-return>
<flow-return id="endFlow">
<from-outcome>#{sectorFlow.gotoEndFlow()}
</from-outcome>
</flow-return>

...

</faces-config>
44	
  
Xenonique @peter_pilgrim
Flow Scoped (Sector)
<faces-config version="2.2" ...>
...
<flow-call id="callFootprintFlow">
<flow-reference>
<flow-id>footprint-flow</flow-id>
</flow-reference>

 
<outbound-parameter>
<name>param3FromSectorFlow</name>
<value>#{sectorFlow.footprint}</value>
</outbound-parameter>
</flow-call>
</flow-definition>
</faces-config>
45	
  
Xenonique @peter_pilgrim
Flow Scoped (Footprint)
@Named
@FlowScoped("footprint-flow")
public class FootprintFlow implements Serializable {
private CarbonFootprint footprint;

public FootprintFlow() { }

@PostConstruct
public void initialize() {}
Map<Object,Object> flowMap = 

FacesContext.getCurrentInstance()

 
.getApplication().getFlowHandler()

 
.getCurrentFlowScope();
footprint = (CarbonFootprint) flowMap.get("param3Value");
}
}
46	
  
Xenonique @peter_pilgrim 47	
  
Xenonique @peter_pilgrim 48	
  
#6	
  MVC	
  1.0	
  
	
  
Targeting Java EE 8
JSR 371 Model View Controller
Action Oriented Request Framework
Xenonique @peter_pilgrim 49	
  
#6	
  MVC	
  1.0	
  
	
  
Separate	
  View	
  layer	
  to	
  JSF	
  
Standardising	
  on	
  Java	
  RS	
  2.0	
  over	
  Servlet	
  4.0	
  
Influenced	
  by	
  Jersey	
  MVC	
  Templates	
  
Appears	
  to	
  direct	
  compete	
  with	
  Spring	
  MVC	
  
Xenonique @peter_pilgrim 50	
  
#6	
  MVC	
  1.0	
  
	
  
How	
  to	
  customise	
  the	
  view	
  layer?	
  
Facelets,	
  Mustache,	
  Handlebars,	
  JSP	
  
Expression	
  language	
  and	
  glue	
  logic?	
  
bind	
  the	
  model	
  to	
  the	
  view	
  and	
  Bean	
  ValidaNon	
  
What	
  is	
  the	
  Lifecycle?	
  
How	
  long	
  do	
  POJOs	
  live	
  within	
  the	
  framework	
  (CDI)	
  
Xenonique @peter_pilgrim 51	
  
#6	
  MVC	
  1.0	
  
	
  
Looks	
  a	
  good	
  fit	
  for	
  AngularJS	
  
single	
  page	
  applicaNons	
  with	
  EmberJS	
  
IntegraTon	
  JAX-­‐RS	
  provide	
  duality	
  
Define	
  regular	
  RESTful	
  endpoints	
  and	
  controller	
  
Solo	
  API	
  suits	
  the	
  Web	
  Profile	
  
MVC	
  may	
  be	
  bundle	
  with	
  GlassFish	
  Web,	
  Tomcat,	
  Undertow	
  
Xenonique @peter_pilgrim
MVC 1.0 Example
@Path("payments")
@Controller
public class PaymentsEndpoint {
@GET
@Path("accounts")
public Viewable get() {

 
PaymentDataModel model = somewhere();
return new Viewable(
"list-accounts.jsp", model);
}
} /* API is still changeable */

52	
  
Xenonique @peter_pilgrim 53	
  
Xenonique @peter_pilgrim 54	
  
#Conclusion(1)
Going Digital with Java EE 7
Perfectly feasible.
What do you want?
What is it do you really to do?
Xenonique @peter_pilgrim 55	
  
#Conclusion(2)
Micro-services? Check.
Transactions? Check ✔
Concurrency? Check ✔
Persistence? Check ✔
REST? Check ✔
Standard platform? Check ✔
Xenonique @peter_pilgrim 56	
  
#Conclusion(3)
Agility? Fast turnaround?
Testable? Definitely check ✔
Recruitable? Absolutely ✔
Dependable? ✔
Extendible? ✔
Trainable? But of course ✔
Xenonique @peter_pilgrim 57	
  
#Conclusion(4)
Seriously look at Faces Flows
Build small units of functionality in the web (generally)
Allow for shake up & down from User Experience Testing
Keep an eye on MVC 1.0 and JAX-RS 2.1
Open source libraries need to adopt and catch up!
Xenonique @peter_pilgrim 58	
  
May 2014
Xenonique @peter_pilgrim 59	
  
@peter_pilgrim	
  
uk.linkedin.com/in/peterpilgrim2000/	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://flic.kr/p/dhf3FQ
https://www.flickr.com/photos/epsos/
epSos.de
Big Beautiful Face Statue in Tenerife
https://flic.kr/p/Pp93n
https://www.flickr.com/photos/spacesuitcatalyst/
William A. Clark Follow
Measurement
Measure twice, cut once.
https://flic.kr/p/opvVsg
https://www.flickr.com/photos/gregbeatty/
Greg Beatty Follow
Three Pillars
Nikon D800 16-35MM F4.0
https://flic.kr/p/81dXuT
https://www.flickr.com/photos/froboy/
Avi Schwab Follow
Equipment used for measuring planes of crystals
60	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://flic.kr/p/ayqvZp
https://www.flickr.com/photos/throughpaintedeyes/
Ryan Seyeau Follow
1000 Faces of Canada # 0084 - Zombie Walk - Explore!
Shot during the annual Zombie Walk in Ottawa.
https://flic.kr/p/8XY4tr
https://www.flickr.com/photos/creative_stock/
Creativity 103
electronic circuit board
https://flic.kr/p/8Y2625
https://www.flickr.com/photos/creative_stock/
Creativity 103
computer motherboard tracks
https://flic.kr/p/2QHt7Q
https://www.flickr.com/photos/rosefirerising/
rosefirerising Follow
Pierre Curie, Piezo-Electroscope
61	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://www.flickr.com/photos/code_martial/
https://flic.kr/p/7jmU5n
Tahir Hashmi Follow
Developer Death
10 Programmers and a UX Designer died all of a sudden in a war room situation. They were
apparently working too hard.
https://www.flickr.com/photos/8268882@N06/
https://flic.kr/p/duwd1M
Peter Pilgrim
IMG_1481
European JUG leaders meeting in Devoxx 2013
https://www.flickr.com/photos/unicefethiopia/
https://flic.kr/p/dv4ooi
UNICEF Ethiopia Follow
Hamer mother and child South Omo Zone, SNNPR
Hamer mother and child South Omo Zone, SNNPR.
©UNICEF Ethiopia/2005/Getachew
62	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://www.flickr.com/photos/15216811@N06/
https://flic.kr/p/baULpM
N i c o l a Follow
Tree - IMG_1242
https://flic.kr/p/dwCQ7t
https://www.flickr.com/photos/90585146@N08/
marsmetn tallahassee Follow
IDA .. Integro-Differential Analyzer (Sept., 1952) ...item 2.. Richard Dreyfuss: Technology Has 'Killed Time' -- "In geopolitics, the
removal of time is fatal." -- "And you will give up, the protection of Republican Democracy." (July 19 2010) ...
https://flic.kr/p/6ZDbiZ
https://www.flickr.com/photos/ingmar/
Ingmar Zahorsky Follow
Traffic Jam
Accidents are common on the narrow streets going through the mountains of Nepal. When such an accident occurs, traffic is often
halted for up to 3-4 hours.
https://flic.kr/p/FAskC
https://www.flickr.com/photos/mari1008/
mari_1008 Follow
traffic jam -B
Date: April,2th
Address: Jiangshu Rd,Shanghai,China.
Around 8:30 AM today, A little accident on YuYuan Rd and JiangSu Rd caused traffic jam.
63	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://flic.kr/p/bpss6D
https://www.flickr.com/photos/76029035@N02/
Victor1558 Follow
Creative_Photoshop_HD_Wallpapers_laba.ws
https://flic.kr/p/mLxu3m
https://www.flickr.com/photos/astrangelyisolatedplace/
astrangelyisolatedplace Follow
Office test #1. Setup fully functional. A rare 1200 no longer in production. Test run
soundtracked by the only #vinyl in the office; The Sesame Street Soundtrack - a
surprise present by @idinesh #technics #turntable #1200 #ocdv1
via Instagram ift.tt/1hpeUEU
https://flic.kr/p/gLPhEk
https://www.flickr.com/photos/stevecorey/
Steve Corey Follow
Treasure Hunt, a short story (5 images)
64	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://flic.kr/p/4JcerK
https://www.flickr.com/photos/16949884@N00/
Bömmel Follow
Ice Crystal
Ice is nice
https://flic.kr/p/dSsXiZ
https://www.flickr.com/photos/jeremyhall/
Jeremy Hall Follow
Called to Serve (suit and tie)
https://flic.kr/p/3enERy
https://www.flickr.com/photos/paolocampioni/
Paolo Campioni Follow
scala
Scendo (stair case spiral)
65	
  
Xenonique @peter_pilgrim
List of Creative Commons (2.0)
photography attributions
https://flic.kr/p/m62gmK
https://www.flickr.com/photos/lata/
-p Follow
Abstraction I.
From my platycerium. (Guide: Voronoi diagram)
https://flic.kr/p/9F7Nnn
https://www.flickr.com/photos/followtheseinstructions/
Follow these instructions
The end ; Assignment: This time your assignment is to find or compose a scene that conveys the essence of the end.
https://flic.kr/p/6WSFR4
https://www.flickr.com/photos/62337512@N00/
anthony kelly Follow
big ben
big ben and underground sign
https://flic.kr/p/w7qef
https://www.flickr.com/photos/cobalt/
cobalt123 Follow
All We are Saying... (Thought for a New Year)
Peace Pasta from Annie's, with peas, of course.
Give Peace A Chance
66	
  

More Related Content

PPTX
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
PDF
AOTB2014: Agile Testing on the Java Platform
PDF
CDI In Real Life
PDF
CDI 2.0 is coming
KEY
Using Vagrant for Rails development
PDF
Extending Java EE with CDI and JBoss Forge
PDF
Hybrid Apps (Native + Web) via QtWebKit
PDF
The path to cdi 2.0
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
AOTB2014: Agile Testing on the Java Platform
CDI In Real Life
CDI 2.0 is coming
Using Vagrant for Rails development
Extending Java EE with CDI and JBoss Forge
Hybrid Apps (Native + Web) via QtWebKit
The path to cdi 2.0

What's hot (20)

PPT
Choosing a Java Web Framework
PDF
CDI 1.1 university
PDF
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
PDF
Introduction to cdi given at java one 2014
PDF
CDI 2.0 is upon us Devoxx
PDF
Apache Deltaspike the CDI Toolbox (Java One 2015)
PPT
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
PDF
CDI 2.0 is coming
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
PDF
Functional Reactive Programming in the Netflix API
PDF
Advanced CDI in live coding
PPTX
Clean Pragmatic Architecture - Avoiding a Monolith
PDF
Front End Development for Backend Developers - GIDS 2019
PDF
RESTful API Design & Implementation with CodeIgniter PHP Framework
PDF
Bootiful Development with Spring Boot and React - UberConf 2018
PDF
A Gentle Introduction to Angular Schematics - Devoxx Belgium 2019
PDF
Asynchronous Programming at Netflix
PDF
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
PDF
A Gentle Introduction to Angular Schematics - Angular SF 2019
PDF
Microservices: Improving the autonomy of our teams with Event-Driven Architec...
Choosing a Java Web Framework
CDI 1.1 university
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Introduction to cdi given at java one 2014
CDI 2.0 is upon us Devoxx
Apache Deltaspike the CDI Toolbox (Java One 2015)
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
CDI 2.0 is coming
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Functional Reactive Programming in the Netflix API
Advanced CDI in live coding
Clean Pragmatic Architecture - Avoiding a Monolith
Front End Development for Backend Developers - GIDS 2019
RESTful API Design & Implementation with CodeIgniter PHP Framework
Bootiful Development with Spring Boot and React - UberConf 2018
A Gentle Introduction to Angular Schematics - Devoxx Belgium 2019
Asynchronous Programming at Netflix
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
A Gentle Introduction to Angular Schematics - Angular SF 2019
Microservices: Improving the autonomy of our teams with Event-Driven Architec...
Ad

Similar to Java EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy (20)

PDF
Embedding WPE WebKit - from Bring-up to Maintenance
PDF
How to debug IoT Agents
PDF
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
PDF
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
PDF
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
PDF
カエルと実践するコンテナ
PPTX
20191201 kubernetes managed weblogic revival - part 2
KEY
Play Support in Cloud Foundry
PPTX
FIWARE Wednesday Webinars - How to Debug IoT Agents
PDF
Cloud native - CI/CD
PDF
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
PDF
Java REST API Framework Comparison - UberConf 2021
PDF
The Kubernetes WebLogic revival (part 2)
PDF
はじめての JFrog Artifactory
PDF
Landscape of Eclipse MicroProfile Tools
PDF
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
PPTX
Retirement Studio Web Projects Knowledge Sharing
PDF
Package your Java EE Application using Docker and Kubernetes
PDF
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
PDF
Java REST API Framework Comparison - PWX 2021
Embedding WPE WebKit - from Bring-up to Maintenance
How to debug IoT Agents
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
カエルと実践するコンテナ
20191201 kubernetes managed weblogic revival - part 2
Play Support in Cloud Foundry
FIWARE Wednesday Webinars - How to Debug IoT Agents
Cloud native - CI/CD
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Java REST API Framework Comparison - UberConf 2021
The Kubernetes WebLogic revival (part 2)
はじめての JFrog Artifactory
Landscape of Eclipse MicroProfile Tools
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
Retirement Studio Web Projects Knowledge Sharing
Package your Java EE Application using Docker and Kubernetes
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
Java REST API Framework Comparison - PWX 2021
Ad

More from Peter Pilgrim (12)

PDF
Devoxx 2019 - Why we pair?
PDF
Cloud native java are we there yet go tech world 2019
PDF
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
PDF
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
PDF
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
PDF
BOF2644 Developing Java EE 7 Scala apps
PDF
JavaCro 2014 Scala and Java EE 7 Development Experiences
PDF
JavaCro 2014 Digital Development with Java EE and Java Platform
PDF
ACCU 2013 Taking Scala into the Enterpise
PDF
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
PDF
JavaOne 2011 Progressive JavaFX 2.0 Custom Components
PDF
ACCU 2011 Introduction to Scala: An Object Functional Programming Language
Devoxx 2019 - Why we pair?
Cloud native java are we there yet go tech world 2019
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
BOF2644 Developing Java EE 7 Scala apps
JavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Digital Development with Java EE and Java Platform
ACCU 2013 Taking Scala into the Enterpise
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
JavaOne 2011 Progressive JavaFX 2.0 Custom Components
ACCU 2011 Introduction to Scala: An Object Functional Programming Language

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
MYSQL Presentation for SQL database connectivity
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MYSQL Presentation for SQL database connectivity
MIND Revenue Release Quarter 2 2025 Press Release
Review of recent advances in non-invasive hemoglobin estimation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Understanding_Digital_Forensics_Presentation.pptx

Java EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy

  • 1. DIGITAL Java EE 7 New and NOTEWORTHY Enterprise Java Lives! (18-02-2015) Peter Pilgrim Scala and Java EE Independent contractor @peter_pilgrim  
  • 3. Xenonique @peter_pilgrim 3   Agenda •  Digital •  Java EE 7 •  Java EE Web Technology
  • 4. Xenonique @peter_pilgrim Creative Commons 2.0 Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales (CC BY-NC-SA 2.0 UK) https://creativecommons.org/licenses/by-nc-sa/2.0/uk/ •  Share — copy and redistribute the material in any medium or format •  Adapt — remix, transform, and build upon the material •  The licensor cannot revoke these freedoms as long as you follow the license terms. 4  
  • 5. Xenonique @peter_pilgrim About Me •  Java EE and Scala developer independent contractor •  Digital transformation / e-commerce •  Java Champion •  Working on the JVM since 1998 5  
  • 7. Xenonique @peter_pilgrim 7   Why the fuss about so-called Digital? Haven’t we seen this all before?
  • 9. Xenonique @peter_pilgrim 9   #1 Digital Fast. Agile. User Centric. Focus on the end-user Emphasis on Testing User Experience is significant
  • 10. Xenonique @peter_pilgrim 10   #1 Digital Digital is the Web Digital is refocusing ideas for online activities
  • 11. Xenonique @peter_pilgrim 11   #1 Digital Digital is an attitude Listening to customer needs Embracing conversation and communication
  • 12. Xenonique @peter_pilgrim 12   #1 Digital Transformation of our traditional industrial Economy to a 21st Century Mobile to Default one
  • 13. Xenonique @peter_pilgrim 13   #1 Digital With all of the consequences: politics, society, technology and web infrastructure.
  • 15. Xenonique @peter_pilgrim 15   Is Java EE helpful to digital developers, designers and architect? Still relevant?
  • 16. Xenonique @peter_pilgrim 16   Java EE 7 released 2013 Built products on top of a standard platform Transactions, Concurrency, Remote Endpoints, Lifecycle, State, Persistence Java is a programming language. Java is a virtual machine. Java is a platform.
  • 17. Xenonique @peter_pilgrim 17   Java  EE  7  
  • 19. Xenonique @peter_pilgrim Main Features •  CDI 1.1 •  JAX-RS 2 •  JSF 2.2 •  Servlet 3.1 •  EJB 3.1 •  JPA 2.1 19  
  • 20. Xenonique @peter_pilgrim 20   #2 WAR is king (or queen) WAR files are now the prefer way to deploy applications for most set-ups EAR files are still supported however RAR files are even rarer (Resource ARchive) PAR files are even rarer still (Persistence ARchive)
  • 21. Xenonique @peter_pilgrim 21   #2 Containerless Suits the Docker / chef / Puppet vis-à-vis the provisioning generation Prefer starting up embeddable application server GlassFish or WildFly server over deployment WARs Sadly: Code Hale’s DropWizard only supports Java EE 6
  • 22. Xenonique @peter_pilgrim 22   #2 Containerless Suits the Docker / chef / Puppet vis-à-vis the provisioning generation Prefer starting up embeddable application server GlassFish or WildFly server over deployment WARs Sadly: Code Hale’s DropWizard only supports Java EE 6
  • 23. Xenonique @peter_pilgrim 23   #2 Testable Java EE Arquillian Helps with real-world integration testing Embeddable Container Also help with direct EJB, JPA, JMS testing
  • 24. Xenonique @peter_pilgrim 24   #2 Java EE better Async Support Servlet 3.1 has Async support Non-Blocking I/O, HTTP Upgrade mechanism JAX RS 2.0 has Async support Client side API with HATEOS, Filters and Handlers WebSocket 1.0 (Async by default, by protocol) JMS 2.0 (when used in standalone Java SE) Asynchronous API for Reactive Programming yet to be exploited by other frameworks
  • 25. Xenonique @peter_pilgrim 25   Java EE 7 Developer Handbook September  2013   Packt  Publishing     Digital Java EE 7 Web APPS May  2015  
  • 27. Xenonique @peter_pilgrim 27   Java Server Faces An Component Oriented Framework
  • 28. Xenonique @peter_pilgrim 28   CDI & Faces Scopes @RequestScoped @SessionScoped @ApplicationScoped @ViewScoped* @ConversationScoped* @FlowScoped*
  • 29. Xenonique @peter_pilgrim 29   #3 View Scoped Retained Page View Scope HTTL Form Data lives for validation Customer sees their input data entered after entering errors Helpful for digital web site
  • 30. Xenonique @peter_pilgrim 30   #3 View Scoped Lifecycle dies on a new page view Minable effort for digital developers Helpful for single page forms Login forms, small data entry journeys Already in existence since Java EE 6
  • 31. Xenonique @peter_pilgrim 31   #3 CDI and EJB CDI is really useful for code assembly Depend on session EJB less Helpful for single page forms Login forms, small data entry journeys Already in existence since Java EE 6
  • 32. Xenonique @peter_pilgrim View Scope @Named("contactDetailController") @ViewScoped public class ContactDetailController { @EJB ContactDetailService service; private ContactDetail contactDetail = new ContactDetail(); /* ... */ } 32  
  • 33. Xenonique @peter_pilgrim 33   #4 Conversation Scoped Basic Customer Journey Actually existed since Java EE 6 Transient or Persistent Developer controls the life cycle
  • 34. Xenonique @peter_pilgrim 34   #4 Conversation Scoped Complex Wizard Type Flows Lifecycle between Request and Session Scope Backing Bean must be Serializable Solves a long standing problem with Java Servlet technology with storing items in HttpSession
  • 35. Xenonique @peter_pilgrim Conversation Scope @Named("lendingController") @ConversationScoped public class LendingController implements Serializable { @EJB ApplicantService applicantService; @Inject Conversation conversation; @Inject Utility utility; /* ... */ } 35  
  • 37. Xenonique @peter_pilgrim Conversation Scope public class LendingController { /* ... */ public void checkAndStart() { if ( conversation.isTransient()) { conversation.begin(); } recalculatePaymentMonthlyTerm(); } public void checkAndEnd() { if (!conversation.isTransient()) { conversation.end(); } } } 37  
  • 38. Xenonique @peter_pilgrim 38   #5 Flow Scoped Underrated Star of JSF 2.2 Lifecycle between Request and Session Scope Controller, resources & page views with protected and encapsulated access
  • 39. Xenonique @peter_pilgrim 39   #5 Flow Scoped Flow can be implicit Can be explicitly defined with XML A Flow has one single entry point A Flow has at least one exit point
  • 40. Xenonique @peter_pilgrim 40   #5 Flow Scoped Flow can invoke another one Faces Flow are nestable Inbound named parameters Outbound named parameters Special flowScope map collection
  • 41. Xenonique @peter_pilgrim 41   #5 Flow Scoped Custom Flow Components Distribute Faces Flows defined in 3rd party JARs Resource Library Contracts Apply CSS, JavaScript and resources Special flow scope map collection To pass data in between Faces Flows
  • 42. Xenonique @peter_pilgrim Flow Scoped (Sector) @Named @FlowScoped("sector-flow") public class SectorFlow implements Serializable { @Inject UtilityHelper utilityHelper; @Inject CarbonFootprintService service; /* ... */ } 42  
  • 43. Xenonique @peter_pilgrim Flow Scoped (Sector) public class SectorFlow { /*...*/ @PostConstruct public void initialize() { footprint.setApplicationId( utilityHelper.getNextApplicationId()); } public String gotoEndFlow() { return "/endflow.xhtml"; } } 43  
  • 44. Xenonique @peter_pilgrim Flow Scoped (Sector) <faces-config version="2.2" ...> <flow-definition id="sector-flow"> <flow-return id="goHome"> <from-outcome>/index</from-outcome> </flow-return> <flow-return id="endFlow"> <from-outcome>#{sectorFlow.gotoEndFlow()} </from-outcome> </flow-return> ... </faces-config> 44  
  • 45. Xenonique @peter_pilgrim Flow Scoped (Sector) <faces-config version="2.2" ...> ... <flow-call id="callFootprintFlow"> <flow-reference> <flow-id>footprint-flow</flow-id> </flow-reference> <outbound-parameter> <name>param3FromSectorFlow</name> <value>#{sectorFlow.footprint}</value> </outbound-parameter> </flow-call> </flow-definition> </faces-config> 45  
  • 46. Xenonique @peter_pilgrim Flow Scoped (Footprint) @Named @FlowScoped("footprint-flow") public class FootprintFlow implements Serializable { private CarbonFootprint footprint; public FootprintFlow() { } @PostConstruct public void initialize() {} Map<Object,Object> flowMap = FacesContext.getCurrentInstance() .getApplication().getFlowHandler() .getCurrentFlowScope(); footprint = (CarbonFootprint) flowMap.get("param3Value"); } } 46  
  • 48. Xenonique @peter_pilgrim 48   #6  MVC  1.0     Targeting Java EE 8 JSR 371 Model View Controller Action Oriented Request Framework
  • 49. Xenonique @peter_pilgrim 49   #6  MVC  1.0     Separate  View  layer  to  JSF   Standardising  on  Java  RS  2.0  over  Servlet  4.0   Influenced  by  Jersey  MVC  Templates   Appears  to  direct  compete  with  Spring  MVC  
  • 50. Xenonique @peter_pilgrim 50   #6  MVC  1.0     How  to  customise  the  view  layer?   Facelets,  Mustache,  Handlebars,  JSP   Expression  language  and  glue  logic?   bind  the  model  to  the  view  and  Bean  ValidaNon   What  is  the  Lifecycle?   How  long  do  POJOs  live  within  the  framework  (CDI)  
  • 51. Xenonique @peter_pilgrim 51   #6  MVC  1.0     Looks  a  good  fit  for  AngularJS   single  page  applicaNons  with  EmberJS   IntegraTon  JAX-­‐RS  provide  duality   Define  regular  RESTful  endpoints  and  controller   Solo  API  suits  the  Web  Profile   MVC  may  be  bundle  with  GlassFish  Web,  Tomcat,  Undertow  
  • 52. Xenonique @peter_pilgrim MVC 1.0 Example @Path("payments") @Controller public class PaymentsEndpoint { @GET @Path("accounts") public Viewable get() { PaymentDataModel model = somewhere(); return new Viewable( "list-accounts.jsp", model); } } /* API is still changeable */ 52  
  • 54. Xenonique @peter_pilgrim 54   #Conclusion(1) Going Digital with Java EE 7 Perfectly feasible. What do you want? What is it do you really to do?
  • 55. Xenonique @peter_pilgrim 55   #Conclusion(2) Micro-services? Check. Transactions? Check ✔ Concurrency? Check ✔ Persistence? Check ✔ REST? Check ✔ Standard platform? Check ✔
  • 56. Xenonique @peter_pilgrim 56   #Conclusion(3) Agility? Fast turnaround? Testable? Definitely check ✔ Recruitable? Absolutely ✔ Dependable? ✔ Extendible? ✔ Trainable? But of course ✔
  • 57. Xenonique @peter_pilgrim 57   #Conclusion(4) Seriously look at Faces Flows Build small units of functionality in the web (generally) Allow for shake up & down from User Experience Testing Keep an eye on MVC 1.0 and JAX-RS 2.1 Open source libraries need to adopt and catch up!
  • 59. Xenonique @peter_pilgrim 59   @peter_pilgrim   uk.linkedin.com/in/peterpilgrim2000/  
  • 60. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://flic.kr/p/dhf3FQ https://www.flickr.com/photos/epsos/ epSos.de Big Beautiful Face Statue in Tenerife https://flic.kr/p/Pp93n https://www.flickr.com/photos/spacesuitcatalyst/ William A. Clark Follow Measurement Measure twice, cut once. https://flic.kr/p/opvVsg https://www.flickr.com/photos/gregbeatty/ Greg Beatty Follow Three Pillars Nikon D800 16-35MM F4.0 https://flic.kr/p/81dXuT https://www.flickr.com/photos/froboy/ Avi Schwab Follow Equipment used for measuring planes of crystals 60  
  • 61. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://flic.kr/p/ayqvZp https://www.flickr.com/photos/throughpaintedeyes/ Ryan Seyeau Follow 1000 Faces of Canada # 0084 - Zombie Walk - Explore! Shot during the annual Zombie Walk in Ottawa. https://flic.kr/p/8XY4tr https://www.flickr.com/photos/creative_stock/ Creativity 103 electronic circuit board https://flic.kr/p/8Y2625 https://www.flickr.com/photos/creative_stock/ Creativity 103 computer motherboard tracks https://flic.kr/p/2QHt7Q https://www.flickr.com/photos/rosefirerising/ rosefirerising Follow Pierre Curie, Piezo-Electroscope 61  
  • 62. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://www.flickr.com/photos/code_martial/ https://flic.kr/p/7jmU5n Tahir Hashmi Follow Developer Death 10 Programmers and a UX Designer died all of a sudden in a war room situation. They were apparently working too hard. https://www.flickr.com/photos/8268882@N06/ https://flic.kr/p/duwd1M Peter Pilgrim IMG_1481 European JUG leaders meeting in Devoxx 2013 https://www.flickr.com/photos/unicefethiopia/ https://flic.kr/p/dv4ooi UNICEF Ethiopia Follow Hamer mother and child South Omo Zone, SNNPR Hamer mother and child South Omo Zone, SNNPR. ©UNICEF Ethiopia/2005/Getachew 62  
  • 63. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://www.flickr.com/photos/15216811@N06/ https://flic.kr/p/baULpM N i c o l a Follow Tree - IMG_1242 https://flic.kr/p/dwCQ7t https://www.flickr.com/photos/90585146@N08/ marsmetn tallahassee Follow IDA .. Integro-Differential Analyzer (Sept., 1952) ...item 2.. Richard Dreyfuss: Technology Has 'Killed Time' -- "In geopolitics, the removal of time is fatal." -- "And you will give up, the protection of Republican Democracy." (July 19 2010) ... https://flic.kr/p/6ZDbiZ https://www.flickr.com/photos/ingmar/ Ingmar Zahorsky Follow Traffic Jam Accidents are common on the narrow streets going through the mountains of Nepal. When such an accident occurs, traffic is often halted for up to 3-4 hours. https://flic.kr/p/FAskC https://www.flickr.com/photos/mari1008/ mari_1008 Follow traffic jam -B Date: April,2th Address: Jiangshu Rd,Shanghai,China. Around 8:30 AM today, A little accident on YuYuan Rd and JiangSu Rd caused traffic jam. 63  
  • 64. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://flic.kr/p/bpss6D https://www.flickr.com/photos/76029035@N02/ Victor1558 Follow Creative_Photoshop_HD_Wallpapers_laba.ws https://flic.kr/p/mLxu3m https://www.flickr.com/photos/astrangelyisolatedplace/ astrangelyisolatedplace Follow Office test #1. Setup fully functional. A rare 1200 no longer in production. Test run soundtracked by the only #vinyl in the office; The Sesame Street Soundtrack - a surprise present by @idinesh #technics #turntable #1200 #ocdv1 via Instagram ift.tt/1hpeUEU https://flic.kr/p/gLPhEk https://www.flickr.com/photos/stevecorey/ Steve Corey Follow Treasure Hunt, a short story (5 images) 64  
  • 65. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://flic.kr/p/4JcerK https://www.flickr.com/photos/16949884@N00/ Bömmel Follow Ice Crystal Ice is nice https://flic.kr/p/dSsXiZ https://www.flickr.com/photos/jeremyhall/ Jeremy Hall Follow Called to Serve (suit and tie) https://flic.kr/p/3enERy https://www.flickr.com/photos/paolocampioni/ Paolo Campioni Follow scala Scendo (stair case spiral) 65  
  • 66. Xenonique @peter_pilgrim List of Creative Commons (2.0) photography attributions https://flic.kr/p/m62gmK https://www.flickr.com/photos/lata/ -p Follow Abstraction I. From my platycerium. (Guide: Voronoi diagram) https://flic.kr/p/9F7Nnn https://www.flickr.com/photos/followtheseinstructions/ Follow these instructions The end ; Assignment: This time your assignment is to find or compose a scene that conveys the essence of the end. https://flic.kr/p/6WSFR4 https://www.flickr.com/photos/62337512@N00/ anthony kelly Follow big ben big ben and underground sign https://flic.kr/p/w7qef https://www.flickr.com/photos/cobalt/ cobalt123 Follow All We are Saying... (Thought for a New Year) Peace Pasta from Annie's, with peas, of course. Give Peace A Chance 66