Habanero® is a framework or API for sharing Java objects with other remote colleagues through the Internet. Included are all the networking facilities, routing, arbitration and synchronization mechanisms necessary to accomplish the sharing of state data and key events between collaborator's copies of a software tool.
Habanero framework is built to facilitate adding internet-distributed collaborative capability to diverse applications. These applications could be either new applications designed to fit into habanero framework or existing applications or applets which have to be modified a bit to integrate the new collaborative functionalities.
The goal of this paper is to give some guidelines to the developers who want to design from scratch a collaborative application or modify an existing application or applet into a collaborative one.
The first thing a developer needs to decide is what will be shared in the new collaborative application.
Things to consider:
To help you decide, you should determine what kind of feedback all the participants need to see when a user performs an action or changes a data value. For instance, all copies of a toggle button should change when one of the participant selects a value. But local mouse movements could be limited to each individual user.
All these solutions have to be defined according to the nature of the application and the nature of the collaborative interactions between users.
More than in a traditional application, the design of a collaborative application means the decomposition of the design into abstraction, control, and presentation parts. The abstraction level will be in charge of the domain of the application (i.e., accessing to the database, performing the calculation or other computations, etc..). The control part communicates between the abstraction and the presentation level. The presentation level processes the display and the user events.
This is short explanation is based on several well known models of architecture like MVC (Model View Controller) or PAC (Presentation Abstraction Control). If you are not familiar with this kind of architecture you might take some time to read about them. It will save you time later in the realization phase.
In a collaborative application, the user actions and the performed actions must be separated. Because of this a collaborative kernel is added to propagate an action to all the other participants or determine if it is to be kept local.
That means in the design of the application you have to carefully distinguish :
Habanero.sendEvent(AWTEvent evt) method.
Habanero.addSharedEventType method.
This process is facilitated with the Habanero framework which takes care of all the collaborative mechanisms such as routing, arbitrating, synchronizing, and networking mechanisms. Nevertheless, you still need to do few things to make your own collaborative application:
public CollabDraw() {
somevariable = true;
}
public class TicTacToe extends ncsa.habanero.Hablet
During a collaborative session, a new user can join a session at any time and it is important to be able to know the state of a tool at any time during its instantiation. It is also important to be able to load the current state as an initial state for anyone joining the session while the tool is in use. Thus, each collaborative tool needs the ability to get the state of the user interface (UI) object(s) and the ability to set them during the course of loading the tool.
To send the state of a tool over the network, you need to make sure that it implements the Serializable interface. For example:
public class myUIClass implements Serializable {
}
Next, override the writeObject and readObject of the classes that you want to share. The class that extends Hablet will have to override the readHablet and writeHablet methods.
In a collaborative application, you can't compare two objects in the same way you do it in a single user application. That means, if you want to retreive a specific object in each instance of the collaborative tool, you can't deal with the object (pointers) themselves. But you need to have a property to identify them, like a name or a key, and then retrieve the right object by comparing the identificator. For example, with a button, the identifyer is its label and you can retrieve it with method getLabel().
Habanero® is a registered trademark owned by The Board of Trustees of the University of Illinois. Copyright 1996-1998. All rights reserved. Java(TM) is a proprietary trademark owned by Sun Microsystems, Inc.