Information Technology Reference
In-Depth Information
number to the base pad, while a display pad of a calculator changes its display value
when a new value is calculated by the base pad. An image pad embedded in a text pad
may change its position in the text whenever the text is updated. The change of its
value or its position may be both interpreted as the state change of the child pad. Each
parent-child connection may be associated with such kind of interoperability between
pads. Based on these ideas, we tried to develop a virtual sheet of paper called a pad
with some dedicated functionality.
Based on the standard design pattern for GUI objects, we made a decision to define
each pad as an MVC triple, where objects M, V, C respectively represent its model,
view and controller. The model defines its internal mechanism with its state, while the
pair of its view and controller defines the display object of this pad, namely how it is
visually represented and how it behaves against user events on it. Furthermore, we
simplified the standard MVC architecture by removing a direct message sending link
from C to M. Figure 1 shows a simplified MVC used to implement each pad.
message
sending
Controller
View
Model
C
V
M
message
sending
update propagation
Fig. 1. A simplified MVC used to implement each pad
The next decision we made was the MVC-based representation of each composite
pad. Figure 2 shows the standard MVC representation of a window with embedded
sub windows. In this representation there is a clear difference between the base
window and its sub window. The former has its model, while the latter has no model.
Subview B
Subview C
Controller B
View B
Controller C
View C
C
V
C
V
Subview B
Subview C
Controller A
C
V
View A
View A
(a)a hierarchy of views
and subviews
M
Model A
(b) View and subviews are connected through view parts
Fig. 2. The standard MVC representation of a window with embedded sub windows
Search WWH ::




Custom Search