MdVsC: Yet Another GUI Design Pattern
The MdVsC is name of GUI design pattern. It resembles MVC, but delegate, state and composite are added as components.
Each letters in MdVsC presents the component of GUI application:
- Model: The software application except user interface part.
- Delegate: The delegate is interface between model and GUI.
- View: Present GUI looking.
- State: The state of View. The state will be changed by Controller and delegate. The view is changed by the state.
- Control: Accept user action or events from the other components. And change the state, send events to the other components.
- Composite: Package of state, view and controller or the package of state, view and sub composites.
Following image presents the relationship between these components:
Each components are connected by messages. There are 5 kinds of messages:
- See: What the user sees.
- Use: What the user inputs.
- Notify: The source component tells which state/property is changed to destination.
- Update: The source component set new value to the destination's state/property.
- Event: The source component tells which event occurred to destination.
The GUI will be presented as the hierarchical structure of composites. Following image is an example:
This section describes about details for each components.
The model is an application except graphical user interface. This document does not describe about the model. Because the view only focus only delegate, not model.
When the controller accept user action, the event based on it will be generated. It will be sent to the controller in parent composite or sent to the delegate.
The state contains the status of control (such as visible, enable) and value of control (inputed text). Some times, it is called property. The state is updated by control and observed by view.
The view is the GUI widget given by the system framework.