Value Model

In VisualWorks, a ValueModel is the reification of a variable. In other words, it is an object that acts like a variable (a FirstClassSlot). It holds a value, and you can read it and write it. A ValueModel differs from a variable in two ways. First, it is a "subject" in the ObserverPattern. This means that other objects can depend on it and be notified when it changes. Second, it defines an interface, not an implementation. One implementation is ValueHolder?, which just stores the value and returns it, but other implementations are actually adapters to other ValueModels? or store the value in an instance variable of some other object.

An ApplicationModel is a kind of composite model that is made up of a set of ValueModels?, SelectionInLists?, and other more primitive models. This allows a model to match a view, which is more naturally an example of the CompositePattern.

See ModelViewController.


This seems related to the WholeValuePattern. Comments?


ValueModel can also refer to a language in which everything is an immutable value.


EditText of this page (last edited June 10, 2004) or FindPage with title or text search