3 Replies Latest reply on Jan 8, 2007 3:12 PM by smokingapipe

    @Factory and @Out: why required=false?

    smokingapipe

      Ok, I'm not understanding something here.

      I have a SFSB that with a snippet that looks like this:

      @Out private Foo foo;
      
      @Factory("foo") private void makeFoo() { .... }
      


      and that causes a "foo did not exist but was required" exception when a page is first accessed. This is within a conversation, and this is the first page to be accessed in that conversation. If I put @Out(required=false) then it works as expected.

      I don't get this. Foo is required, but shouldn't the factory always create it when it is needed? How can an @Out fail if there is a factory for that component?

      I'm still not totally understanding the interplay between @Out and @Factory, and I'm also sometimes getting concurrent access exceptions if I try to do things in both @Begin and @Factory. I know these things all have logic behind them but it hasn't sunk in to me yet.