Type safe dependency injection in Spring 3 is a handy solution to avoid mispell and provides maitainable code. Before startig I would refer you this useful post Type Safe Dependency which describes both conventional and alterative way.

Define a custom annotation using @Qualifier

To identify the injected bean without specifying the name, we need to create a custom annotation. This is an equivalent procedure to the use of JSR 330 annotations(Inject) in CDI.

  1. @Target({ElementType.Field, ElementType.Parameter})  
  2. @Retention(RetentionPolicy.RUNTIME)  
  3. @Qualifier  
  4. public @Interface Student  {  
  5. }  

Now assign this custom annotation to implementation of EntityDao Interface

  1. @Component  
  2. @Student  
  3. public class StudentDao implements EntityDao   {  
  4. }  

@Component tells Spring that this a bean definition. @Student annotation is used by Spring IoC to identify StudentDao as EntityDao's implementation whenever reference of EntityDao is used.
Inject the bean using @Autowired and custom qualifier
Something like this.

  1. @Autowired  
  2. @Student  
  3. private EntityDao studentDao; // So the spring injects the instance of StudentDao here.  

This makes less use of String-names, which can be misspelled and are harder to maintain.