Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Javaforum - Spring 4, Java EE 7 or Both? @Javaf...

ivargrimstad
February 20, 2014

Javaforum - Spring 4, Java EE 7 or Both? @Javaforum

Presentation slides from presentation held at Javaforum in Gothenburg

ivargrimstad

February 20, 2014
Tweet

More Decks by ivargrimstad

Other Decks in Programming

Transcript

  1. • Spring 4 • Java EE 7 • Combining Spring

    4 with Java EE 7 Contents Spring 4, Java EE 7 or Both? @ivar_grimstad
  2. Timeline Spring 4, Java EE 7 or Both? @ivar_grimstad Spring

    4 Spring 3 Spring 2 Spring 1 Java EE 7 Java EE 6 Java EE 5 J2EE 1.4 J2EE 1.3 J2EE 1.2 JPE Spring 1998 2014
  3. lambda expressions method references @Repeatable Java 8 Support Spring 4,

    Java EE 7 or Both? @ivar_grimstad @Fruit(1) @Fruit(2) class Bowl{} @Fruits({@Fruit(1), @Fruit(2)}) class Bowl{}
  4. • Java EE 6 is the baseline – Servlet 3.0

    – JPA 2.0 • Java EE 7 Supported Specifications – JMS 2.0 – JTA 1.2 – JPA 2.1 – Bean Validation 1.1 – Concurrency Utilities Java EE 7 Support Spring 4, Java EE 7 or Both? @ivar_grimstad
  5. Generic qualifiers Core Container Improvements Spring 4, Java EE 7

    or Both? @ivar_grimstad @Autowired private Foo<Integer> i; @Autowired private Foo<String> s;
  6. Java EE 7 vs Spring 4 Spring 4, Java EE

    7 or Both? @ivar_grimstad
  7. Spring 4 vs Java EE 7 Spring 4, Java EE

    7 or Both? @ivar_grimstad
  8. • Spring 4 application configuration • Java EE 7 application

    configuration • Combine the two approaches • Examine portability across application servers – WildFly – Glassfish – Tomcat Demo Contents Spring 4, Java EE 7 or Both? @ivar_grimstad
  9. Spring 4 - Configuration Spring 4, Java EE 7 or

    Both? @ivar_grimstad @Configuration @ComponentScan("eu.agilejava.spring4") @EnableWebMvc public class ApplicationConfig extends WebMvcConfigurerAdapter { }
  10. Java EE 7 - Configuration Spring 4, Java EE 7

    or Both? @ivar_grimstad @ApplicationPath("api") public class ApplicationConfig extends Application {
  11. Spring 4 + Java EE 7 - Configuration Spring 4,

    Java EE 7 or Both? @ivar_grimstad @Configuration @ComponentScan("eu.agilejava.both") @ApplicationPath("api") public class ApplicationConfig extends Application { }
  12. • No configuration changes • No code changes • New

    dependency (pom.xml) Spring 4 - Portability Spring 4, Java EE 7 or Both? @ivar_grimstad
  13. • Minor configuration changes • No code changes • No

    new dependencies (pom.xml) Java EE 7 - Portability Spring 4, Java EE 7 or Both? @ivar_grimstad
  14. • Configuration changes • No code changes • New dependencies

    (pom.xml) Spring 4 + Java EE 7 - Portability Spring 4, Java EE 7 or Both? @ivar_grimstad
  15. • Spring 4 is more portable • Even across Java

    EE 7 app servers • Java EE 7 requires less configuration • And fewer dependencies Conclusion Spring 4, Java EE 7 or Both? @ivar_grimstad
  16. Favor one framework over mixing One Last Tip Spring 4,

    Java EE 7 or Both? @ivar_grimstad