5 Replies Latest reply on Apr 7, 2009 2:58 PM by Pete Muir

    Some kind of outjection

    Diego Coronel Apprentice

      Hi Folks,


      Nowadays i develop applications using Jboss Seam and one of the features i like most and in a certanly way leaves my code clean (in some situations) is the outjection. But I know that web beans wont have this feature… i would like to know if is there going to be a similar feature at web beans implementation.. and if its possible to fire an event that I can pass my annotation .class (with BindingType)  as a parameter to refresh my components, something like refresh my injections.. 




      Something like Events.refresh(LoggedUser.class, user);


        • 1. Re: Some kind of outjection
          Pete Muir Master

          You can use producer fields as a kind of outjection for sure.


          You can certainly use events to update injections (e.g. using @Obtains Instance<Foo>

          • 2. Re: Some kind of outjection
            Rafal Hajdacki Newbie

            What is the reason why WebBeans don't have outjection? Not that I would like it to have. In fact I hesitate to use them in Seam.

            • 3. Re: Some kind of outjection
              Pete Muir Master

              Personally, I'm not a huge fan of outjection, and to me, Web Beans provides the right point to remove this feature, which (again IMO) experience has shown isn't that useful.

              • 4. Re: Some kind of outjection
                Arbi Sookazian Master

                Pete Muir wrote on Apr 06, 2009 16:49:


                Personally, I'm not a huge fan of outjection, and to me, Web Beans provides the right point to remove this feature, which (again IMO) experience has shown isn't that useful.


                So is outjection (which is 1/3 of bijection), now an anti-pattern, so to speak?


                I've used outjectin a lot in my code using @Out in Seam apps...  Is the problem due to the fact that the HttpSession gets bloated with objects when you continually outject to session and/or conversation contexts?


                what's a concrete example of oujection in WebBeans?


                the difference b/n producer and events?

                • 5. Re: Some kind of outjection
                  Pete Muir Master

                  Arbi Sookazian wrote on Apr 06, 2009 17:04:



                  Pete Muir wrote on Apr 06, 2009 16:49:


                  Personally, I'm not a huge fan of outjection, and to me, Web Beans provides the right point to remove this feature, which (again IMO) experience has shown isn't that useful.


                  So is outjection (which is 1/3 of bijection), now an anti-pattern, so to speak?


                  It's not an anit-pattern IMO, but I would always use it as an optimization, not part of the base design for the app.


                  I've used outjectin a lot in my code using @Out in Seam apps...  Is the problem due to the fact that the HttpSession gets bloated with objects when you continually outject to session and/or conversation contexts?


                  No, for me the problem is it produces apps in which the wiring can be harder to understand.



                  what's a concrete example of oujection in WebBeans?

                  the difference b/n producer and events?


                  @Produces @Foo Bar bar;


                  Read the spec ;-)