Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (35 sloc) 2.27 KB

MdVsC: Yet Another GUI Design Pattern

Introduction

The MdVsC is name of GUI design pattern. It resembles MVC, but delegate, state and composite are added as components.

Copyright

Copyright (C) 2017 Steel Wheels Project. This document distributed under GNU Free Documentation License.

Overview

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:

MdVsC Overview

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:

MdVsC Overview

Components

This section describes about details for each components.

Model

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.

Delegate

Control

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.

State

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.

View

The view is the GUI widget given by the system framework.