2 Replies Latest reply on Dec 9, 2005 12:27 PM by gavin.king

    Newbie: difference between @in/@out and get/set

    janbols

      Is there a difference between using

      @In @Out private MyProperty myProperty
      and
      private MyProperty myProperty
      public MyProperty getMyProperty() {return myProperty;}
      public void setMyProperty (MyProperty myProperty;}
      except for the fact that you reference it differently in your jsf pages.

      When should I use the first case, when the second one?

        • 1. Re: Newbie: difference between @in/@out and get/set
          patrick_ibg

          In/Out takes things in and out of the various contexts (application, session, conversation and event/request).

          The get/set stuff you pointed out does much the same thing but it does it on your backing bean. So the lifecycle of that variable depends on the backing bean itself.

          In general, I tend to use @In/@Out for entity beans and things that are in the session scope (like "currentUser"). For non-persistent things that are specific to that backing bean (like say, a verify password form input), I sometimes use get/set.

          In some cases, it doesn't make a difference.

          • 2. Re: Newbie: difference between @in/@out and get/set
            gavin.king

            They are very different. One is for inter-component collaboration, the other is for accepting user input fom forms.