Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] Guice to CDI migration

Hi Emily,
 
I have tried using "@Alternative" but I have to use qualifiers to inject this alternative. Is there any way we can make the CDI container use the "EnhancedGreetingServiceImpl" automatically without any qualifiers (without any changes in module-a or app itself).
I don't think you need to use any qualifier here. You need to use `@Priority` to enable the alternative. The other way to completely override a bean, you can use `@Specializes`.  By the way, I am not 100% sure what your use case is. A working example helps if you need further assistance.


I never used CDI before so it's new to me and I don't know many of it's concepts (I know guice very well so at least DI and AOP concepts might be similar). So I will try your suggestion but on twitter one user recommended me to check `@Specializes` and that seems the proper solution as per it's javadoc.

The project I am going to migrate is relatively complex and there are few more cases I would like to discuss here. I will try to provide a test case example that covers some of them.

Regards
--
Amit Mendapara
 

Back to the top