Results 1 to 2 of 2

Thread: @Configurable withe dependency in super class

  1. #1
    Join Date
    Aug 2005
    Location
    Sussex, UK
    Posts
    92

    Default @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.

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

    Code:
    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. #2
    Join Date
    Aug 2005
    Location
    Sussex, UK
    Posts
    92

    Default

    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?

    Thanks
    Marc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •