This week in Spring: February 22nd, 2011

Engineering | Josh Long | February 23, 2011 | ...

What a week! Lots of good, foundational content available this week from, and for, the community. Let's get right to it.

     <li> <a href="http://blog.springsource.com/2011/02/21/spring-3-1-m1-mvc-namespace-enhancements-and-configuration/">Rossen Stoyanchev</a> continues the whirlwind introduction to the new features in Spring 3.1, this time with a look at the MVC namespace and @Configuration-based improvements. </li>
    
  1. Chris Beams blogged about the upcoming FeatureSpecification support in Spring 3.1 Feature Specifications provide the same features as the XML namespace infrastructure elements, like <tx:annotation-driven>, in a Java configuration-centric way. This is a very powerful feature, and this blog post is the best way to get started.
  2. SpringSource Tool Suite lead Christian Dupuis - tweets that users can now download STS without submitting to the registration form. Very cool!
  3. <li> Can't get enough Spring? 
    

    Check out Spring on your favorite social network!

  4. Glyn Normington has just announced the Eclipse Virgo 3.0.0.M01 release is now available for download. The new version features tighter integration with the Eclipse stack, including the Eclipse Virgo Jetty…

Spring 3.1 M1: Cache Abstraction

Engineering | Costin Leau | February 23, 2011 | ...

One of the major features added in Spring Framework 3.1 M1 is the generic cache abstraction for transparently applying caching to Spring applications. Just like the transaction support, the caching abstraction allows consistent use of various caching solutions with minimal impact on the code.

Purpose

Caches are in general used to improve application performance by transparently serving frequently accessed data in a faster fashion such as serving data from local memory rather than from the network. Many of you have already used caching, whether knowingly or not: most ORM/JPA frameworks provide…

Spring 3.1 M1: MVC Namespace Enhancements and @Configuration

Engineering | Rossen Stoyanchev | February 21, 2011 | ...

In this 5th post of the series describing Spring 3.1 M1 features, I will focus on web applications. In the first half I'll discuss enhancements to the MVC XML namespace. Then I'll show how to create the equivalent of the MVC namespace with all Java configuration. At the end I mention some of the Servlet 3.0 related configuration changes you can expect in 3.1 M2.

MVC Namespace Improvements

Spring MVC 3.0 provided a custom MVC namespace. The centerpiece of the namespace -- the <mvc:annotation-driven> element, configured everything required to process requests with annotated controller methods. More importantly though it…

Spring 3.1 M1: Introducing FeatureSpecification support

Engineering | Chris Beams | February 17, 2011 | ...

UPDATE: The FeatureSpecification functionality described in this blog post was removed in Spring Framework 3.1 M2 in favor of @Enable* annotations. See the 3.1 M2 announcement for more information.

Introduction

Earlier in this series I touched on how the new @Profile annotation can be used in conjunction with @Configuration classes to take advantage of Spring's bean definition profiles. Today, we'll look at an entirely new addition to the code-based configuration landscape in Spring 3.1: FeatureSpecification classes and their related support.

I've put together a sample project to accompany this post. Find it at https://github.com/cbeams/spring-3.1-featurespec and follow the instructions in the README

This week in Spring: February 15th, 2011

Engineering | Josh Long | February 16, 2011 | ...

This last week has seen a record number of... well, records, if nothing else! First, Juergen Hoeller - Spring project lead and all around nice guy - gave a webinar introducing the new features in Spring 3.1 to record attendance numbers. Then, as if that weren't enough, the next day the first milestone of Spring 3.1 was released to record numbers of downloads. That would've been enough. I don't know about you, but I could've stopped right there. Then, over the course of the last week we've seen what I imagine is a record number of new releases from other Spring projects! Finally, yesterday, no doubt in reaction to all this other record activity, we saw the largest record number of people hit the SpringSource blog yet! In summary, Spring 3.1 milestone mania, numerous new projects, and as always a healthy dose of community-awesomeness (go team!)

 </p> 
      <li>Hot on the heels of Juergen's Spring 3.1 webinar, Chris Beams got the ball rolling on the  first three   of many  posts on the numerous new features in Spring 3.1. 
    	
    	<a href="http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/">
    

    The first post introduces Spring 3.1 M1, generally. The second post introduces Spring 3.1's "profiles," which let you partition your beans along environment-specific lines with Environments. The third post introduces the Unified Property Management capabilities of the Environment abstraction.

    	  </li>
    
    
    <li>
    	Matt Raible has put…

GORM for MongoDB: New Milestone, Richer Experience

Engineering | Graeme Rocher | February 15, 2011 | ...

Last year we introduced support for MongoDB in GORM (along with many other GORM implementations) and it has been extremely well received by the community. We have had a ton of feedback, and today we are pleased to announce a new release (Milestone 2) which addresses some of the feedback we have received.

Embedded Document Support

The number one requested feature was nested document support and in this release we have improved that significantly. Now you can embed other domains using the standard embedded mapping in GORM:

class Person {
  String firstName
  String lastName
  Address address…

Spring 3.1 M1: Unified Property Management

Engineering | Chris Beams | February 15, 2011 | ...

In the first two posts of this series, I described the bean definition profiles feature, and how it relates to the Environment abstraction new in Spring 3.1 M1. Today we'll take a look at a second aspect of the Environment -- how it helps simplify the concern of configuration property management.

Understanding property sources

Spring's Environment abstraction provides search operations over a configurable hierarchy of property sources. To explain fully, consider the following:


ApplicationContext ctx = new GenericApplicationContext();
Environment env = ctx.getEnvironment();
boolean containsFoo = env.containsProperty…

Spring 3.1 M1: Introducing @Profile

Engineering | Chris Beams | February 14, 2011 | ...

Introduction

In my earlier post announcing Spring 3.1 M1, I discussed the new bean definition profiles feature as applied when using Spring <beans/> XML to configure the container. Today we'll introduce the new @Profile annotation and see how this same feature can be applied when using @Configuration classes instead of XML. Along the way we'll cover some best practices for designing @Configuration classes.

Recall @Configuration

For those unfamiliar with @Configuration classes, you can think of them as a pure-Java equivalent to Spring <beans/> XML files. We've blogged about this featureset before, and the reference documentation covers it well. You may want to revisit those resources if you need an…

Spring Framework 3.1 M1 released

Engineering | Chris Beams | February 11, 2011 | ...

The first milestone release of Spring 3.1 has just been published [1], and this article kicks off a series of posts where I and other team members will walk through each of the major features. Even in the first milestone there's already a lot to talk about!

  • Bean definition profiles
  • Unified property management through Spring's new Environment abstraction
  • Enhancements to Java-based configuration with @Feature methods
  • Expanded MVC namespace support and a Java-based configuration equivalent
  • Streaming support and new interception model for the RestTemplate API
  • Comprehensive caching support
  • New c: XML namespace for concise configuration of constructor injection

Today I'll be covering the first item -- a new feature we call bean definition profiles. One of our most frequent requests has been to provide a mechanism in the core container that allows for registration of different beans in different environments. The word "environment" can mean different things to different users, but a typical scenario might be registering monitoring infrastructure only when deploying an application into a performance environment, or registering customized implementations of beans for customer A vs. customer B deployments. Perhaps one of the most common cases would be working against a standalone datasource in development vs looking up that same datasource from JNDI when in QA or production. Bean definition profiles represent a general-purpose way to satisfy use cases of this kind, and we'll explore the latter use case in the examples below.

Get hands-on with a sample

I've developed a small sample to accompany this post, and you might like to take a moment now to check it out (if not, don't worry; you don't need the code to read along below). Just follow the instructions on the README at https://github.com/cbeams/spring-3.1-profiles-xml. If you're not familiar with Git, the README has instructions…

Getting started with Spring Data JPA

Engineering | Oliver Drotbohm | February 10, 2011 | ...

As we have just released the first milestone of the Spring Data JPA project I’d like to give you a quick introduction into its features. As you probably know, the Spring framework provides support to build a JPA based data access layer. So what does Spring Data JPA add to this base support? To answer that question I'd like to start with the data access components for a sample domain implemented using plain JPA + Spring and point out areas that leave room for improvement. After we've done that I will refactor the implementations to use the Spring Data JPA features to address these problem…

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all