923: Mainline
Now, you must augment your definition so that your form becomes a view capable of
supplying information to a model. Your augmentation involves two steps:
- You connect a listener to the text fields and buttons. That
listener calls the form's setters, thus maintaining the form's instance
variables.
- You arrange for the entire form to produce events and to activate
listeners that are connected to the form.
Thus, there are two listener levels:
- A lower-level listener, connected directly to text fields and buttons,
operates inside the form, maintaining the form's instance variables.
- A higher-level listener, connected to the form itself, is in charge of
fetching information from the form, using the form's getters, and
relaying that information to a model.