5 Replies Latest reply on Feb 20, 2007 3:53 AM by pmuir

    When is @Out necessary?

    lawrieg

      Hi,

      I wonder if someone could confirm whether @Out is only necessary when you change the object reference of an injected component (i.e. is @Out unnecessary if your component only setsproperties of the injected component)?

      Or are there other reasons you might want to outject an injected component?

      Thanks,

      Lawrie

        • 1. Re: When is @Out necessary?

          Pretty much spot on, as you say, @Out is only required if the object reference may change and you want it updated in the relevant context after the action method has completed.

          If you just mutate (e.g. use a setter) an injected component you don't need to outject it.

          • 2. Re: When is @Out necessary?
            lawrieg

            Many thanks for that - I couldn't seem to find a clear answer for that in the docs.

            Thanks,

            Lawrie

            • 3. Re: When is @Out necessary?

              Raise a feature request against the documentation in JIRA if you think it could be enhanced. Chances are if you weren't sure about it then a bunch of other people aren't/weren't either!

              • 4. Re: When is @Out necessary?

                You might outject to a different scope or different context variable, or both. Any examples of this I can think of would be pretty contrived, but I'm sure someone will think of one eventually.

                • 5. Re: When is @Out necessary?
                  pmuir

                  You might want to outject something from a conversation scoped component (where you can use your SMPC to prevent LIEs) to the businessprocess scope. As for variable name - perhaps in a large app where you want shorter names in the class?