Friday 7 September 2007

Spring 2.1 Annotated Dependency Injection

Annotation-Driven Dependency Injection in Spring 2.1: This page shows how one can use annotations to entirely inject dependencies. This allows the role of the application context xml file to be minimised, with no bean definitions necessary. Instead the file can be set to an annotation context with scanning of the classes done in the package specified.

The downside to this is the POJOs are now infected with Spring configuration. For a large project with dozens of files, this would make changes difficult.

No comments: