Next: Implementing Drag and Drop
Up: How Are the New
Previous: Implementing Hierarchical Visual Containment
Enabling users to construct their components in a multilevel representational hierarchy still does not give them the ability to test their components functionality, i.e., their support for extensible runtime containment and services protocol (implementing the BeanContext interface.) When the ContextBox adds a new bean to some Container it also add that bean to the BeanContextServices object for which it is a proxy. To be able to test arbitrary BeanContext beans, we need to provide some visual means that will permit putting other beans inside them. That is why every bean which is associated with a BeanContext is visually represented by a Container, and every Container that is not associated with a BeanContext object is given one (as explained in Section 3). Thanks to the visual representation, the user can easily add new beans to the BeanContext bean. But there is still another change needed for adding a new bean to the BeanBox. When the BeanBox adds a wrapped new bean to the selected (clicked upon) Container, instead of adding it to the BeanContext object associated with itself, it adds it to the BeanContext associated with the target Container. This way, the support for extensible runtime containment and services protocol is realized. Since the BeanContext can reject new beans, the BeanBox first tries to put the new bean into the BeanContext, and only if the BeanContext accepts the new bean is the wrapped bean then added to the target Container.
In cases where the user tests a bean that is already associated with a BeanContext object, we permit putting other beans in that object and also in the Container associated with that bean, if such exists. In all other cases, when the user tests a bean that is just a Container but can group beans in it, we provide a default BeanContext object, and if the new bean is placed in a Container, we put it also in that default BeanContext. The default BeanContext has only one goal: to propagate the environment (available services) to the nested beans. By doing that, we enable the user to combine beans that are designed to support visual containment and those that support runtime containment uniformly.
Next: Implementing Drag and Drop
Up: How Are the New
Previous: Implementing Hierarchical Visual Containment