Bean Extender Guide to Features


Context Dips

In everyday terms, context is what happens around an event. A context adds meaning to an event by providing additional information about the event that is not intrinsic to that event. This type of information makes a useful programming abstraction in a software component model. In relation to dips, context is what happens around a bean that is meaningful to the user of the bean. Simple examples of context are:

These elements can provide useful information to a bean user that is not available to the bean before dipping.

Using Context Dips

A context is a set of information attached to a bean instance by dipping. This includes the annotation, author, and version. The annotation context dip provides a way to attach text notes to instances of beans. The author context dip allows the application assembly specialist to indicate originator or change of originator of an instance of a bean. The version context dip keeps information on properties of an instance as it changes.

Because no merging of user interfaces is available, the only way to access information is by modifying the property or by using the customizer. Property modification allows you to view previous annotations and authors. The customizer for versioning allows you to revert to any previous version of the bean's instance. The list box of properties in the context dip customizers show which properties on a bean are context properties.

Using the Update Policy

The update policy lets the context object know when context information for the beans has changed. The user can indicate a property that, if changed, causes the context to change. This change may occur without requiring any additional user action or may cause the user to be prompted for contextual information, such as a new author name.

When the Dip Framework determines that something has changed on the bean, the context dip checks to see if the change corresponds to what is in the update policy. If the change is in the update policy, a user interface displays the current values of the context. This user interface allows the user to change some values in the context.

If the context update requires user interaction, a dialog is presented when the context changes. The annotation and author contexts require user interaction, and these dips present an interface when the context changes. The version dip does not require any user interaction.

The update policy is set through the customizer. The customizer presents the set of properties that a bean makes public. Select the properties for which you want to keep context information and click on the Apply button to set the update policy.

The Dipping Framework presents a customizer before dipping is completed. The context dips have no information about the bean being dipped when the framework presents this customizer. You cannot customize at this point. Click on the Done button to dismiss this customizer dialog and then customize the dip after dipping is completed.

Using the Annotation Dip

When the annotation dip is applied, you can customize the dip. When the bean changes and causes a context change, the annotation dialog is displayed. A text area is provided to enter annotations for the bean. Clicking on the OK button adds the contents of the text area to the set of annotations and closes the dialog. The Cancel button closes the dialog without adding or updating the annotation. The View Annotations button lets you look at previous annotations made to a bean instance.

Clicking on the View Annotations button displays a View Annotations dialog. The annotations are displayed in the text area of this dialog. If there are no previous annotations, the message <-- !No Annotations Added --> is displayed. To close this dialog, click on the OK button.

Using the Author Dip

When the author dip is applied, you can customize the dip. The customization of the author dip lets you enter an initial author and set the update policy. When a property change occurs, and the change matches the values you set in the update policy, a dialog is displayed to show the current author and lets you change the author.

This dialog provides a text field to enter the current author and a list box. The list box contains the previous authors. Clicking on the OK button adds the current author and closes the dialog. Clicking on the Cancel button closes the dialog without adding the current author. If there are no associated authors, the message <--!No Previous Authors -->is displayed.

Using the Version Dip

The version dip collects the dipped bean properties that you specified in the customizer as constituting a version change. After the initial setting of the version context, version information is updated without notification.

To access previous versions, you must have access to the customizer. This customizer has a selection box of available versions. To change the value of a property to an earlier version, select the version you want. After you select this value, the bean's property value is set to that previous value.

Versions are numbered sequentially with the initial value being set to 1. The most recent value for this property is the highest number in the selection box.


[ Top of Page | Previous Page | Next Page | Table of Contents | Documentation Homepage ]