Andrzej Wytyczak-Partyka wrote:

Another problem I found.
The documents inside the frames are not closed properly.
Should I do smth like this :

      doc = xFrame.getComponent()
      doc.close()

everytime I close a frame?
I think I have a problem with understanding which components
are disposed when the container they belong to is disposed
and which aren't.

One frame knows one controller and one controller knows one model.
But one model knows several controllers, and each of these controller object referr to one frame.
It's designed using the Model-Controller-View paradigm.

a) closing the frame

If you close the frame it disposes the controller.
And the controller will deregister itself from the model.
If this disposed controller was the last one, the model will be closed too ... otherwise the model will stay alive - because its referenced by other freme/controller pairs.

b) closing the model

If you close the model it iterates over all registered controller.
There it asks for the assigned frame and close it.
This will reuse the mechanism of a) !

As you can see: nothing will stay alive if you close one of these resources. (Excepting if you try to close one controller explicitly by calling dispose() there ... That's not allowed and will make trouble. It's defined, that the frame is the owner of the controller and it's not allowed to close the controller directly.)


Cheers,
Andrzej.

Regards
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to