Originally posted by Robin Underwood:
The model shouldn't have to know anything about the view. When it's time to book a flight, the controller can ask the view which flight was selected, and then pass that info to the model.
In my particular implementation, the controller gets the selected row from the view, then gets the record number for that row from the table model, then passes the record number (and number of seats) to the model.
Thanks, Robin for your reply.
TableModel is an exception here. I am talking about apply MVC to oher parts of GUI: view is the graphic presentation, controller handles events, model handles data.
For example, if we have a JComboBox component for origin airport, we show this box in view, assign listeners in controller, receive and handle data in model. But somehow, in order to get user choice from a list of origin airports, we have to pass the component to the model. This make implementation a bit messy. I am wondering if anyone who passed did the same.
By the way, I am using Mark's MVC scheme here.