Folks, I think we should add a new method to CreationalContext, to
allow for easier and efficient implementation of custom Context
objects.
public interface CreationalContext<T> {
public void push(T incompleteInstance);
public void destroy();
}
The destroy() method would destroy any dependent objects of the
instance that was created in that CreationalContext.
The custom Context would be responsible for maintaining the list of
CreationalContexts internally, and calling destroy() on each of them
when the context is destroyed. This would allow the container to
optimize out any map lookups, etc.
WDYT?
--
Gavin King
gavin.king(a)gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org