2 Replies Latest reply on Jul 30, 2009 4:01 PM by nix

    Question about @Current binding type, inheritance and specialization.

    nix

      I don't have clear understanding situation with @Current and @Specializes.
      Let's consider cases :


      class Bean1 {
      }
      
      @Binding1
      @Specializes
      class Beans2 extends Bean1{
      }



      Does Bean2 have @Current binding in this situation ?


      @Binding1
      class Bean1 {
      }
      
      @Specializes
      class Bean2 extends Bean1{
      }



      Does Bean2 @Current binding in this situation ?


      Suppose @Bindnig2 is Inherited binding.
      Consider case :


      @Binding2
      class Bean1 {
      }
      
      class Bean2 extends Bean1{
      }



      Does Bean2 @Current binding in this situation ?

        • 1. Re: Question about @Current binding type, inheritance and specialization.
          pmuir

          Denis Anisimov wrote on Jul 30, 2009 13:14:


          I don't have clear understanding situation with @Current and @Specializes.
          Let's consider cases :

          class Bean1 {
          }
          
          @Binding1
          @Specializes
          class Beans2 extends Bean1{
          }



          Does Bean2 have @Current binding in this situation ?


          No, it's not a declared binding, but an implicit binding (see 4.3.1 in the spec).


          @Binding1
          class Bean1 {
          }
          
          @Specializes
          class Bean2 extends Bean1{
          }



          Does Bean2 @Current binding in this situation ?


          Yes. The bindings include all bindings of Bean2 and declared bindings of Bean1.


          Suppose @Binding2 is Inherited binding.
          Consider case :

          @Binding2
          class Bean1 {
          }
          
          class Bean2 extends Bean1{
          }



          Does Bean2 @Current binding in this situation ?


          No, Bean2 will have a binding, @Binding2 before specialization is taken into account, this means the default binding won't be added.


          I added https://jira.jboss.org/jira/browse/WBTCK-37 to make sure we verify this in the TCK.

          • 2. Re: Question about @Current binding type, inheritance and specialization.
            nix

            Thank you.