Java EE's Evolution and Relevance
Java EE's Evolution and Relevance
By
Azrul MADISA
azrul.madisa@my.experian.com
1
A brief history of Java EE
2
3
What’s happening of late
4
Oracle acquisition of Sun
The pathetic prophets
“Java is slipping on tiobe! Java is going to die!!
Would somebody please think of the
children!!”
Onslaught of new languages/technologies
Is Java in midlife crisis?
5
What history teaches us
6
Java will always adapt
7
“The simple fact remains, then: Java, the
platform, the ecosystem, the environment and
the development community, stands at least as
far from the Abyss of Irrelevancy as any of the
other languages or platforms currently in use
today” – Ted Neward
8
9
Old and reliable
Patterns
Distributed computing
Messaging
Transaction
management
Load balancing
10
New
11
Context and Dependency
Injection
12
Contexts and Dependency
Inject - CDI
JSR-299
Type-safe DI, AOP
and Eventing
Use annotation a
whole lot to achieve
a whole lot more
13
CDI vs. the world
“…more typesafe than Seam, more
stateful and less XML-centric than
Spring, more web and enterprise
application capable than Guice” – Gavin
King, JSR-299 spec lead
14
CDI Dependency Injection (DI)
Typesafe
DI with qualifier
15
CDI – DI example
@MyService(PRODUCTION)
public class ProductionShoppingCart implements
ShoppingCart{…}
@MyService(MOCK)
public class MockShoppingCart implements
ShoppingCart{…}
16
CDI – DI example
Injecting a shopping cart to a servlet
17
CDI Eventing
Light weight eventing
Decouple sender and recipient
Similar to JMS
Can use JMS as a broker
POJO
POJO POJO
18
CDI Eventing
Create the object to be send
19
CDI Eventing
Create a sender
20
CDI Eventing
Create a listener
21
Challenge
22
Java Enterprise Application
In 1 week
Alone
Make it work
23
Problem
24
Enterprise Job Scheduling App
At a scheduled time
Launch a business process
25
Enterprise Job Scheduling App
Examples:
Telcos
Every week, all usage data need to be processed.
Invoices and bills need to be created
Banks
Every night, all credit card applications for the day need
to be processed
Insurance
Underwriting for new applications need to be done every
3 working days
26
27
How it works – Telco example
Business Process
28
Challenges in creating a scheduler
Scheduler need an interface
Preferable web
Scheduler should be modifiable
Scheduler should be loosely coupled from the
BP
BP can change without affecting the scheduler
Vice-versa
Scheduler should use standards as much as
possible
Standard scheduling expression
29
Challenges in creating a
business process
BP needs to be scalable
but cannot be “truly” stateless – since BP are
stateful by nature
BP needs to be somewhat standard
The standard, BPEL, is too web-services centric
BP needs a decent tool
BP is loosely coupled from jobs
Jobs can change without affecting BP
BP can change without affecting jobs
30
Challenges in creating a job
Job need to be asynchronous
but need to be chained – i.e. “fire and forget” cannot be
used here
Job need to be simple to create
Tool support is needed
Job need to be a standard artefact
Easier to recruit people who knows standard stuff
Testability of a job is crucial
Job need to be as POJO as possible
Job contain business logic
Transaction is crucial
31
Challenges in the system as a
whole
Load-balancing capable
Transactional
Rollback / redo
Use standard solution wherever possible
32
Answering the challenge
33
Answering the challenge –
transactional jobs
<<MDB>>
JMS <<POJO>>
-------------------
---------------
BusinessProcess
BusinessLogic
Step1 <<MDB>>
---------------
Delegate CDI Event
Step2
Step3
JMS
34
Answering the challenge –
lightweight jobs
<<MDB>>
<<POJO>>
-------------------
---------------
BusinessProcess
BusinessLogic
Step1
CDI Event
Step2
Step3
35
Answering the challenge
A job:
36
Delivering promises
Simplicity
Job’s a POJO
Scalability
JMS and asynchronous, event based framework
Lightweight
CDI eventing
Statefulness
JBPM + Request-response pattern
37
Delivering promises
Reliability
Transaction all the way – even in
lightweight mode
Java EE provided clustering/fallback
JMS provided load-balancing
Scheduler
39
Conclusion
Java is old and reliable and yet new and
exciting
Don’t want to use the Java language,
stick to the platform and use :
Scala
Groovy
Anything…
Java is well, alive and kicking butts …
really hard!
40
Thanks for listening to someone
who is not yet on a midlife crisis
Azrul MADISA
azrul.madisa@my.experian.com
41