> From: Leo Sutic [mailto:[EMAIL PROTECTED]] > > All, > > when a container is disposed it typically invokes the > dispose() method of all its disposable components. > > If a component has held on to a reference obtained > via lookup(), is it safe to release it? > > If we have the following situation: > > Component A is contained in Container C. Container C > is a child of container P. Thus, A can look up components > in P. (Think parent component manager). > > A obtains a component X via a ComponentManager interface. > > X is contained in P. > > C is disposed, and calls A.dispose(). > > A now releases X. > > The question: is it guaranteed that X will be released back > to P? > > I would go for a "yes" and if this is not the case, make it > part of the contract.
If C is disposed, and calls A.dispose(), then if A is well behaving it will release X. Now I have a question for you (since you like incomprehensible variable names): If A and C go into a bar, will X P on the floor?