Hi,

i think we should finally define onDetach() contract and decide what
to do with detachModels().

Right now, after the detach attach/refactor the situation is that
onDetach is called only for components which were attached and
detachModels is called for every component.

While this kinda does make sense, there are two possible problems:
- the semantics are not very well defined and when which method is
called can be confusing
- when there is model in component that is not in the default "slot"
(get/setModel), it will not be detached properly unless the whole
component was attached.

The goal of attach/detach refactor was to simplify the things and I
think we can go a little bit further. I propose merging detachModels
with detach. And I also propose that onDetach should be called for
every component. IMHO it would be safer and simpler than what we have
right now.

The onDetach sematics would be defined something like this:
The method is called on the end of request, even if the component was
not attached.

The detach methods are usually rather simple, so I really don't think
there would be a big performance penalty, as we already need to
traverse the component tree.

WDYT?

-Matej

Reply via email to