Document components

Compound documents are a tree of embedded document components. The root of this tree is always called the root document component, even when there is a single document component. The minimal hierarchy is a root document component.

The root document component is managed by the compound document. Document components are embedded in other document components when they are added to the tree of document components. This tree is managed by the compound document.


This root document component is a child of--owned by--the TCompoundDocument class.

Document components as containers

Components are not atomic objects. Rather, they are container objects. They are a necessary abstraction which gives you the capability of addressing the component elements.

Each document component contains a model and a presenter state. The model is the object in the document component that contains data. The presenter state holds the data that describes how data found in the model is presented to the end user.

Separation of data

The design of the component separates the presenter state data from the model data to enable you to change the presenter state at a time after the creation of the model data. This permits you to change the manner in which the model data is presented without having to alter the model itself.

While you may find that this functional separation has real benefits in more complex systems, you still need a convenient way to address the model along with the presenter state data. This paired addressing is desirable because you want to avoid changing the state of one without notifying the other.

Document components know just enough to handle streaming and storing models and presenter states when the shared libraries for these objects are missing and they provide an interface for accessing their models and presenter states.

Using the document component, you can address both the presenter state and the model with the same command. From the developer's point of view a document component contains data, and it can provide an application with a presentation of that data when needed.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker