rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhenhua (Gerald) Guo" <jen...@gmail.com>
Subject question regarding DI in Spring
Date Sun, 01 May 2011 21:37:24 GMT
I am new to Spring.  I read our RAVE code, and I got a question
regarding how Dependency Injection is done.  I've used Guice (another
DI framework) before so I have background of DI.  In Spring,
@Autowired can be used to tell Spring framework that the related
property needs to be injected when needed.  Autowiring can be done in
several ways: by name, by type, etc.  I wonder how "Autowire by type"
works.  For example, suppose there is an interface called UserService
and several implementations called RegularUserService, VIPUserService,
etc.  How could I tell Spring which implementation to use when a
property is injected whose type is UserService?  FYI in Guice,
@ImplementedBy does the job.

Thanks

Gerald

Mime
View raw message