The talk presented by Peter Pilgrim at the London JavaEE & GlassFish User Group event on the 18th of February 2015.
find out more at: http://payara.co/february_london_glassfish_user_group_with_peter
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
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.
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
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
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
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
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
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!
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
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