Top Banner
Spring Framework 4 and Spring Data WHAT’S NEW
11

Spring 4 en spring data

Aug 28, 2014

Download

Software

Geert Pante

What's new in Spring 4?
Plus an introduction to Spring Data Modules
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Spring 4 en spring data

Spring Framework 4and Spring DataWHAT’S NEW

Page 2: Spring 4 en spring data

Agenda Intro to Spring IoC

◦ Spring 3.x highlights

What’s new in Spring Core 4◦ @Conditional◦ Spring Boot◦ Autowiring voor Generic types

Spring Data◦ SQL and NoSQL◦ Generic Query Framework

Page 3: Spring 4 en spring data

Intro to Spring Framework Inversion of Control Pattern

◦ GoF °1995: Strategy Pattern◦ Program using interfaces◦ Clients are not tied to implementations

◦ Dependency Injection◦ Central Application Context to wire implementations together◦ Hollywood Principle: Don’t call us, we’ll call you◦ Allows better testing

Spring Framework◦ Rod Johnson book on J2EE: Spring 0.1 °2002

◦ Application context using XML descriptors◦ ‘Faster, Beter, Lighter Java’: O’Reilly °2004

◦ Spring and Hibernate as alternative to J2EE/EJB 1/EJB 2

Page 4: Spring 4 en spring data

Spring Framework Modules Spring includes various abstraction modules

◦ Database abstraction◦ Exception Handling◦ JDBC Abstraction◦ Hibernate/JPA Session Management (deprecated)

◦ Remoting◦ Data serialization abstraction◦ Exception Handling

◦ Messaging◦ JMS API Abstraction◦ Data serialization abstraction

◦ Management◦ JMX API Abstraction

Spring Framework also has Spring MVC and Spring WebFlow

Page 5: Spring 4 en spring data

Spring 3.x Highlights Spring 2.5

◦ @Autowired and @Component classpath scanning◦ Less XML

Spring 3.0◦ JavaConfig iso XML Config files

◦ Even less XML

Spring 3.1◦ Bean Profiles◦ TestContext support

Spring 3.2◦ Spring MVC improvements

◦ Spring MVC REST

Page 6: Spring 4 en spring data

Spring Framework 4 No big changes

◦ Mostly everything is backwards compatible◦ Except @Autowired with Generics

◦ Some deprecated methods are finally removed◦ E.g: ibatis ORM support◦ Spring MVC base classes before annotation support

Some new features◦ @Conditional◦ Spring Boot◦ Support for Groovy iso XML

Some modules major upgrade◦ Spring MVC with WebSocket support

Page 7: Spring 4 en spring data

WebSockets in Spring 4 DEMO: https://github.com/rstoyanchev/spring-websocket-portfolio

Page 8: Spring 4 en spring data

Spring Data Data Persistence abstraction

◦ Supports both SQL and NoSQL◦ JPA/JDBC◦ MongoDB/Hadoop

◦ Repository abstraction◦ Save/load/delete◦ Paging and sorting

◦ Entity annotations are stilimplementation specific

◦ Query Language abstraction◦ QueryDSL

Page 9: Spring 4 en spring data

Spring Data Queries Declare methods in your repository interface

◦ findByXxxx◦ Spring AOP will generate

Implementation

Or: use @Query annotation

Page 10: Spring 4 en spring data

Spring Data DEMO

Page 11: Spring 4 en spring data

Questions