SlideShare a Scribd company logo
1 of 74
Download to read offline
Spring Framework 4.0 to 4.1
Sam Brannen
@sam_brannen
AJUG | Atlanta, GA, USA | April 22, 2014
Atlanta User Group
2
Sam Brannen
•  Spring and Java Consultant @ Swiftmind
•  Georgia Tech College of Computing Alumnus
•  Java Developer for over 15 years
•  Spring Framework Core Committer since 2007
•  Spring Trainer
•  Speaker on Spring, Java, OSGi, and testing
•  Swiss Spring User Group Lead
3
Swiftmind
Your experts for Enterprise Java
Areas of expertise
•  Spring *
•  Java EE
•  OSGi
•  Software Architecture
•  Software Engineering Best Practices
Where you find us
•  Zurich, Switzerland
•  @swiftmind
•  http://www.swiftmind.com
4
A Show of Hands…
5
Agenda
•  Spring 3.x in Review
•  Themes in Spring 4.0
•  Java EE & SE
•  Spring 4 on Java 8
•  Spring 4.1
6
Spring 3.x in Review
7
Major Themes in Spring 3.x
•  Powerful annotated component model
•  Spring Expression Language (SpEL)
•  Comprehensive REST support
•  Support for async MVC processing
•  Validation and Formatting
•  Scheduling
•  Caching
8
Spring 3.x: Key Specs (1/2)
•  JSR-330
–  Dependency Injection for Java
–  @Inject, @Qualifier, Provider mechanism
•  JSR-303
–  Bean Validation 1.0
–  declarative constraints
–  embedded validation engine
9
Spring 3.x: Key Specs (2/2)
•  JPA 2.0
–  persistence provider integration
–  Spring transactions
•  Servlet 3.0
–  web.xml-free deployment
–  async request processing
10
Testing in Spring 3.x
•  Embedded databases via <jdbc /> namespace
•  @Configuration classes & @ActiveProfiles	
•  @WebAppConfiguration	
•  @ContextHierarchy	
•  Spring MVC Test framework
11
Annotated Components
12
Configuration Classes
13
Composable Stereotypes
•  Combining meta-annotations on a custom stereotype
•  Automatically detected: no configuration necessary!
14
Spring 4.0 Themes
15
Ready for New Application Architectures
•  Embedded web servers and non-traditional data stores
•  Lightweight messaging and WebSocket-style architectures
•  Custom asynchronous processing with convenient APIs
16
New Baselines
•  Java SE 6+
•  Java EE 6+
–  Servlet 3.0/3.1 focus
–  Servlet 2.5 compatible
•  All deprecated packages removed
•  Many deprecated methods and fields removed as well
17
Third Party Libraries
•  Minimum versions ~ mid 2010 now
•  For example
–  Hibernate 3.6+
–  Quartz 1.8+
–  Ehcache 2.1+
18
Java 8 Language and API Features
•  Lambda expressions
•  Method references
•  JSR-310 Date and Time
•  Repeatable annotations
•  Parameter name discovery
19
Groovy + Spring 4.0
•  A smooth out-of-the-box experience for Groovy-based
Spring applications
•  AOP adaptations
–  special handling of GroovyObject calls
–  consider a Spring application with all components
written in the Groovy language instead of Java
•  Groovy-based bean definitions
–  formerly known as the Bean Builder in Grails
–  now lives alongside Spring's configuration class model
20
Spring Bean Def’s with Groovy DSL
import org.mypackage.domain.Person;	
beans {	
xmlns util: 'http://www.springframework.org/schema/util'	
person1(Person) {	
name = "homer"	
age = 45	
props = [overweight: true, height: "1.8m"]	
children = ["bart", "lisa"]	
}	
util.list(id: 'foo') {	
value 'one'	
value 'two'	
}	
}
21
Conditional Beans
•  A generalized model for conditional bean definitions
•  A more flexible and more dynamic variant of bean
definition profiles (as known from Spring 3.1)
•  Can be used for smart defaulting
•  See Spring Boot J
22
@Conditional
•  @Conditional annotation with programmatic Condition
implementations
•  Can react to rich context (existing bean definitions, etc.)
•  @Profile support now simply a ProfileCondition
implementation class
23
Composable Annotations w/ Overrides
•  Composable annotations may override attributes of meta-
annotations
•  Purely convention-based
–  Matched by attribute name and type
•  Cannot override the value attribute
24
Optional Annotation Attribute Override
@Scope("session")	
@Retention(RUNTIME)	
public @interface SessionScoped {	
	
ScopedProxyMode proxyMode() default ScopedProxyMode.NO;	
}	
	
	
@SessionScoped(proxyMode = TARGET_CLASS)	
public class MyScopedService {	
// ...	
}
optional
25
Required Annotation Attribute Override
@Transactional(rollbackFor = Exception.class)	
@Service	
@Retention(RUNTIME)	
public @interface TransactionalService {	
	
boolean readOnly(); // No default!	
}	
	
	
@TransactionalService(readOnly = true)	
public class MyService {	
// ...	
}
required
26
Lazy Bean Resolution Proxies
•  @Autowired @Lazy on injection point
•  Alternative to:
–  Spring’s ObjectFactory	
–  JSR-330’s Provider<MyTargetType>
27
Ordered Injection of Lists & Arrays
•  Ordered / @Order on candidate beans
•  Relative order within specific injection result
28
DI and Generics
•  Generic factory methods now fully supported in XML
configuration files
–  Mockito
–  EasyMock
–  custom
•  Type matching based on full generic type
–  e.g., MyRepository<Account>
29
Generics-based Injection Matching
@Bean	
public MyRepository<Account> accountRepository() {	
return new MyAccountRepositoryImpl();	
}	
	
	
@Service	
public class MyBookService implements BookService {	
	
@Autowired	
public MyBookService(MyRepository<Account> repo) {	
// ...	
}	
}
30
Target-class Proxies & Arbitrary Ctors
•  Before:
–  Constructor invoked when creating proxy with CGLIB
–  Potentially with adverse side effects
•  constructor invoked twice
•  Now:
–  Using Objenesis instead of CGLIB directly
–  Constructor not invoked on proxy
–  Arbitrary constructor supported on target
31
spring-messaging
•  New org.springframework.messaging module
•  Extracted from Spring Integration
•  Core message and channel abstractions
32
WebSockets
•  WebSocket endpoint model along the lines of Spring MVC
•  JSR-356 but also covering SockJS and STOMP
•  Endpoints using generic messaging patterns
33
STOMP over WebSocket
@Controller	
public class MyStompController {	
	
@SubscribeMapping("/portfolios")	
public List<Portfolio> getPortfolios(Principal user) {	
// ...	
}	
	
@MessageMapping("/trade")	
public void executeTrade(Trade trade, Principal user) {	
// ...	
}	
}
34
AsyncRestTemplate
•  Analogous to existing RestTemplate	
•  Based on ListenableFuture return values
•  Custom listeners implement ListenableFutureCallback
35
Spring + Java SE & Java EE
36
Java SE Support
•  Spring 3.1 / 3.2
–  explicit Java 7 support
–  JDK 5 à JDK 7
•  Spring 4.0
–  introduces explicit Java 8 support
–  JDK 6 à JDK 8
37
Java EE Support
•  Spring 3.1 / 3.2
–  strong Servlet 3.0 focus
–  J2EE 1.4 (deprecated) à Java EE 6
•  Spring 4.0
–  introduces explicit Java EE 7 support
–  Java EE 5 (with JPA 2.0 feature pack) à Java EE 7
38
Enterprise API Updates
•  JMS 2.0
–  delivery delay, JMS 2.0 createSession() variants, etc.
•  JTA 1.2
–  @javax.transaction.Transactional annotation
•  JPA 2.1
–  unsynchronized persistence contexts
•  Bean Validation 1.1
–  method parameter and return value constraints
39
Java 8 Programming Model
40
Java 8 Bytecode Level
•  Generated by -target 1.8	
–  compiler's default
•  Not accepted by ASM 4.x
–  Spring's bytecode parsing library
•  Spring Framework 4.0 comes with a patched, inlined (i.e.,
jarjar’ed) ASM 4.1 variant
•  Spring Framework 4.0.3 comes with ASM 5.0 inlined (i.e.,
jarjar’ed)
41
HashMap / HashSet Differences
•  Different hash algorithms in use
•  Leading to different hash iteration order
•  Code shouldn't rely on such an order but sometimes does
42
Java 8 Lambda Conventions
Simple rule: interface with single method
–  typically callback interfaces
–  for example: Runnable, Callable	
–  formerly “Single Abstract Method” (SAM) types
–  now “functional interfaces”
•  see @FunctionalInterface
43
Lambda + Spring = Natural Fit
Many Spring APIs are candidates for lambdas
–  simply by following the lambda interface conventions
44
Lambdas with JmsTemplate
MessageCreator
Message createMessage(Session session)	
	throws JMSException
45
Lambdas with TransactionTemplate
TransactionCallback
Object doInTransaction(TransactionStatus status)
46
Lambdas with JdbcTemplate
RowMapper
Object mapRow(ResultSet rs, int rowNum)	
	throws SQLException
47
Ex: Lambdas with JdbcTemplate #1
JdbcTemplate jt = new JdbcTemplate(dataSource);	
jt.query(	
"SELECT name, age FROM person WHERE dep = ?",	
ps -> ps.setString(1, "Sales"),	
(rs, rowNum) -> new Person(rs.getString(1),	
rs.getInt(2))	
);
48
Ex: Lambdas with JdbcTemplate #2
JdbcTemplate jt = new JdbcTemplate(dataSource);	
	
jt.query(	
"SELECT name, age FROM person WHERE dep = ?",	
ps -> {	
ps.setString(1, "Sales");	
},	
(rs, rowNum) -> {	
return new Person(rs.getString(1), rs.getInt(2));	
}	
);
49
Method References
public List<Person> getPersonList(String department) {	
JdbcTemplate jt = new JdbcTemplate(dataSource);	
return jt.query(	
"SELECT name, age FROM person WHERE dep = ?",	
ps -> {	
ps.setString(1, "Sales");	
},	
this::mapPerson);	
}	
	
private Person mapPerson(ResultSet rs, int rowNum)	
throws SQLException {	
return new Person(rs.getString(1), rs.getInt(2));	
}
50
JSR-310 Date and Time
import java.time.*;	
import org.springframework.format.annotation.*;	
	
public class Customer {	
	
// @DateTimeFormat(iso=ISO.DATE)	
private LocalDate birthDate;	
	
@DateTimeFormat(pattern="M/d/yy h:mm")	
private LocalDateTime lastContact;	
	
// ...	
	
}
51
@Repeatable Annotations
@Scheduled(cron = "0 0 12 * * ?")	
@Scheduled(cron = "0 0 18 * * ?")	
public void performTempFileCleanup() { /* ... */ }	
	
	
	
@Schedules({	
@Scheduled(cron = "0 0 12 * * ?"),	
@Scheduled(cron = "0 0 18 * * ?")	
})	
public void performTempFileCleanup() { /* ... */ }	
JDK 8
JDK 5+
container
repeated
52
Parameter Name Discovery
•  Java 8 defines a Parameter reflection type for methods
–  application sources compiled with –parameters	
•  Spring's StandardReflectionParameterNameDiscoverer	
–  reads parameter names via Java 8's new Parameter
type
•  Spring's DefaultParameterNameDiscoverer	
–  now checks Java 8 first (-parameters)
–  ASM-based reading of debug symbols next (-debug)
53
Ex: Parameter Name Discovery
@Controller	
public void BookController {	
	
@RequestMapping(value = "/books/{id}", method = GET)	
public Book findBook(@PathVariable long id) {	
return this.bookService.findBook(isbn);	
}	
	
}	
path variable
parameter name
54
Spring Framework 4.1
55
Themes in Spring 4.1
•  Comprehensive web resource handling
–  Resource pipelining, cache control refinements
•  Caching support revisited
–  Alignment with JCache 1.0 final, user-requested enhancements
•  JMS support overhaul
–  Alignment with messaging module, annotation-driven endpoints
•  Performance and container improvements
–  Application startup, SpEL expression evaluation, DI for generics and factory
methods
•  Unified meta-annotation programming model
–  Custom attribute overrides, value-aliases, etc.
•  Numerous new testing features
–  Groovy config, SQL script execution, bootstrap strategy, programmatic
transaction management, etc.
56
Spring MVC and Messaging
•  GroovyWebApplicationContext (SPR-11371)
•  Static resource handling in Spring MVC (SPR-10933)
•  WebSocket scope (SPR-11305)
57
Static Resource Handling in Web MVC
•  ResourceResolver API for resolving:
–  Internal static resources
–  External resource paths (i.e., links)
•  ResourceResolverChain
–  Maintains a chain of resolvers
–  Allowing for delegation
•  Configured via ResourceHandlerRegistry	
–  For example, via WebMvcConfigurationSupport
58
ResourceResolver Implementations
•  PathResourceResolver	
–  Default
–  Configure at end of chain
•  PrefixResourceResolver	
–  Custom prefix: version, release date, etc.
•  FingerprintResourceResolver	
–  MD5 hash in file name
•  GzipResourceResolver	
–  gzip compressed resources
59
Ex: Registering Resource Resolvers
@Configuration	
public class WebConfig extends WebMvcConfigurationSupport {	
	
@Override	
public void addResourceHandlers(ResourceHandlerRegistry 	
registry) {	
	
registry.addResourceHandler("/resources/**")	
.addResourceLocations("classpath:/web-resources/")	
.setResourceResolvers(new FingerprintResourceResolver(),	
new PathResourceResolver());	
}	
	
}	
resolver chain
60
JCache (JSR-107) and Spring
•  JCache 1.0 annotations now supported in Spring
•  Integration based on Spring’s own Cache and CacheManager
APIs
–  JCacheCache and JCacheCacheManager	
•  Enabled via Spring’s standard mechanisms:
–  XML: <cache:annotation-driven />	
–  Java: @EnableCaching	
•  Cache Abstraction: JCache (JSR-107) Annotations Support
–  https://spring.io/blog/2014/04/14/cache-abstraction-
jcache-jsr-107-annotations-support
61
Caching Annotation Comparison
Spring JCache
@Cacheable	 @CacheResult	
@CachePut	 @CachePut	
@CacheEvict	 @CacheRemove	
@CacheEvict(allEntries=true)	 @CacheRemoveAll
62
JMS Overhaul
•  Alignment with spring-messaging module
•  Annotation-driven endpoints
–  Analogous to <jms:listener-container />
–  Listener methods declared via @JmsListener	
–  Configured via:
•  XML: <jms:annotation-driven />	
•  Java: @EnableJms and JmsListenerConfigurer
63
Ex: @EnableJms and JavaConfig
@Configuration	
@EnableJms	
public class JmsConfig {	
	
@Bean	
public JmsListenerContainerFactory jmsListenerContainerFactory() {	
DefaultJmsListenerContainerFactory factory =	
new DefaultJmsListenerContainerFactory();	
	
factory.setConnectionFactory(connectionFactory());	
factory.setDestinationResolver(destinationResolver());	
factory.setConcurrency("5");	
	
return factory;	
}	
// other @Bean definitions	
}
64
Ex: @JmsListener
@Service	
public class MyService {	
	
@JmsListener(destination = "myQueue")	
public void process(String msg) {	
// process incoming message	
}	
}
65
Container Odds & Ends
•  @javax.annotation.Priority can be used as an
alternative to Spring’s:
–  @Order (SPR-11639)
–  @Primary (SPR-10548)
•  Annotation-driven application event listeners (SPR-11622)
–  @Listen methods instead of implementing
ApplicationListener
•  Unified meta-annotation programming model (SPR-11511)
–  Custom attribute overrides, value-aliases, etc.
66
Testing with Spring 4.1
•  Groovy config for bean definitions
•  SQL script execution and database configuration
–  ScriptUtils, ResourceDatabasePopulator, @SqlScript
•  TestContextBootstrapper strategy
–  Programmatic configuration for default
TestExecutionListeners and SmartContextLoader	
–  Configured via @BootstrapWith	
•  Programmatic starting and stopping of transactions in
integration tests
•  Numerous configuration, caching, and performance
improvements
67
Ex: EmbeddedDatabaseBuilder
EmbeddedDatabase db = new EmbeddedDatabaseBuilder()	
.setType(H2)	
.setScriptEncoding("UTF-8")	
.ignoreFailedDrops(true)	
.addScript("schema.sql")	
.addScripts("user_data.sql", "country_data.sql")	
.build();	
	
// ...	
	
db.shutdown();
68
Spring Framework 4.1 Roadmap
•  4.1 RC1: June 2014
•  4.1 RC2: July 2014
•  4.1 GA: September 2014
69
In Closing…
70
Upgrade Considerations
•  Spring 3.2 does not support 1.8 bytecode level
–  upgrade to Spring 4.0+ to enable Java 8 language features
–  caveat: partial support added in 3.2.9 (SPR-11656)
•  We strongly recommend an early upgrade to Spring 4
–  Spring Framework 4.0 still compatible with JDK 6 and 7
–  Spring Framework 3.2 is in maintenance mode
•  Spring Framework 4.0 GA released in December 2013
–  4.0.3 was released on March 26th, 2014
–  4.0.4 scheduled for end of April 2014
•  Spring Framework 4.1 GA scheduled for Sep. 2014
71
Acknowledgements
Thanks to Jürgen Höller and Stéphane Nicoll for
permitting reuse of some of their content.
72
Spring Resources
•  Spring Framework
–  http://projects.spring.io/spring-framework
•  Spring Guides
–  http://spring.io/guides
•  Spring Forums
–  http://forum.spring.io
•  Spring JIRA
–  https://jira.spring.io
•  Spring on GitHub
–  https://github.com/spring-projects/spring-framework
73
Blogs
•  Swiftmind Blog
–  http://www.swiftmind.com/blog
•  Spring Blog
–  http://spring.io/blog
74
Q & A
Sam Brannen
twitter: @sam_brannen
www.slideshare.net/sbrannen
www.swiftmind.com

More Related Content

What's hot

Spring introduction
Spring introductionSpring introduction
Spring introductionManav Prasad
 
Spring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-CoreSpring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-CoreDonald Lika
 
Java spring framework
Java spring frameworkJava spring framework
Java spring frameworkRajiv Gupta
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCFunnelll
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkASG
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkRaveendra R
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02Guo Albert
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
 
JAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next Generation
JAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next GenerationJAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next Generation
JAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next Generationjazoon13
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkHùng Nguyễn Huy
 
Spring core module
Spring core moduleSpring core module
Spring core moduleRaj Tomar
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC frameworkMohit 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
 

What's hot (19)

Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Spring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-CoreSpring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-Core
 
Spring framework core
Spring framework coreSpring framework core
Spring framework core
 
Java spring framework
Java spring frameworkJava spring framework
Java spring framework
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
JAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next Generation
JAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next GenerationJAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next Generation
JAZOON'13 - Sam Brannen - Spring Framework 4.0 - The Next Generation
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring core module
Spring core moduleSpring core module
Spring core module
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
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
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 

Viewers also liked

Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!Jakub Kubrynski
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.xSam Brannen
 
That old Spring magic has me in its SpEL
That old Spring magic has me in its SpELThat old Spring magic has me in its SpEL
That old Spring magic has me in its SpELCraig Walls
 
Modular Java - OSGi
Modular Java - OSGiModular Java - OSGi
Modular Java - OSGiCraig Walls
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJoshua Long
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action Alex Movila
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVCIndicThreads
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webserviceDong Ngoc
 
Java persistence api
Java persistence api Java persistence api
Java persistence api Luis Goldster
 

Viewers also liked (19)

Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.x
 
That old Spring magic has me in its SpEL
That old Spring magic has me in its SpELThat old Spring magic has me in its SpEL
That old Spring magic has me in its SpEL
 
Modular Java - OSGi
Modular Java - OSGiModular Java - OSGi
Modular Java - OSGi
 
Spring boot
Spring bootSpring boot
Spring boot
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
 
Boot It Up
Boot It UpBoot It Up
Boot It Up
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 
Java persistence api
Java persistence api Java persistence api
Java persistence api
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
Spring Mvc Rest
Spring Mvc RestSpring Mvc Rest
Spring Mvc Rest
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
 

Similar to Spring Framework 4.0 to 4.1

Spring 4-groovy
Spring 4-groovySpring 4-groovy
Spring 4-groovyGR8Conf
 
Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsSam Brannen
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Sam Brannen
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Sam Brannen
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenJAX London
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffJAX London
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8Kyle Smith
 
Testing with Spring: An Introduction
Testing with Spring: An IntroductionTesting with Spring: An Introduction
Testing with Spring: An IntroductionSam Brannen
 
Playing with Java Classes and Bytecode
Playing with Java Classes and BytecodePlaying with Java Classes and Bytecode
Playing with Java Classes and BytecodeYoav Avrahami
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSam Brannen
 
Byte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in JavaByte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in JavaAlex Moskvin
 

Similar to Spring Framework 4.0 to 4.1 (20)

Spring 4-groovy
Spring 4-groovySpring 4-groovy
Spring 4-groovy
 
Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web Applications
 
Java SE 8 & EE 7 Launch
Java SE 8 & EE 7 LaunchJava SE 8 & EE 7 Launch
Java SE 8 & EE 7 Launch
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
 
Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8
 
Lambdas in Java 8
Lambdas in Java 8Lambdas in Java 8
Lambdas in Java 8
 
Java 8
Java 8Java 8
Java 8
 
Scala and Spring
Scala and SpringScala and Spring
Scala and Spring
 
Testing with Spring: An Introduction
Testing with Spring: An IntroductionTesting with Spring: An Introduction
Testing with Spring: An Introduction
 
Playing with Java Classes and Bytecode
Playing with Java Classes and BytecodePlaying with Java Classes and Bytecode
Playing with Java Classes and Bytecode
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
 
Jsp
JspJsp
Jsp
 
Byte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in JavaByte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in Java
 
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion MiddlewareAMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
 
JSF2
JSF2JSF2
JSF2
 

More from Sam Brannen

Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023
Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023
Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023Sam Brannen
 
Testing with JUnit 5 and Spring - Spring I/O 2022
Testing with JUnit 5 and Spring - Spring I/O 2022Testing with JUnit 5 and Spring - Spring I/O 2022
Testing with JUnit 5 and Spring - Spring I/O 2022Sam Brannen
 
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019Sam Brannen
 
JUnit 5: What's New and What's Coming - Spring I/O 2019
JUnit 5: What's New and What's Coming - Spring I/O 2019JUnit 5: What's New and What's Coming - Spring I/O 2019
JUnit 5: What's New and What's Coming - Spring I/O 2019Sam Brannen
 
JUnit 5 - New Opportunities for Testing on the JVM
JUnit 5 - New Opportunities for Testing on the JVMJUnit 5 - New Opportunities for Testing on the JVM
JUnit 5 - New Opportunities for Testing on the JVMSam Brannen
 
Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Sam Brannen
 
JUnit 5 - from Lambda to Alpha and beyond
JUnit 5 - from Lambda to Alpha and beyondJUnit 5 - from Lambda to Alpha and beyond
JUnit 5 - from Lambda to Alpha and beyondSam Brannen
 
Spring Framework 4.1
Spring Framework 4.1Spring Framework 4.1
Spring Framework 4.1Sam Brannen
 
Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with SpringSam Brannen
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Sam Brannen
 
Spring 3.1 and MVC Testing Support - 4Developers
Spring 3.1 and MVC Testing Support - 4DevelopersSpring 3.1 and MVC Testing Support - 4Developers
Spring 3.1 and MVC Testing Support - 4DevelopersSam Brannen
 
Effective out-of-container Integration Testing - 4Developers
Effective out-of-container Integration Testing - 4DevelopersEffective out-of-container Integration Testing - 4Developers
Effective out-of-container Integration Testing - 4DevelopersSam Brannen
 
Spring 3.1 to 3.2 in a Nutshell - SDC2012
Spring 3.1 to 3.2 in a Nutshell - SDC2012Spring 3.1 to 3.2 in a Nutshell - SDC2012
Spring 3.1 to 3.2 in a Nutshell - SDC2012Sam Brannen
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSam Brannen
 
Spring 3.1 in a Nutshell
Spring 3.1 in a NutshellSpring 3.1 in a Nutshell
Spring 3.1 in a NutshellSam Brannen
 
Effective out-of-container Integration Testing
Effective out-of-container Integration TestingEffective out-of-container Integration Testing
Effective out-of-container Integration TestingSam Brannen
 
What's New in Spring 3.0
What's New in Spring 3.0What's New in Spring 3.0
What's New in Spring 3.0Sam Brannen
 
Modular Web Applications with OSGi
Modular Web Applications with OSGiModular Web Applications with OSGi
Modular Web Applications with OSGiSam Brannen
 
Enterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm ServerEnterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm ServerSam Brannen
 

More from Sam Brannen (19)

Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023
Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023
Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023
 
Testing with JUnit 5 and Spring - Spring I/O 2022
Testing with JUnit 5 and Spring - Spring I/O 2022Testing with JUnit 5 and Spring - Spring I/O 2022
Testing with JUnit 5 and Spring - Spring I/O 2022
 
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
 
JUnit 5: What's New and What's Coming - Spring I/O 2019
JUnit 5: What's New and What's Coming - Spring I/O 2019JUnit 5: What's New and What's Coming - Spring I/O 2019
JUnit 5: What's New and What's Coming - Spring I/O 2019
 
JUnit 5 - New Opportunities for Testing on the JVM
JUnit 5 - New Opportunities for Testing on the JVMJUnit 5 - New Opportunities for Testing on the JVM
JUnit 5 - New Opportunities for Testing on the JVM
 
Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2
 
JUnit 5 - from Lambda to Alpha and beyond
JUnit 5 - from Lambda to Alpha and beyondJUnit 5 - from Lambda to Alpha and beyond
JUnit 5 - from Lambda to Alpha and beyond
 
Spring Framework 4.1
Spring Framework 4.1Spring Framework 4.1
Spring Framework 4.1
 
Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with Spring
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2
 
Spring 3.1 and MVC Testing Support - 4Developers
Spring 3.1 and MVC Testing Support - 4DevelopersSpring 3.1 and MVC Testing Support - 4Developers
Spring 3.1 and MVC Testing Support - 4Developers
 
Effective out-of-container Integration Testing - 4Developers
Effective out-of-container Integration Testing - 4DevelopersEffective out-of-container Integration Testing - 4Developers
Effective out-of-container Integration Testing - 4Developers
 
Spring 3.1 to 3.2 in a Nutshell - SDC2012
Spring 3.1 to 3.2 in a Nutshell - SDC2012Spring 3.1 to 3.2 in a Nutshell - SDC2012
Spring 3.1 to 3.2 in a Nutshell - SDC2012
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing Support
 
Spring 3.1 in a Nutshell
Spring 3.1 in a NutshellSpring 3.1 in a Nutshell
Spring 3.1 in a Nutshell
 
Effective out-of-container Integration Testing
Effective out-of-container Integration TestingEffective out-of-container Integration Testing
Effective out-of-container Integration Testing
 
What's New in Spring 3.0
What's New in Spring 3.0What's New in Spring 3.0
What's New in Spring 3.0
 
Modular Web Applications with OSGi
Modular Web Applications with OSGiModular Web Applications with OSGi
Modular Web Applications with OSGi
 
Enterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm ServerEnterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm Server
 

Recently uploaded

How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 

Recently uploaded (20)

Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 

Spring Framework 4.0 to 4.1

  • 1. Spring Framework 4.0 to 4.1 Sam Brannen @sam_brannen AJUG | Atlanta, GA, USA | April 22, 2014 Atlanta User Group
  • 2. 2 Sam Brannen •  Spring and Java Consultant @ Swiftmind •  Georgia Tech College of Computing Alumnus •  Java Developer for over 15 years •  Spring Framework Core Committer since 2007 •  Spring Trainer •  Speaker on Spring, Java, OSGi, and testing •  Swiss Spring User Group Lead
  • 3. 3 Swiftmind Your experts for Enterprise Java Areas of expertise •  Spring * •  Java EE •  OSGi •  Software Architecture •  Software Engineering Best Practices Where you find us •  Zurich, Switzerland •  @swiftmind •  http://www.swiftmind.com
  • 4. 4 A Show of Hands…
  • 5. 5 Agenda •  Spring 3.x in Review •  Themes in Spring 4.0 •  Java EE & SE •  Spring 4 on Java 8 •  Spring 4.1
  • 7. 7 Major Themes in Spring 3.x •  Powerful annotated component model •  Spring Expression Language (SpEL) •  Comprehensive REST support •  Support for async MVC processing •  Validation and Formatting •  Scheduling •  Caching
  • 8. 8 Spring 3.x: Key Specs (1/2) •  JSR-330 –  Dependency Injection for Java –  @Inject, @Qualifier, Provider mechanism •  JSR-303 –  Bean Validation 1.0 –  declarative constraints –  embedded validation engine
  • 9. 9 Spring 3.x: Key Specs (2/2) •  JPA 2.0 –  persistence provider integration –  Spring transactions •  Servlet 3.0 –  web.xml-free deployment –  async request processing
  • 10. 10 Testing in Spring 3.x •  Embedded databases via <jdbc /> namespace •  @Configuration classes & @ActiveProfiles •  @WebAppConfiguration •  @ContextHierarchy •  Spring MVC Test framework
  • 13. 13 Composable Stereotypes •  Combining meta-annotations on a custom stereotype •  Automatically detected: no configuration necessary!
  • 15. 15 Ready for New Application Architectures •  Embedded web servers and non-traditional data stores •  Lightweight messaging and WebSocket-style architectures •  Custom asynchronous processing with convenient APIs
  • 16. 16 New Baselines •  Java SE 6+ •  Java EE 6+ –  Servlet 3.0/3.1 focus –  Servlet 2.5 compatible •  All deprecated packages removed •  Many deprecated methods and fields removed as well
  • 17. 17 Third Party Libraries •  Minimum versions ~ mid 2010 now •  For example –  Hibernate 3.6+ –  Quartz 1.8+ –  Ehcache 2.1+
  • 18. 18 Java 8 Language and API Features •  Lambda expressions •  Method references •  JSR-310 Date and Time •  Repeatable annotations •  Parameter name discovery
  • 19. 19 Groovy + Spring 4.0 •  A smooth out-of-the-box experience for Groovy-based Spring applications •  AOP adaptations –  special handling of GroovyObject calls –  consider a Spring application with all components written in the Groovy language instead of Java •  Groovy-based bean definitions –  formerly known as the Bean Builder in Grails –  now lives alongside Spring's configuration class model
  • 20. 20 Spring Bean Def’s with Groovy DSL import org.mypackage.domain.Person; beans { xmlns util: 'http://www.springframework.org/schema/util' person1(Person) { name = "homer" age = 45 props = [overweight: true, height: "1.8m"] children = ["bart", "lisa"] } util.list(id: 'foo') { value 'one' value 'two' } }
  • 21. 21 Conditional Beans •  A generalized model for conditional bean definitions •  A more flexible and more dynamic variant of bean definition profiles (as known from Spring 3.1) •  Can be used for smart defaulting •  See Spring Boot J
  • 22. 22 @Conditional •  @Conditional annotation with programmatic Condition implementations •  Can react to rich context (existing bean definitions, etc.) •  @Profile support now simply a ProfileCondition implementation class
  • 23. 23 Composable Annotations w/ Overrides •  Composable annotations may override attributes of meta- annotations •  Purely convention-based –  Matched by attribute name and type •  Cannot override the value attribute
  • 24. 24 Optional Annotation Attribute Override @Scope("session") @Retention(RUNTIME) public @interface SessionScoped { ScopedProxyMode proxyMode() default ScopedProxyMode.NO; } @SessionScoped(proxyMode = TARGET_CLASS) public class MyScopedService { // ... } optional
  • 25. 25 Required Annotation Attribute Override @Transactional(rollbackFor = Exception.class) @Service @Retention(RUNTIME) public @interface TransactionalService { boolean readOnly(); // No default! } @TransactionalService(readOnly = true) public class MyService { // ... } required
  • 26. 26 Lazy Bean Resolution Proxies •  @Autowired @Lazy on injection point •  Alternative to: –  Spring’s ObjectFactory –  JSR-330’s Provider<MyTargetType>
  • 27. 27 Ordered Injection of Lists & Arrays •  Ordered / @Order on candidate beans •  Relative order within specific injection result
  • 28. 28 DI and Generics •  Generic factory methods now fully supported in XML configuration files –  Mockito –  EasyMock –  custom •  Type matching based on full generic type –  e.g., MyRepository<Account>
  • 29. 29 Generics-based Injection Matching @Bean public MyRepository<Account> accountRepository() { return new MyAccountRepositoryImpl(); } @Service public class MyBookService implements BookService { @Autowired public MyBookService(MyRepository<Account> repo) { // ... } }
  • 30. 30 Target-class Proxies & Arbitrary Ctors •  Before: –  Constructor invoked when creating proxy with CGLIB –  Potentially with adverse side effects •  constructor invoked twice •  Now: –  Using Objenesis instead of CGLIB directly –  Constructor not invoked on proxy –  Arbitrary constructor supported on target
  • 31. 31 spring-messaging •  New org.springframework.messaging module •  Extracted from Spring Integration •  Core message and channel abstractions
  • 32. 32 WebSockets •  WebSocket endpoint model along the lines of Spring MVC •  JSR-356 but also covering SockJS and STOMP •  Endpoints using generic messaging patterns
  • 33. 33 STOMP over WebSocket @Controller public class MyStompController { @SubscribeMapping("/portfolios") public List<Portfolio> getPortfolios(Principal user) { // ... } @MessageMapping("/trade") public void executeTrade(Trade trade, Principal user) { // ... } }
  • 34. 34 AsyncRestTemplate •  Analogous to existing RestTemplate •  Based on ListenableFuture return values •  Custom listeners implement ListenableFutureCallback
  • 35. 35 Spring + Java SE & Java EE
  • 36. 36 Java SE Support •  Spring 3.1 / 3.2 –  explicit Java 7 support –  JDK 5 à JDK 7 •  Spring 4.0 –  introduces explicit Java 8 support –  JDK 6 à JDK 8
  • 37. 37 Java EE Support •  Spring 3.1 / 3.2 –  strong Servlet 3.0 focus –  J2EE 1.4 (deprecated) à Java EE 6 •  Spring 4.0 –  introduces explicit Java EE 7 support –  Java EE 5 (with JPA 2.0 feature pack) à Java EE 7
  • 38. 38 Enterprise API Updates •  JMS 2.0 –  delivery delay, JMS 2.0 createSession() variants, etc. •  JTA 1.2 –  @javax.transaction.Transactional annotation •  JPA 2.1 –  unsynchronized persistence contexts •  Bean Validation 1.1 –  method parameter and return value constraints
  • 40. 40 Java 8 Bytecode Level •  Generated by -target 1.8 –  compiler's default •  Not accepted by ASM 4.x –  Spring's bytecode parsing library •  Spring Framework 4.0 comes with a patched, inlined (i.e., jarjar’ed) ASM 4.1 variant •  Spring Framework 4.0.3 comes with ASM 5.0 inlined (i.e., jarjar’ed)
  • 41. 41 HashMap / HashSet Differences •  Different hash algorithms in use •  Leading to different hash iteration order •  Code shouldn't rely on such an order but sometimes does
  • 42. 42 Java 8 Lambda Conventions Simple rule: interface with single method –  typically callback interfaces –  for example: Runnable, Callable –  formerly “Single Abstract Method” (SAM) types –  now “functional interfaces” •  see @FunctionalInterface
  • 43. 43 Lambda + Spring = Natural Fit Many Spring APIs are candidates for lambdas –  simply by following the lambda interface conventions
  • 44. 44 Lambdas with JmsTemplate MessageCreator Message createMessage(Session session) throws JMSException
  • 45. 45 Lambdas with TransactionTemplate TransactionCallback Object doInTransaction(TransactionStatus status)
  • 46. 46 Lambdas with JdbcTemplate RowMapper Object mapRow(ResultSet rs, int rowNum) throws SQLException
  • 47. 47 Ex: Lambdas with JdbcTemplate #1 JdbcTemplate jt = new JdbcTemplate(dataSource); jt.query( "SELECT name, age FROM person WHERE dep = ?", ps -> ps.setString(1, "Sales"), (rs, rowNum) -> new Person(rs.getString(1), rs.getInt(2)) );
  • 48. 48 Ex: Lambdas with JdbcTemplate #2 JdbcTemplate jt = new JdbcTemplate(dataSource); jt.query( "SELECT name, age FROM person WHERE dep = ?", ps -> { ps.setString(1, "Sales"); }, (rs, rowNum) -> { return new Person(rs.getString(1), rs.getInt(2)); } );
  • 49. 49 Method References public List<Person> getPersonList(String department) { JdbcTemplate jt = new JdbcTemplate(dataSource); return jt.query( "SELECT name, age FROM person WHERE dep = ?", ps -> { ps.setString(1, "Sales"); }, this::mapPerson); } private Person mapPerson(ResultSet rs, int rowNum) throws SQLException { return new Person(rs.getString(1), rs.getInt(2)); }
  • 50. 50 JSR-310 Date and Time import java.time.*; import org.springframework.format.annotation.*; public class Customer { // @DateTimeFormat(iso=ISO.DATE) private LocalDate birthDate; @DateTimeFormat(pattern="M/d/yy h:mm") private LocalDateTime lastContact; // ... }
  • 51. 51 @Repeatable Annotations @Scheduled(cron = "0 0 12 * * ?") @Scheduled(cron = "0 0 18 * * ?") public void performTempFileCleanup() { /* ... */ } @Schedules({ @Scheduled(cron = "0 0 12 * * ?"), @Scheduled(cron = "0 0 18 * * ?") }) public void performTempFileCleanup() { /* ... */ } JDK 8 JDK 5+ container repeated
  • 52. 52 Parameter Name Discovery •  Java 8 defines a Parameter reflection type for methods –  application sources compiled with –parameters •  Spring's StandardReflectionParameterNameDiscoverer –  reads parameter names via Java 8's new Parameter type •  Spring's DefaultParameterNameDiscoverer –  now checks Java 8 first (-parameters) –  ASM-based reading of debug symbols next (-debug)
  • 53. 53 Ex: Parameter Name Discovery @Controller public void BookController { @RequestMapping(value = "/books/{id}", method = GET) public Book findBook(@PathVariable long id) { return this.bookService.findBook(isbn); } } path variable parameter name
  • 55. 55 Themes in Spring 4.1 •  Comprehensive web resource handling –  Resource pipelining, cache control refinements •  Caching support revisited –  Alignment with JCache 1.0 final, user-requested enhancements •  JMS support overhaul –  Alignment with messaging module, annotation-driven endpoints •  Performance and container improvements –  Application startup, SpEL expression evaluation, DI for generics and factory methods •  Unified meta-annotation programming model –  Custom attribute overrides, value-aliases, etc. •  Numerous new testing features –  Groovy config, SQL script execution, bootstrap strategy, programmatic transaction management, etc.
  • 56. 56 Spring MVC and Messaging •  GroovyWebApplicationContext (SPR-11371) •  Static resource handling in Spring MVC (SPR-10933) •  WebSocket scope (SPR-11305)
  • 57. 57 Static Resource Handling in Web MVC •  ResourceResolver API for resolving: –  Internal static resources –  External resource paths (i.e., links) •  ResourceResolverChain –  Maintains a chain of resolvers –  Allowing for delegation •  Configured via ResourceHandlerRegistry –  For example, via WebMvcConfigurationSupport
  • 58. 58 ResourceResolver Implementations •  PathResourceResolver –  Default –  Configure at end of chain •  PrefixResourceResolver –  Custom prefix: version, release date, etc. •  FingerprintResourceResolver –  MD5 hash in file name •  GzipResourceResolver –  gzip compressed resources
  • 59. 59 Ex: Registering Resource Resolvers @Configuration public class WebConfig extends WebMvcConfigurationSupport { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("classpath:/web-resources/") .setResourceResolvers(new FingerprintResourceResolver(), new PathResourceResolver()); } } resolver chain
  • 60. 60 JCache (JSR-107) and Spring •  JCache 1.0 annotations now supported in Spring •  Integration based on Spring’s own Cache and CacheManager APIs –  JCacheCache and JCacheCacheManager •  Enabled via Spring’s standard mechanisms: –  XML: <cache:annotation-driven /> –  Java: @EnableCaching •  Cache Abstraction: JCache (JSR-107) Annotations Support –  https://spring.io/blog/2014/04/14/cache-abstraction- jcache-jsr-107-annotations-support
  • 61. 61 Caching Annotation Comparison Spring JCache @Cacheable @CacheResult @CachePut @CachePut @CacheEvict @CacheRemove @CacheEvict(allEntries=true) @CacheRemoveAll
  • 62. 62 JMS Overhaul •  Alignment with spring-messaging module •  Annotation-driven endpoints –  Analogous to <jms:listener-container /> –  Listener methods declared via @JmsListener –  Configured via: •  XML: <jms:annotation-driven /> •  Java: @EnableJms and JmsListenerConfigurer
  • 63. 63 Ex: @EnableJms and JavaConfig @Configuration @EnableJms public class JmsConfig { @Bean public JmsListenerContainerFactory jmsListenerContainerFactory() { DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); factory.setConnectionFactory(connectionFactory()); factory.setDestinationResolver(destinationResolver()); factory.setConcurrency("5"); return factory; } // other @Bean definitions }
  • 64. 64 Ex: @JmsListener @Service public class MyService { @JmsListener(destination = "myQueue") public void process(String msg) { // process incoming message } }
  • 65. 65 Container Odds & Ends •  @javax.annotation.Priority can be used as an alternative to Spring’s: –  @Order (SPR-11639) –  @Primary (SPR-10548) •  Annotation-driven application event listeners (SPR-11622) –  @Listen methods instead of implementing ApplicationListener •  Unified meta-annotation programming model (SPR-11511) –  Custom attribute overrides, value-aliases, etc.
  • 66. 66 Testing with Spring 4.1 •  Groovy config for bean definitions •  SQL script execution and database configuration –  ScriptUtils, ResourceDatabasePopulator, @SqlScript •  TestContextBootstrapper strategy –  Programmatic configuration for default TestExecutionListeners and SmartContextLoader –  Configured via @BootstrapWith •  Programmatic starting and stopping of transactions in integration tests •  Numerous configuration, caching, and performance improvements
  • 67. 67 Ex: EmbeddedDatabaseBuilder EmbeddedDatabase db = new EmbeddedDatabaseBuilder() .setType(H2) .setScriptEncoding("UTF-8") .ignoreFailedDrops(true) .addScript("schema.sql") .addScripts("user_data.sql", "country_data.sql") .build(); // ... db.shutdown();
  • 68. 68 Spring Framework 4.1 Roadmap •  4.1 RC1: June 2014 •  4.1 RC2: July 2014 •  4.1 GA: September 2014
  • 70. 70 Upgrade Considerations •  Spring 3.2 does not support 1.8 bytecode level –  upgrade to Spring 4.0+ to enable Java 8 language features –  caveat: partial support added in 3.2.9 (SPR-11656) •  We strongly recommend an early upgrade to Spring 4 –  Spring Framework 4.0 still compatible with JDK 6 and 7 –  Spring Framework 3.2 is in maintenance mode •  Spring Framework 4.0 GA released in December 2013 –  4.0.3 was released on March 26th, 2014 –  4.0.4 scheduled for end of April 2014 •  Spring Framework 4.1 GA scheduled for Sep. 2014
  • 71. 71 Acknowledgements Thanks to Jürgen Höller and Stéphane Nicoll for permitting reuse of some of their content.
  • 72. 72 Spring Resources •  Spring Framework –  http://projects.spring.io/spring-framework •  Spring Guides –  http://spring.io/guides •  Spring Forums –  http://forum.spring.io •  Spring JIRA –  https://jira.spring.io •  Spring on GitHub –  https://github.com/spring-projects/spring-framework
  • 73. 73 Blogs •  Swiftmind Blog –  http://www.swiftmind.com/blog •  Spring Blog –  http://spring.io/blog
  • 74. 74 Q & A Sam Brannen twitter: @sam_brannen www.slideshare.net/sbrannen www.swiftmind.com