Java EE 6 is an awesome platform, but how do you design a system that can evolve for many years in production? And how do we run this stuff in the cloud?
Designing a system that can evolve without creating a maintenance nightmare is far from trivial. A service oriented, modular architecture will help a lot to replace parts of a system without breaking others. The only mature modularity approach for Java is OSGi - a framework that enables low-level modularity and services, but you still need APIs to create web applications, use transactions, access data sources etc. Without these APIs you will have a hard time building applications. Unfortunately OSGi and Java EE did not interoperate well in the past; But what if we want modularity in our architecture but also the ease-of-use of Java EE 6?
In this university you will:
1. Understand the benefits of a modular code base
2. Learn how to mix OSGi and Java EE
3. Manage modular cloud deployments using Apache ACE
..and of course there will be lots of live coding!
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Modular Java EE in the Cloud
1. Modular Java EE
in the cloud
ng java EE a nd OSGi
rac tical guid e to mixi
Ap
2. Bert Ertman
Fellow at Luminis in the Netherlands
JUG Leader for NLJUG and a Java Champion
@bertertman
Paul Bakker
Architect at Luminis Technologies
@pbakker
A presentation for
3. Trend
Applications tend to grow bigger and
more complex
Agile development and refactoring
have become more common
4. Th is leads to a number of challenges :
D ependency Versioning
Man agement
Maintenance Deployment
(long term)
5. Apps are moving to the cloud
Cloud challenges require non-
trivial non-functional
requirements
Zero-downtime deployments
Modular deployments
Customer specific extensions
(SaaS)
16. Design time
modularity
Divide and conquer
Forces separation of concerns
Prevents spaghetti
17. The jar file is the unit of
runtime modularity
on the Java platform
What about
classpath
hell?
18. How to deal with
Runtime dynamics
Module versioning
Updating single modules
Intra-module dependency
management
19. Runtime
Architectural
design dynamic
What do we need?
focus on
equences module
cons modularity
framework
let’s not
High-level Right now,
reinvent the
enterprise APIs OSGi is the
wheel
only option
21. OSGi != modularity
OSGi is the de-facto remember!
Modularity is
standard module an architectural
principle
system for Java
What about Jigsaw?
22. OSGi != modularity
OSGi is the de-facto remember!
Modularity is
standard module an architectural
principle
system for Java
Modularity
does not come
for free with a
What about Jigsaw?
framework
25. OSGi vs. Java EE : opposite ends?
Java EE:
high level
APIs
OSGi:
low-level, mix
and match
yourself
26. OSGi vs. Java EE : opposite ends?
Java EE:
high level
APIs
They don’t
have to be
either / or OSGi:
low-level, mix
and match
yourself
27. How? - 3 options
#2
#1 #3
O SG i as core Hybrid solution
arc hit ecture with using an
Is publishe d injection bridge OSGi a la carte
EE AP
as services
28. Option 1 - OSGi in Java EE App Servers
use app server
capabilities like
OSGi bundles as clustering, data
sources, etc.
your core
prog ramming Java EE APIs
model available from
within bundles the
(near)
future!
29. Web Application Bundle (WAB)
Enterprise
OSGi Easy
standard registration
of Servlets
and JAX-RS
WAR with a components
manifest
31. EJB Bundles
Not a standard yet!
Use transactions
and JPA like you
Publish EJBs
normally would
as OSGi
services
32. EJB Bundles
manifest.mf
Bundle-Name:
agenda.storage.ejb
Export-EJB: ALL
33. OSGi CDI integration
RFP 146
Prototyped in
WELD
Use CDI
within Use CDI to
bundles produce /
consume
services
34. How are the app servers doing?
Deploy EJB/JPA
App server WAB support
bundles support
Glassfish
WebSphere
WebLogic
JBoss AS
35. Option 2 : Hybrid solution
Best of both worlds?
Your app is effectively split into two parts:
‘Adminstrative’ enterprise part -> Java EE
‘Dynamic’ part where services can be replaced
without downtime -> OSGi
Glue the two together using an ‘injection bridge’
43. What have we learned?
You’ve seen the future of enterpris
e development ;-)
Why modularity is important (in
the cloud)
Practical solution for doing modu
larity now
44. Want to try this yourself?
Tomorrow 9.30 am
Hands-on Lab:
Building Modular Enterprise Applications
Room: BOF 2