Himai Minh wrote:I have a specific question from MZ's notes :
However, this option is wrong because we are injecting the SEI and the value=CatalogService.class is missing.
Exactly as the 2nd point above says.
Himai Minh wrote:I have a specific question from MZ's notes :
But according to the definition, type can refer to the SIB class. I don't understand why this option is wrong.
That's never said in the spec, you're reading b/w the lines. If you inject on a field of type SEI, and the type can be inferred from the field (in this case 'Catalog'), you don't need to specify type. Even if you do, the type must be the SEI class, not the SIB class. The code you've quoted is wrong because it violates that; it'd be right if the annotation just used value=CatalogService.class instead of type, or if it used type=Catalog.class and value=CatalogService.class.
IMHO, the best way to clarify these doubts is to deploy the code. If it fails, make changes after reading the spec and deploy again.
Abhijit
-------
SCJP 5, SCBCD 5, OCWCD 5, OCEWSD 6, CSM