next up previous NU-CCS-99-04.ps [ Readme | Copyright | Tutorial | Download | Feedback ]


Next: The BeanBox Class Up: Uncovering the BeanBox Design Previous: Uncovering the BeanBox Design

How Does the BeanBox (BDK1.1) Work?

We start by describing how the BDK works. Explaining all features of the BDK will require much space, be boring to read, and will most likely violate some legal restrictions... Instead, we shall concentrate only on the BDK's features that are needed to understand the enhanced Context-BeanBox. All other features will be excluded from this paper (some of which are nonetheless interesting, e.g., generating applets). When you start BDK, four windows show up on the screen: BeanBoxFrame, ToolBox, PropertySheet, and MethodTracer.

BeanBoxFrame.
BDK starts running by instantiating a BeanBoxFrame (just examine the script run.sh under Unix or run.bat under Window 95/NT). BeanBoxFrame is a Singleton class [23], whose instance serves as a global environment for all other objects. There can be only one instance of the BeanBoxFrame class as it is created in the main() method of this class. You can recognize the BeanBoxFrame frame by observing that it is the only window that has a menu (Figure 1). The BeanBoxFrame also creates an instance of ToolBox, places one wrapped instance of BeanBox in itself, and creates a PropertySheet. The BeanBoxFrame acts as the top-level frame that contains the BeanBox. It manages the frame's menu-bar and keeps track of which bean currently holds the focus. Because of an assumption that there is only one BeanBoxFrame per application, many methods and fields are declared static.
ToolBox.
The ToolBox is a panel that shows icons and ID strings of available beans (Figure 1). For a bean to be available, it has to be read from a jar file that is loaded into BDK. By default, on creation ToolBox attempts to load all jar files found in the ../jars folder (relative to the current working directory). This can be overridden by starting the BDK with the -quick option. At runtime, the ToolBox also has the responsibility for instantiating beans selected from its list. When the user clicks at any of the icons or ID strings, the corresponding bean is created and the current BeanBox is notified that the insertion procedure has begun. The current BeanBox is the BeanBox that contains the current bean (the bean that is currently in focus), and a reference to it is kept in the BeanBoxFrame.

PropertySheet.
The PropertySheet frame contains a PropertyEditor for the properties of the current bean. It allows the user to view and set read/write properties of the current bean for which a PropertyEditor exists (Figure 1).

MethodTracer.
The MethodTracer is a frame that belongs to the BeanBox's BeanContext. It demonstrates a service that a BeanContext can offer to the enclosed BeanBoxChild (Figure 1). The MethodTracer doesn't affect the functionality of the BDK in any way; it just observes, and therefore it is of no further interest to us at this point.

These were the classes whose instances can be seen. However, instances of two other classes do the real job, namely the BeanBox and the Wrapper.


next up previous NU-CCS-99-04.ps [ Readme | Copyright | Tutorial | Download | Feedback ]


Next: The BeanBox Class Up: Uncovering the BeanBox Design Previous: Uncovering the BeanBox Design

David H. Lorenz
3/17/2000