1 Reply Latest reply on Mar 14, 2007 2:46 PM by Bing Zou

    How to deal with this outjection scenario.

    Bing Zou Newbie

      Class1 instantiates Class2 then calls a init() method on Class2.
      Both Class1 and Class2 need access to an object. Ideally, Class1 will instantiate the object and outject to the coversation, the Class2 just inject it and use it. However, it doesn't seem to work and my understanding is that they are in the same request and the outjection happens at the end of invoke application phase. So my questions are:
      1. When does outjection happen? (end of invoke app?)
      2. If two classes outjects the same object, which order will the outjection happen so that one will overwrite the other?
      3. Any suggestions on how to deal with this scenario? (Certainly I can initialize the object in class1 then pass to class2 as a parameter, however, the idea is that class1 doesn't know what class2 can do. Class1 actually might initialize multiple classes.)

      Thanks in advance,