Announcement Announcement Module
No announcement yet.
@Configurable withe dependency in super class Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Configurable withe dependency in super class

    Hope someone can assist with an explanation regarding the following

    If I have a Concrete Class with a single dependency, and annotate as @Configurable (autowiring by name for convenience), the dependency is injected.
    If I extract the dependent property, and the getter and setter into a new Super Class, and instantiate the object as follows, the dependency is not injected.

    SuperClass concreteClass = new ConcreteClass();
    If, however, I instantiate the object as follows, the dependency is injected

    ConcreteClass concreteClass = new ConcreteClass();
    Annotating the super class with @Configurable (whether abstract or not) makes no difference.

    I'm sure there is a good reason for this, but don't know what it is!

    Thanks Marc

  • #2
    I'm currently reviewing o/s issues within my project, and have still been unable to solve this one.

    In effect this means that I either move the dependency from the super to the concrete class (non OO) or have to refer to the object always as it's concrete class, neither of which is a solution.

    Anyone one any ideas?