Next: MVC in Swing
Up: The Model-View-Controller Architecture
Previous: The Model-View-Controller Architecture
- Model
- -- State data for each component.
- Different for each component
- E.g. Scrollbar -- Max and minimum Values, Current Position,
width of thumb position relative to values
- E.g. Menu -- Simple List of items.
- Model data is always independent of visual representation.
- View
- -- How component is painted on the screen
- Can vary between platforms/look and feel
- Controller
- -- dictates how component interacts with events
- Many forms of events -- mouse clicks, keyboard, focus, repaint
etc..
- Controller decides how component reacts to an event -- if at all
The three elements interact as follows:
The MVC Communication Model
Dave Marshall
4/14/1999