Next: Drag and Drop
Up: BeanBox Enhancements
Previous: Hierarchical Visual Containment
Once the support for presenting a visual hierarchy is in place, the next step is to support the runtime containment protocol. Sun's BeanBox already has a limited, although pioneering, support for the Extensible Containment and Services Protocol [9]. The BeanBox implements the BeanContextProxy interface. A new bean added to the BeanBox container is automatically added also to the BeanContext peer, the BeanContext for which the BeanBox container is a proxy. Now that we have added the ability to place beans inside any container, we need also to take care of adding the new bean to its innermost bean context.
The innermost context of a bean is not necessarily the BeanBox, but may be the container to which the bean is added, or its container, or its container-container, etc. Unfortunately, the BeanBox is totally ignorant of the existence of any other BeanContext in the environment.
As a result, one can only test beans against
the BeanContext
for which the BeanBox object is a proxy.
While this example is useful, it is limited. In
particular, one can test one's services beans but
one cannot test one's own BeanContext
beans.
This second extension provides users with the possibility of testing their own BeanContext beans. When a bean is created inside a nested container, the innermost context is located, and the bean is added to it.
Next: Drag and Drop
Up: BeanBox Enhancements
Previous: Hierarchical Visual Containment