EXERCISE 8.9 [extra - not in book]
Consider screen 1 in question 8.5.
Imagine the system has been constructed using an MVC model. The model includes the filename being typed and the position of the text cursor in the filename.
The user is in the middle of typing a
filename and has entered "Bens.jav". The
cursor is currently at the end of the filename.
(a) user types 'a' which is added to
the end of the filename
Describe what happens within the MVC
components; think especially carefully about the communication
between the components.
answer available for tutors only
The student has to think through the implications of the MVC model for this question. The textbook gives the interconnections, but doesn't do a scenario in this detail.
The controller (C) knows that it is in the text field because it interacts with the view (V), which knows about the layout of objects on the screen