Announcement Announcement Module
No announcement yet.
@Configurable and Inheritance Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Configurable and Inheritance

    Hi !!

    I've tested DDD sample with spring 2.5.2 using @Configurable.
    I used sample
    The sample based on spring 2.0, so I changed to spring 2.5.2.

    I found strange thing. It works fine if my test uses CustomerService#getNetWorth(SmartCustomer). But it doesn't work for CustomerService#getNetWorth(Customer). SmartCustomer extends Customer.

    Is it normal or I made something wrong ?

    One more question. META/aop.xml is required for @Configurable ?

    I attached my sample.

  • #2
    META/aop.xml is required for @Configurable when using Load Time Weaving. A java agent will also need to be defiined to the JVM.

    If using Compile Time Weaving, where the Aspect Code is pre-woven into the compiled class files, this is not required.

    Not 100% sure regarding the inheritance, so will not speculate!


    • #3
      I didn't see any test cases in the zip file, but SmartCustomer is @Configurable, whereas Customer is not. So SmartCustomer is expected to be injected, but not Customer. Could that be the reason for the failure?