Spring 3.0

download Spring 3.0

If you can't read please download the document

Transcript of Spring 3.0

Spring User Group France

Spring 3.0

Arnaud Cogolugnes25/02/2010

Agenda

Un peu d'histoire...

Les nouveauts de Spring 3.0Java 5, Expression Language, REST, etc.

So what?

Conclusion

Speaker

Arnaud CogolugnesConsultant chez Zenika

Utilise Spring depuis 2005

Certifi Spring Core et formateur certifi SpringSource

Co-auteur :

Spring par la pratique2nde dition

Spring Dynamic Modules in ActionManning Editionshttp://manning.com/cogoluegnesA paratre mi 2010

acogoluegnes

Agenda

Un peu d'histoire...

Les nouveauts de Spring 3.0Java 5, Expression Language, REST, etc.

So what?

Conclusion

Un peu d'histoire

v. 0.9 : juin 2003 (toutes les bases)

v. 1.0 : mars 2004

v. 1.1 : septembre 2004

v. 1.2 : mai 2005

v. 2.0 : octobre 2006 (namespaces XML)

v. 2.5 : novembre 2007 (annotations)

v. 3.0 : dcembre 2009

Agenda

Un peu d'histoire...Les diffrentes version de Spring

Les nouveauts de Spring 3.0Java 5, Expression Language, REST, etc.

So what?

Conclusion

Nouveauts Spring 3.0

Java 5

Spring Expression Language

Support REST

Scheduling

DiversBase de donnes embarques

Support JSR-330 Dependency Injection for Java

Validation avec JSR-303 Bean Validation

Configuration 100% Java

Les parties dprcies et supprimes

Java 5

Toute l'API de Spring tire profit de Javavarargs, gnrique

Modules visibles affectsAccs aux donnes : JDBC, Hibernate, transaction

vnement du contexte (ApplicationListener)

Extensions du conteneur lger (FactoryBean)

Java 5 / JDBC

public class ContactRowMapper implements RowMapper { @Override public Contact mapRow(ResultSet rs, int index) throws SQLException { Contact contact = new Contact(); ... return contact; }}Contact contact = jdbcTpl.queryForObject( "select * from contact where id = ?", new ContactRowMapper(),id);

List contacts = jdbcTpl.query( "select * from contact where nom = ?", new ContactRowMapper(), nom);Gnrique

Varargs

Java 5 / Hibernate

Contact contact = hibTpl.get(Contact.class, id);(...)contact = hibTpl.execute(new HibernateCallback() { @Override public Contact doInHibernate(Session session) throws HibernateException, SQLException { Contact localContact= null; // init contact avec session return localContact; }});Gnrique

Java 5 / Transaction

TransactionTemplate trTemplate = (...)int nbBatch = (...)for(int i=0;i