Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

JDD2014: Spring 4, JAVA EE 7 or both? - Ivar Grimstad

981 views

Published on

Problems choosing between Java EE and Spring? Or do you want to use both in combination? Then this session is something for you.
In this session I will go through the similarities and differences between Spring 4 and Java EE 7. I will go through what you need to consider to configure and combine the two approaches. In the demo part of the presentation I will show how to integrate existing Spring 4 components into a Java EE 7 application. And as if that is not enough, I will also do it the other way around, that is to integrate existing Java EE 7 components into a Spring 4 application.
Strengths and weaknesses with the approaches will then be explored and lessons learned summarized.

Published in: Software
  • Be the first to comment

JDD2014: Spring 4, JAVA EE 7 or both? - Ivar Grimstad

  1. 1. Spring 4, Java EE 7 or Both? Ivar Grimstad JDD 2014 @ivar_grimstad
  2. 2. JDD 2014 @ivar_grimstad
  3. 3. Contents Spring 4 Java EE 7 Combining Spring 4 with Java EE 7 JDD 2014 @ivar_grimstad
  4. 4. Timeline JPE J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7 Spring Spring 1 Spring 2 Spring 3 Spring 4 1998 2014 JDD 2014 @ivar_grimstad
  5. 5. Spring Framework 4 JDD 2014 @ivar_grimstad
  6. 6. JDD 2014 @ivar_grimstad
  7. 7. XML ? JDD 2014 @ivar_grimstad
  8. 8. Annotations and JavaConfig to the Rescue JDD 2014 @ivar_grimstad
  9. 9. New in Spring 4 JDD 2014 @ivar_grimstad
  10. 10. JDD 2014 @ivar_grimstad
  11. 11. Java 8 Support JDD 2014 @ivar_grimstad
  12. 12. @Repeatable @Fruit(1) @Fruit(2) class Bowl {} ! @Fruits({@Fruit(1), @Fruit(2)}) class Bowl {} JDD 2014 @ivar_grimstad
  13. 13. Callback Interfaces interface RowMapper<T> { T mapRow(ResultSet rs, int rowNum); } JDD 2014 @ivar_grimstad
  14. 14. JMS 2.0 JTA 1.2 JPA 2.1 Java EE 7 Support Concurrency Utilities Bean! Validation 1.1 6 JDD 2014 @ivar_grimstad
  15. 15. Groovy Bean Definition Language JDD 2014 @ivar_grimstad
  16. 16. Core Container Improvements @Autowired private Foo<Integer> i; ! @Autowired private Foo<String> s; JDD 2014 @ivar_grimstad
  17. 17. Web Improvements @Controller @ResponseBody public Response foo() {} @RestController public Response foo() {} JDD 2014 @ivar_grimstad
  18. 18. WebSockets spring-websocket ! spring-messaging JDD 2014 @ivar_grimstad
  19. 19. Java EE 7 JDD 2014 @ivar_grimstad
  20. 20. Overview JDD 2014 @ivar_grimstad
  21. 21. Java EE 7 Focus Areas JDD 2014 @ivar_grimstad
  22. 22. Developer Productivity JDD 2014 @ivar_grimstad
  23. 23. Simplicity @Stateless public class Foo {} JDD 2014 @ivar_grimstad
  24. 24. HTML 5 JDD 2014 @ivar_grimstad
  25. 25. WebSockets @ServerEndpoint public class Foo {} ! @ClientEndpoint public class FooClient { JDD 2014 @ivar_grimstad
  26. 26. Meeting Enterprise Demands JDD 2014 @ivar_grimstad
  27. 27. JMS 2.0 @Stateless public class Foo { ! @Inject private JMSContext context; ! @Resource(lookup=“jms/MyQueue”) private Queue queue; } JDD 2014 @ivar_grimstad
  28. 28. Compatibility JDD 2014 @ivar_grimstad
  29. 29. Mixing Spring 4 with Java EE 7 JDD 2014 @ivar_grimstad
  30. 30. Java EE 7 vs Spring 4 JDD 2014 @ivar_grimstad
  31. 31. Spring 4 vs Java EE 7 JDD 2014 @ivar_grimstad
  32. 32. Java EE 7 Container Java EE 7 Application (WAR) bean @Inject bean JDD 2014 @ivar_grimstad
  33. 33. Spring 4 Container Spring 4 Application (WAR) Spring 4 Context bean @Autowired bean JDD 2014 @ivar_grimstad
  34. 34. So What about Mixing Spring and Java EE? JDD 2014 @ivar_grimstad
  35. 35. Java EE 7 -> Spring 4 Container Java EE 7 Application (WAR) bean Spring 4 Context bean @Inject @Inject @Autowired bean bean JDD 2014 @ivar_grimstad
  36. 36. Spring 4 -> Java EE 7 Container Spring 4 Application (WAR) bean Spring 4 Context bean @Autowired @Autowired @Inject bean bean JDD 2014 @ivar_grimstad
  37. 37. DEMO ! JDD 2014 @ivar_grimstad
  38. 38. Integrate a Spring 4 Component in Java EE 7 Application JDD 2014 @ivar_grimstad
  39. 39. Java EE 7 -> Spring 4 Container Java EE 7 Application (WAR) resource @Inject simple Spring 4 Context awsome @Autowired simple @Inject JDD 2014 @ivar_grimstad
  40. 40. Java EE 7 -> Spring 4 Container Java EE 7 Application (WAR) Spring 4 Context @Inject resource awsome @Inject @Autowired simple JDD 2014 @ivar_grimstad
  41. 41. Java EE 7 -> Spring 4 @InjectX@Autowired Container Java EE 7 Application (WAR) @Inject resource awsome simple simple JDD 2014 @ivar_grimstad
  42. 42. Integrate a Java EE 7 Component in Spring 4 Application JDD 2014 @ivar_grimstad
  43. 43. Spring 4 -> Java EE 7 Container Spring 4 Application (WAR) awsome @Inject simple Spring 4 Context resource @Autowired simple @EJB JDD 2014 @ivar_grimstad
  44. 44. Spring 4 -> Java EE 7 Container Spring 4 Application (WAR) awsome @Inject simple Spring 4 Context resource @EJB @Autowired JDD 2014 @ivar_grimstad
  45. 45. Spring 4 -> Java EE 7 Container Spring 4 Application (WAR) Spring 4 Context @Autowired @EJB resource awsome @Inject @Autowired simple JDD 2014 @ivar_grimstad
  46. 46. Summary JDD 2014 @ivar_grimstad
  47. 47. Spring 4 and Java EE 7 solves the same problem JDD 2014 @ivar_grimstad
  48. 48. Java EE 7 require less configuration and dependencies JDD 2014 @ivar_grimstad
  49. 49. Spring 4 is more portable JDD 2014 @ivar_grimstad
  50. 50. Using Spring 4 from Java EE is easier JDD 2014 @ivar_grimstad
  51. 51. Mixing is possible JDD 2014 @ivar_grimstad
  52. 52. …but… JDD 2014 @ivar_grimstad
  53. 53. Favor one framework over mixing JDD 2014 @ivar_grimstad
  54. 54. Sources https://github.com/ivargrimstad/spring-javaee JDD 2014 @ivar_grimstad
  55. 55. cybercom.com JDD 2014 @ivar_grimstad

×