65.9K
CodeProject is changing. Read more.
Home

Spring Geek Night

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Mar 3, 2010

CPOL
viewsIcon

5610

Spring Geek Night at Technopark Zurich

SpingSource

Spring Geek Night at Technopark Zurich


Yesterday, I was at the spring geek night in Zurich. Sam Brannen, the author of the Spring TestContext Framework and previously a member of the SpringSource dm Server development team, has presented the new features of Spring 3.0.

With Spring 3.0, nearly everything is annotable. So, for all those who hate XML with Spring 3.0, you can now declare all things in your code.

A very magic stuff are these meta-annotations. Means, "annotate your annotations" and use the combination of it.

Normally, you have done something like this.

@Service
@Transactional
public class CustomerService{
...
}

Then you can define the combination.

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Service
@Transactional
public @interface TransactionalService {}

Now you can use this new annotation for your services.

@TransactionalService 
public class CustomerService{
...
}

I know this is a Java feature, but I've never realised that's possible.

<iframe language="javascript1.1" marginwidth="0" marginheight="0" src=""http://ads.geekswithblogs.net/a.aspx?ZoneID=5&Task=Get&PageID=31016&SiteID=1"" frameborder="0" width="1" height="1" />