SlideShare uma empresa Scribd logo
1 de 49
Java EE 6 & Spring: A Lover’s Quarrel
Derrick Kittler
Mauricio “Maltron” Leal
Vamsi Chemitiganti
Agenda
o The goal of this talk
o Evolution of Spring
o Evolution of Java EE 6
o Side-by-Side
o Migrating
o Java EE 6 and Spring Coexistence
o Conclusion
Fair Comparison
Orange Apple
Fair Comparison: NOT
Specification
Java EE 6
Technology Framework
Fair Comparison
Java EE 6
Approach to a Enterprise Solution !!
If can’t beat them, join them !!!!
Java EE 6
Sometimes, a join solution can be the best approach
Java EE 6
The goal of this talk is NOT…
Compare both
technologies and declare
a winner
The goal of this talk is…
• How to deliver a
good enterprise
application
• Evaluate both
technologies
• Show some
migration path (only
when makes
sense)
Technology Choice: The big picture
Java EE 6
Evolution of Spring
Dependecy
Injection
POJO
oriented
development
Declarative
AOP &
transactions
MVC
Framework
Proble Specific
XML
Extensible
Configuration
Bean Scoping
Groovy, JRuby
and BeanShell
JSP tag library
Java 5
autoboxing and
generics
Annotation driving
wiring
Automatic bean
configuration
New annotation
driven MVC
framework
JUnit 4-based
integration testing
JSR 300 “at inject”
New Spring
Expression
Language
First-class REST
support
Java based
configuration
Several new
Spring MVC
features
Support for JSR
303 declarative
validation
Scheduled Jobs
A new “C”
namespace
Configuration
profiles
Unified property
resolution
Java configuration
features
Servlet 3.0 support
Declarative
caching
Spring MVC
enhancements
Mobile features
Modern Web
Data Access
Social
Security
Cloud Ready
What is Spring ?
• Explicit Configuration
• Aspect oriented
• Ease-of-use abstractions over
lower-level, general purpose
API’s like JDBC, JMS and
JavaMail
• More flexibility for fine grained
control, but more complexity
• Deployment/Runtime
complexity
• Uses a Java EE container
underneath
Spring Data Spring for Apache Hadoop
Google App
Engine
AWS Beanstalk
Heroku
Cloud Foundry
OpenShift
Tomcat 5+
GlassFish 2.1+
WebLogic 9+
WebSphere 6.1+
Hive
SI/Batch
Spring Batch
Spring AMQP
Spring Web Flow
Spring Integration
Spring Roo
Spring Web Services
Spring Security
Spring Secure
OAuth
Java EE 1.4+ / SES+
JMX 1.0+JDBC 4.1JTAJSR 303JSR 330JSR 250JSF 2.0JPA 2.0
Spring Framework
Schedulin
g
OXM
Expressio
n
ORM
Profiles
JDBC
Caching
JMS
Testing
TX
JMX
AOP
REST
DI
MVC
MapReduce
Cascading
HDFS
Pig
QueryDSL
Splunk
JPA
JDBC
GemFire
Soir
HBase
Neo4j
Redis
MongoDB
Spring Social
FaceBoo
k
LinkedInTwitter
Spring JMS Configuration
Java EE 6
Evolution of J2EE (later Java EE)
May’98 Dec’99 Sep’01 Nov’03 May’06 Dec’09
EJB 1.0
Servlet 2.1
EJB 1.1
Servlet 1.1
JSP 1.1
JMS 1.0.2
JDBC 2.0
JNDI 1.2
JAF 1.0
JTA 1.0
JTS 0.95
JavaMail 1.1
Enterprise
Application
Robust
Scalable
Web
Services
Ease
Development
Productivity
& HTML 5
Apr’13
Lightweight
Project
JPE
J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7
10 specs 13 specs 20 specs 24 specs 28 specs 32 specs
EJB 2.0
(CMP, MDB,
local EJB)
Servlets 2.3
(Event,
Filters)
JSP 1.2
JDBC 2.1
JCA 1.0
JAAS 1.0
JAXP 1.0
EJB 2.1
Servlet 2.4
JSP 2.0
Web
Services
JMX
J2EE
Deploy
JACC
JAAS
JAX-RPC
JAXR
JSTL
EJB 3.0
JPA 1.0
JSF 1.2
Servlets 2.5
JSP 2.1
(Common
EL)
JAXB,
SAAJ,
WebService
Injection
Prunning
Extensibility
CDI
JAX-RS
Servlet 3.0
EJB 3.1 Lite
JMS 2.0
Batch
Caching
TX
Interceptor
WebSocket
JSON
JAX-RS 2.0
Project
JPE
J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7
• One monolitic server
• Hard to decouple technologies
• Heavyweight
Lessons learned with Spring
• Lightweight and
Heavyweight
servers (separated
by Profiles)
• Technologies
doesn’t depend
solely on
containers
• CDI is a gamer
changer
• Arquilian is ALSO
a gamer changer
Java EE 6 Highlights
Java EE 6
• Extensibility
• Enhanced easy of
Development
• JSF 2.1
• Built-In AJAX
• Expanded View Model
• Profiles
• Vendor Support
• CDI (Contexts & Dependency
Injection)
What is CDI anyway ?
MyInterface hello = new MyImplementation();
How is going to workWhat I want
What is CDI anyway ?
@Inject
MyInterface hello;
• Less coding = More
Productivity
• Server (Container)
“injects” the other part
FOR YOU
• Loose coupling
• Refactoring easy
• Easy Maintenance
Hollywood Principle:
“Don’t call us,
we will call you”
Java EE 6
Java EE 6
Side-by-Side
• Java EE 6 and Spring
are both capable
middleware solutions
• Functionally equivalent
for the most part, with
very different approaches
• For very vanilla
applications, code is
almost identical
Java EE vs Spring Framework Features
Dependency
Injection
AOP
Persistence
Transactions
Presentation
Framework
Web
Services
Messaging
Testing
Java EE 6 Spring Framework
Spring IoC
Container
JSR 330JSR 250
AspectJ
Spring
AOP
JDOiBATISJDBCHibernateJPA 2
JDOHibernateJPAJDBCJTA
WebWorkTapestry
Spring
MVC
StrutsJSF 2
JAX-
RPC
Spring MVC
RESTXFireJAX-WS
JMS
TestNGJUnit
CDIJSR 330JSR 250
DecoratorInteceptor
JPA 2
EJB 3.1JTA
JSF 2
JAX-RSJAX-WS
EJB 3.1JMS
JPA 2EJB 3.1CDI
Spring Framework and Java EE 6 (Side-by-Side)
Components
Server
File Size
JARs/ XMLs
Configuration
Lines
Pre-Deploy
Memory
Post-Deploy
Memory
Memory (100
Threads)
Response
Time
JSF/CDI/JAAS/JPA/JAX-RS/JAX-WS
JBoss EAP 6
11 Kb (WAR file)
0 / 4
37
33 Mb Heap / 48 Mb Perm
41 Mb Heap / 84 Mb Perm
71 Mb Heap / 92 Mb Perm
2459 ms (average)
Spring MVC/IoC/Security/JPA/JAX-WS
Tomcat 7
32,153 Kb (WAR file)
36 / 5
92
23 Mb Heap / 21 Mb Perm
107 Mb Heap/ 52 Mb Perm
81 Mb Heap/ 47 Mb Perm
1100 ms (average)
Should I
migrate my
current Spring
application to
Java EE 6 ?
Why ?
Java EE 6
To migrate or not to migrate ?
• Application is a legacy
(written in early versions
of Spring)
• A real benefit will come
from a migration
• Faster
• More secure
• Easy to manage
• Support from multiple
vendors
Java EE 6
CDI and IoC
@Named
@RequestScoped
public class PersonBean {
@Inject
private SocialID social;
@Controller
@Scope(“request”)
public class PersonBean {
@AutoWired
private SocialID social;
Java EE 6
Persistence
@Stateless
public class PersonDAO {
@PersistenceContext
private EntityManager em;
Java EE 6
@Repository
public class PersonDAO {
@PersistenceContext
private EntityManager em;
Persistence
@Stateless
public class PersonDAO {
@Resource
private DataSource ds;
public void save(Person p) {
try {
Connection c =
ds.getConnection();
PreparedStatement ps =
c.prepareStatement(“…
ps.setString(1, p.name());
ps.setInt(2, p.age());
ps.execute();
…
Java EE 6
@Repository
public class PersonDAO {
@Autowired
private JdbcTemplate temp;
public void save(Person p) {
temp.update(
“insert … values (?,?)”,
p.name(), p.age());
}
}
Transaction and Exception
@TransactionAttribute(…)
@Stateless
public class PersonDAO {
@PersistenceContext
private EntityManager em;
Java EE 6
@Transactional(…)
@Repository
public class PersonDAO {
@PersistenceContext
private EntityManager em;
Transaction and Exception
@ApplicationException(rollback=tr
ue)
public class DAOException
extends Exception {
Java EE 6
@Transactional(rollbackFor=DaoExc
eption.class)
public class PersonController {
Web
@Named
@RequestScoped
public class PersonMBean {
private Person p;
private List<Person> ls;
@Inject
private PersonDAO dao;
public void save() {
dao.save(p);
resetForm();
}
…
Java EE 6
@Controller
@Transactional
public class PersonController {
@Autowired
private PersonDAO dao;
@RequestMapping(“/add”)
public ModelAndView add(Person p)
{
dao.save(p);
ModelAndView mv = new
ModelAndView(“ok”);
mv.addObject(“person”,
dao.list);
return mv;
WebService (SOAP)
@WebService
public class PersonWS {
@Inject
private PersonDAO dao;
public List<Person> list() {
return dao.list();
}
…
Java EE 6
@WebService
public class PersonWS extends
SpringBeanAutowiringSupport {
@Autowired
private PersonDAO dao;
public List<Person> list() {
if(dao == null)
injectionContext(this);
…
…
WebService (REST)
@Path(“/”)
public class PersonResource {
@Inject
private PersonDAO dao;
@GET
@Path(“/person/{id}”)
@Produces(“application/json”)
public Person
load(@PathParam(“id”)Long ID) {
return dao.seek(ID);
}
…
Java EE 6
@Controller
public class PersonResource {
@Autowired
private PersonDAO dao;
@RequestMapping(
value=“/person/{id}”,
produces={“application/json”}
method=RequestMethod.GET)
@ResponseBody
public Person
load(@PathVariable(“ID”)Long ID)
{
return dao.seek(ID);
…
Messaging Queue
InitialContext ic = …
ConnectionFactory cf = …
Connection c = …
Session s = c.createSession(…
TextMessage m = s.createText(
“hello”);
Queue q = (Queue)ic.lookup(…
QueueSender sender = …
Sender.send(m);
c.close();
Java EE 6
@Autowired JmsTemplate t;
@Autowired Queue q;
public void sendMessage() {
this.t.send(q, new
MessageCreator() {
public Message
createMessage(Session s) throws
JMSException {
return
s.createTextMessage(“hello”);
}});
}
Java EE 6
Java EE 6 and Spring coexistence
• Integration with Java EE API’s
• Spring beans can be injected into JSF Managed Beans
• Spring beans can be referenced in EL with no JSF Backing beans
• Spring JmsTemplate can be used on top of raw JMS API for convenience
• Spring Listeners similar to EJB MDB especially JCA rather than JMS listeners
• Hibernate validator standardized as Bean Validation (JSR 303)
• Spring 3 supports excellent bi-directional integration with EJB’s
• CDI and Spring Integration through the Spring Bridge to CDI
• Native support for Java EE
• Java EE 6 annotations supported by Spring
• Spring can use JPA / Hibernate natively
• Application Server Integration
• DataSources can use application Server QoS pooling, transactions, statement
caching, debugging, monitoring and security
Java EE 6
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Preference for Standardization
• Vendor Neutrality
• Simplicity
• XML Aversion
• Annotations
• Type-Safety
• Near Zero Configuration
• Streamlined Stack
• Early Adopters
• Some Risk Tolerance
• Preference for Standardization
• Vendor Neutrality
• Simplicity
• XML Aversion
• Annotations
• Type-Safety
• Near Zero Configuration
• Streamlined Stack
• Early Adopters
• Some Risk Tolerance
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Some specialized integration needs
• Interim technology updates
• Slight less vendor neutral, but
• Standards compatible
• Some specialized integration needs
• Interim technology updates
• Slight less vendor neutral, but
• Standards compatible
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Specialized integration needs
• Existing skill set
• Some sacrifices to vendor neutrality
• Specialized integration needs
• Existing skill set
• Some sacrifices to vendor neutrality
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Gradual migration
• Skill set transfer
• Technology agnosticism
• Highly advanced integration needs
• Aggressive technology adoption
• Gradual migration
• Skill set transfer
• Technology agnosticism
• Highly advanced integration needs
• Aggressive technology adoption
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Technology agnosticism
• Advanced integration needs
• Likely using JSF
• Technology agnosticism
• Advanced integration needs
• Likely using JSF
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Existing skill set
• Low risk tolerance
• Standardization
• Technology agnosticism
• Uses Tomcat or more likely a Java
EE Server
• Likely using JSF, JPA, JMS, JAX-RS
maybe EJB
• Existing skill set
• Low risk tolerance
• Standardization
• Technology agnosticism
• Uses Tomcat or more likely a Java
EE Server
• Likely using JSF, JPA, JMS, JAX-RS
maybe EJB
Java EE 6 and Spring coexistence
Java EE 6
Java EE 6 +
CDI PlugIns
Java EE 6 +
Spring Modules
CDI +
Spring
Spring +
CDI Plugins
Spring +
Java EE 6 API’s
Spring
• Highly specialized custom system,
likely on Tomcat
• Established skill set
• Wide deployment
• Open Source activism
• Some vendor lock-in risk
• Highly specialized custom system,
likely on Tomcat
• Established skill set
• Wide deployment
• Open Source activism
• Some vendor lock-in risk
Java EE 6
Java EE 6
Conclusion
• There is no practical
reason to choose
between the two
• Balanced competition in
server-side Java is good
for both developers and
vendors
• There is excellent
integration possibilities
Java EE 6 & Spring: A Lover's Quarrel

Mais conteúdo relacionado

Mais procurados

Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreIMC Institute
 
High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode VMware Tanzu
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesMert Çalışkan
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutesArun Gupta
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
2015 JavaOne LAD JSF 2.3 & MVC 1.0
2015 JavaOne LAD JSF 2.3 & MVC 1.02015 JavaOne LAD JSF 2.3 & MVC 1.0
2015 JavaOne LAD JSF 2.3 & MVC 1.0mnriem
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Arun Gupta
 
JavaOne 2011: Migrating Spring Applications to Java EE 6
JavaOne 2011: Migrating Spring Applications to Java EE 6JavaOne 2011: Migrating Spring Applications to Java EE 6
JavaOne 2011: Migrating Spring Applications to Java EE 6Bert Ertman
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by GoogleASG
 
JSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksJSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksDmitry Kornilov
 
Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Alex Kosowski
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introductionejlp12
 
Best Way to Write SQL in Java
Best Way to Write SQL in JavaBest Way to Write SQL in Java
Best Way to Write SQL in JavaGerger
 

Mais procurados (18)

Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
 
High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
 
Jdbc
JdbcJdbc
Jdbc
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
2015 JavaOne LAD JSF 2.3 & MVC 1.0
2015 JavaOne LAD JSF 2.3 & MVC 1.02015 JavaOne LAD JSF 2.3 & MVC 1.0
2015 JavaOne LAD JSF 2.3 & MVC 1.0
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
 
JavaOne 2011: Migrating Spring Applications to Java EE 6
JavaOne 2011: Migrating Spring Applications to Java EE 6JavaOne 2011: Migrating Spring Applications to Java EE 6
JavaOne 2011: Migrating Spring Applications to Java EE 6
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
JSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksJSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworks
 
Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Finally, EE Security API JSR 375
Finally, EE Security API JSR 375
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
Spring framework core
Spring framework coreSpring framework core
Spring framework core
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Best Way to Write SQL in Java
Best Way to Write SQL in JavaBest Way to Write SQL in Java
Best Way to Write SQL in Java
 

Destaque

1/3 : introduction to CDI - Antoine Sabot-Durand
1/3 : introduction to CDI - Antoine Sabot-Durand1/3 : introduction to CDI - Antoine Sabot-Durand
1/3 : introduction to CDI - Antoine Sabot-DurandSOAT
 
Fais ce que tu veux avec Java EE - Devoxx France 2014
Fais ce que tu veux avec Java EE - Devoxx France 2014Fais ce que tu veux avec Java EE - Devoxx France 2014
Fais ce que tu veux avec Java EE - Devoxx France 2014Antoine Sabot-Durand
 
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data RESTJavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data RESTRodrigo Cândido da Silva
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 
CDI mis en pratique avec Seam Social et Weld OSGI
CDI mis en pratique avec Seam Social et Weld OSGICDI mis en pratique avec Seam Social et Weld OSGI
CDI mis en pratique avec Seam Social et Weld OSGIAntoine Sabot-Durand
 
Java EE, un ami qui vous veut du bien
Java EE, un ami qui vous veut du bienJava EE, un ami qui vous veut du bien
Java EE, un ami qui vous veut du bienAntoine Sabot-Durand
 

Destaque (13)

Devoxx Java Social and Agorava
Devoxx Java Social and AgoravaDevoxx Java Social and Agorava
Devoxx Java Social and Agorava
 
1/3 : introduction to CDI - Antoine Sabot-Durand
1/3 : introduction to CDI - Antoine Sabot-Durand1/3 : introduction to CDI - Antoine Sabot-Durand
1/3 : introduction to CDI - Antoine Sabot-Durand
 
Advanced CDI in live coding
Advanced CDI in live codingAdvanced CDI in live coding
Advanced CDI in live coding
 
CDI 2.0 is coming
CDI 2.0 is comingCDI 2.0 is coming
CDI 2.0 is coming
 
Fais ce que tu veux avec Java EE - Devoxx France 2014
Fais ce que tu veux avec Java EE - Devoxx France 2014Fais ce que tu veux avec Java EE - Devoxx France 2014
Fais ce que tu veux avec Java EE - Devoxx France 2014
 
Mute Java EE DNA with CDI
Mute Java EE DNA with CDI Mute Java EE DNA with CDI
Mute Java EE DNA with CDI
 
CDI 1.1 university
CDI 1.1 universityCDI 1.1 university
CDI 1.1 university
 
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data RESTJavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
 
Adopt a JSR: CDI 2.0 at Devoxx UK
Adopt a JSR: CDI 2.0 at Devoxx UKAdopt a JSR: CDI 2.0 at Devoxx UK
Adopt a JSR: CDI 2.0 at Devoxx UK
 
CDI 2.0 is upon us Devoxx
CDI 2.0 is upon us DevoxxCDI 2.0 is upon us Devoxx
CDI 2.0 is upon us Devoxx
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
CDI mis en pratique avec Seam Social et Weld OSGI
CDI mis en pratique avec Seam Social et Weld OSGICDI mis en pratique avec Seam Social et Weld OSGI
CDI mis en pratique avec Seam Social et Weld OSGI
 
Java EE, un ami qui vous veut du bien
Java EE, un ami qui vous veut du bienJava EE, un ami qui vous veut du bien
Java EE, un ami qui vous veut du bien
 

Semelhante a Java EE 6 & Spring: A Lover's Quarrel

Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New FeaturesShahzad Badar
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Hamed Hatami
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyMohamed Taman
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Arun Gupta
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Jagadish Prasath
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 DemystifiedAnkara JUG
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New EvolutionAllan Huang
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureJava EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureIndicThreads
 
Java EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the futureJava EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the futureArun Gupta
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEQAware GmbH
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEMario-Leander Reimer
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?gedoplan
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistencePinaki Poddar
 
best java training center in chennai
best java training center in chennaibest java training center in chennai
best java training center in chennaisathis est
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopArun Gupta
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroOndrej Mihályi
 

Semelhante a Java EE 6 & Spring: A Lover's Quarrel (20)

GlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and FutureGlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and Future
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New Features
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureJava EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The Future
 
Java EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the futureJava EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the future
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
 
Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012
 
best java training center in chennai
best java training center in chennaibest java training center in chennai
best java training center in chennai
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 Workshop
 
Elastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara MicroElastic and Cloud-ready Applications with Payara Micro
Elastic and Cloud-ready Applications with Payara Micro
 

Último

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Último (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Java EE 6 & Spring: A Lover's Quarrel

  • 1.
  • 2. Java EE 6 & Spring: A Lover’s Quarrel Derrick Kittler Mauricio “Maltron” Leal Vamsi Chemitiganti
  • 3. Agenda o The goal of this talk o Evolution of Spring o Evolution of Java EE 6 o Side-by-Side o Migrating o Java EE 6 and Spring Coexistence o Conclusion
  • 5. Fair Comparison: NOT Specification Java EE 6 Technology Framework
  • 6. Fair Comparison Java EE 6 Approach to a Enterprise Solution !!
  • 7. If can’t beat them, join them !!!! Java EE 6 Sometimes, a join solution can be the best approach
  • 8. Java EE 6 The goal of this talk is NOT… Compare both technologies and declare a winner
  • 9. The goal of this talk is… • How to deliver a good enterprise application • Evaluate both technologies • Show some migration path (only when makes sense)
  • 10. Technology Choice: The big picture Java EE 6
  • 11.
  • 12. Evolution of Spring Dependecy Injection POJO oriented development Declarative AOP & transactions MVC Framework Proble Specific XML Extensible Configuration Bean Scoping Groovy, JRuby and BeanShell JSP tag library Java 5 autoboxing and generics Annotation driving wiring Automatic bean configuration New annotation driven MVC framework JUnit 4-based integration testing JSR 300 “at inject” New Spring Expression Language First-class REST support Java based configuration Several new Spring MVC features Support for JSR 303 declarative validation Scheduled Jobs A new “C” namespace Configuration profiles Unified property resolution Java configuration features Servlet 3.0 support Declarative caching Spring MVC enhancements Mobile features Modern Web Data Access Social Security Cloud Ready
  • 13. What is Spring ? • Explicit Configuration • Aspect oriented • Ease-of-use abstractions over lower-level, general purpose API’s like JDBC, JMS and JavaMail • More flexibility for fine grained control, but more complexity • Deployment/Runtime complexity • Uses a Java EE container underneath
  • 14. Spring Data Spring for Apache Hadoop Google App Engine AWS Beanstalk Heroku Cloud Foundry OpenShift Tomcat 5+ GlassFish 2.1+ WebLogic 9+ WebSphere 6.1+ Hive SI/Batch Spring Batch Spring AMQP Spring Web Flow Spring Integration Spring Roo Spring Web Services Spring Security Spring Secure OAuth Java EE 1.4+ / SES+ JMX 1.0+JDBC 4.1JTAJSR 303JSR 330JSR 250JSF 2.0JPA 2.0 Spring Framework Schedulin g OXM Expressio n ORM Profiles JDBC Caching JMS Testing TX JMX AOP REST DI MVC MapReduce Cascading HDFS Pig QueryDSL Splunk JPA JDBC GemFire Soir HBase Neo4j Redis MongoDB Spring Social FaceBoo k LinkedInTwitter
  • 17. Evolution of J2EE (later Java EE) May’98 Dec’99 Sep’01 Nov’03 May’06 Dec’09 EJB 1.0 Servlet 2.1 EJB 1.1 Servlet 1.1 JSP 1.1 JMS 1.0.2 JDBC 2.0 JNDI 1.2 JAF 1.0 JTA 1.0 JTS 0.95 JavaMail 1.1 Enterprise Application Robust Scalable Web Services Ease Development Productivity & HTML 5 Apr’13 Lightweight Project JPE J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7 10 specs 13 specs 20 specs 24 specs 28 specs 32 specs EJB 2.0 (CMP, MDB, local EJB) Servlets 2.3 (Event, Filters) JSP 1.2 JDBC 2.1 JCA 1.0 JAAS 1.0 JAXP 1.0 EJB 2.1 Servlet 2.4 JSP 2.0 Web Services JMX J2EE Deploy JACC JAAS JAX-RPC JAXR JSTL EJB 3.0 JPA 1.0 JSF 1.2 Servlets 2.5 JSP 2.1 (Common EL) JAXB, SAAJ, WebService Injection Prunning Extensibility CDI JAX-RS Servlet 3.0 EJB 3.1 Lite JMS 2.0 Batch Caching TX Interceptor WebSocket JSON JAX-RS 2.0
  • 18. Project JPE J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7 • One monolitic server • Hard to decouple technologies • Heavyweight Lessons learned with Spring • Lightweight and Heavyweight servers (separated by Profiles) • Technologies doesn’t depend solely on containers • CDI is a gamer changer • Arquilian is ALSO a gamer changer
  • 19. Java EE 6 Highlights Java EE 6 • Extensibility • Enhanced easy of Development • JSF 2.1 • Built-In AJAX • Expanded View Model • Profiles • Vendor Support • CDI (Contexts & Dependency Injection)
  • 20. What is CDI anyway ? MyInterface hello = new MyImplementation(); How is going to workWhat I want
  • 21. What is CDI anyway ? @Inject MyInterface hello; • Less coding = More Productivity • Server (Container) “injects” the other part FOR YOU • Loose coupling • Refactoring easy • Easy Maintenance Hollywood Principle: “Don’t call us, we will call you”
  • 23. Java EE 6 Side-by-Side • Java EE 6 and Spring are both capable middleware solutions • Functionally equivalent for the most part, with very different approaches • For very vanilla applications, code is almost identical
  • 24. Java EE vs Spring Framework Features Dependency Injection AOP Persistence Transactions Presentation Framework Web Services Messaging Testing Java EE 6 Spring Framework Spring IoC Container JSR 330JSR 250 AspectJ Spring AOP JDOiBATISJDBCHibernateJPA 2 JDOHibernateJPAJDBCJTA WebWorkTapestry Spring MVC StrutsJSF 2 JAX- RPC Spring MVC RESTXFireJAX-WS JMS TestNGJUnit CDIJSR 330JSR 250 DecoratorInteceptor JPA 2 EJB 3.1JTA JSF 2 JAX-RSJAX-WS EJB 3.1JMS JPA 2EJB 3.1CDI
  • 25. Spring Framework and Java EE 6 (Side-by-Side) Components Server File Size JARs/ XMLs Configuration Lines Pre-Deploy Memory Post-Deploy Memory Memory (100 Threads) Response Time JSF/CDI/JAAS/JPA/JAX-RS/JAX-WS JBoss EAP 6 11 Kb (WAR file) 0 / 4 37 33 Mb Heap / 48 Mb Perm 41 Mb Heap / 84 Mb Perm 71 Mb Heap / 92 Mb Perm 2459 ms (average) Spring MVC/IoC/Security/JPA/JAX-WS Tomcat 7 32,153 Kb (WAR file) 36 / 5 92 23 Mb Heap / 21 Mb Perm 107 Mb Heap/ 52 Mb Perm 81 Mb Heap/ 47 Mb Perm 1100 ms (average)
  • 26. Should I migrate my current Spring application to Java EE 6 ? Why ?
  • 27. Java EE 6 To migrate or not to migrate ? • Application is a legacy (written in early versions of Spring) • A real benefit will come from a migration • Faster • More secure • Easy to manage • Support from multiple vendors
  • 29. CDI and IoC @Named @RequestScoped public class PersonBean { @Inject private SocialID social; @Controller @Scope(“request”) public class PersonBean { @AutoWired private SocialID social; Java EE 6
  • 30. Persistence @Stateless public class PersonDAO { @PersistenceContext private EntityManager em; Java EE 6 @Repository public class PersonDAO { @PersistenceContext private EntityManager em;
  • 31. Persistence @Stateless public class PersonDAO { @Resource private DataSource ds; public void save(Person p) { try { Connection c = ds.getConnection(); PreparedStatement ps = c.prepareStatement(“… ps.setString(1, p.name()); ps.setInt(2, p.age()); ps.execute(); … Java EE 6 @Repository public class PersonDAO { @Autowired private JdbcTemplate temp; public void save(Person p) { temp.update( “insert … values (?,?)”, p.name(), p.age()); } }
  • 32. Transaction and Exception @TransactionAttribute(…) @Stateless public class PersonDAO { @PersistenceContext private EntityManager em; Java EE 6 @Transactional(…) @Repository public class PersonDAO { @PersistenceContext private EntityManager em;
  • 33. Transaction and Exception @ApplicationException(rollback=tr ue) public class DAOException extends Exception { Java EE 6 @Transactional(rollbackFor=DaoExc eption.class) public class PersonController {
  • 34. Web @Named @RequestScoped public class PersonMBean { private Person p; private List<Person> ls; @Inject private PersonDAO dao; public void save() { dao.save(p); resetForm(); } … Java EE 6 @Controller @Transactional public class PersonController { @Autowired private PersonDAO dao; @RequestMapping(“/add”) public ModelAndView add(Person p) { dao.save(p); ModelAndView mv = new ModelAndView(“ok”); mv.addObject(“person”, dao.list); return mv;
  • 35. WebService (SOAP) @WebService public class PersonWS { @Inject private PersonDAO dao; public List<Person> list() { return dao.list(); } … Java EE 6 @WebService public class PersonWS extends SpringBeanAutowiringSupport { @Autowired private PersonDAO dao; public List<Person> list() { if(dao == null) injectionContext(this); … …
  • 36. WebService (REST) @Path(“/”) public class PersonResource { @Inject private PersonDAO dao; @GET @Path(“/person/{id}”) @Produces(“application/json”) public Person load(@PathParam(“id”)Long ID) { return dao.seek(ID); } … Java EE 6 @Controller public class PersonResource { @Autowired private PersonDAO dao; @RequestMapping( value=“/person/{id}”, produces={“application/json”} method=RequestMethod.GET) @ResponseBody public Person load(@PathVariable(“ID”)Long ID) { return dao.seek(ID); …
  • 37. Messaging Queue InitialContext ic = … ConnectionFactory cf = … Connection c = … Session s = c.createSession(… TextMessage m = s.createText( “hello”); Queue q = (Queue)ic.lookup(… QueueSender sender = … Sender.send(m); c.close(); Java EE 6 @Autowired JmsTemplate t; @Autowired Queue q; public void sendMessage() { this.t.send(q, new MessageCreator() { public Message createMessage(Session s) throws JMSException { return s.createTextMessage(“hello”); }}); }
  • 39. Java EE 6 and Spring coexistence • Integration with Java EE API’s • Spring beans can be injected into JSF Managed Beans • Spring beans can be referenced in EL with no JSF Backing beans • Spring JmsTemplate can be used on top of raw JMS API for convenience • Spring Listeners similar to EJB MDB especially JCA rather than JMS listeners • Hibernate validator standardized as Bean Validation (JSR 303) • Spring 3 supports excellent bi-directional integration with EJB’s • CDI and Spring Integration through the Spring Bridge to CDI • Native support for Java EE • Java EE 6 annotations supported by Spring • Spring can use JPA / Hibernate natively • Application Server Integration • DataSources can use application Server QoS pooling, transactions, statement caching, debugging, monitoring and security Java EE 6
  • 40. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Preference for Standardization • Vendor Neutrality • Simplicity • XML Aversion • Annotations • Type-Safety • Near Zero Configuration • Streamlined Stack • Early Adopters • Some Risk Tolerance • Preference for Standardization • Vendor Neutrality • Simplicity • XML Aversion • Annotations • Type-Safety • Near Zero Configuration • Streamlined Stack • Early Adopters • Some Risk Tolerance
  • 41. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Some specialized integration needs • Interim technology updates • Slight less vendor neutral, but • Standards compatible • Some specialized integration needs • Interim technology updates • Slight less vendor neutral, but • Standards compatible
  • 42. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Specialized integration needs • Existing skill set • Some sacrifices to vendor neutrality • Specialized integration needs • Existing skill set • Some sacrifices to vendor neutrality
  • 43. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Gradual migration • Skill set transfer • Technology agnosticism • Highly advanced integration needs • Aggressive technology adoption • Gradual migration • Skill set transfer • Technology agnosticism • Highly advanced integration needs • Aggressive technology adoption
  • 44. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Technology agnosticism • Advanced integration needs • Likely using JSF • Technology agnosticism • Advanced integration needs • Likely using JSF
  • 45. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Existing skill set • Low risk tolerance • Standardization • Technology agnosticism • Uses Tomcat or more likely a Java EE Server • Likely using JSF, JPA, JMS, JAX-RS maybe EJB • Existing skill set • Low risk tolerance • Standardization • Technology agnosticism • Uses Tomcat or more likely a Java EE Server • Likely using JSF, JPA, JMS, JAX-RS maybe EJB
  • 46. Java EE 6 and Spring coexistence Java EE 6 Java EE 6 + CDI PlugIns Java EE 6 + Spring Modules CDI + Spring Spring + CDI Plugins Spring + Java EE 6 API’s Spring • Highly specialized custom system, likely on Tomcat • Established skill set • Wide deployment • Open Source activism • Some vendor lock-in risk • Highly specialized custom system, likely on Tomcat • Established skill set • Wide deployment • Open Source activism • Some vendor lock-in risk
  • 48. Java EE 6 Conclusion • There is no practical reason to choose between the two • Balanced competition in server-side Java is good for both developers and vendors • There is excellent integration possibilities