Quote:
I would pass the document to the form, i.e. make the UI depend on the data/logic.
I would even take this a step further and make the coupling between document and form as loose as possible. I would set it up so that the document knows absolutely nothing about the form; instead, when something in the document changes that the UI should know about, the document should emit a signal that tells about the change. Likewise, it might be better if the form also doesn't know anything about the document - it listens for signals about what has changed, and in turn, if the user edits something one the form that should be saved in the document, the form should emit a signal containing the changed items.