puremvc
|
|
« Reply #1 on: January 22, 2010, 11:47:51 » |
|
It would be equivalent to a value object.
It would just inherit from AbstractTableModel or be in instance of DefaultTableModel depending on whether you need to subclass.
In a typical scenario, you might have a Proxy retrieve a TableModel from the server (or construct one from the server response) and pass it over to the Mediator for the JTable in a notification. The Mediator for the JTable simply takes it out of the note body and and passes it to its view component, which might be the JTable or a container with the JTable in it.
The JTable modifies the model, which could be a reference to the one the Proxy holds or a copy. If it's a reference, then saving is a matter of retrieving the proxy to save its data object (the TableModel). If you're working with a copy at the view, then the mediator can take the one modified by the JTable and pass it back to the Proxy, which replaces its data object with the new one and then saves it.
-=Cliff>
|