
[ Previous ] [ Index ] [ Next ]


This pattern helps you decide which variables to serialize for transferring.
Sometimes you might not want to serialize some fields because they are input fields, and you want to serialize only output fields. For example, in the Running Example, outArea is serialized but not inArea.
If your hablet has variables that contain some internal state of the hablet, you should serialize those variables so that new clients can duplicate that internal state. For example, a hablet that uses a neural net would have to share the current state of the neural net with new clients so that they will react in the same way to the next user input.
These decisions are simple to make in a simple hablet like the Running Example, but with a more complicated hablet, the best solution might not be at first clear. An easy way to deal with this problem is to start off by serializing any variable that you are think might need to be serialized, and then to trim them down later if the hablet is too slow. In general, the main problem with a hablet that serializes too many variables is that it will be too slow.
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.
![]()
The National Center for Supercomputing Applications
University of Illinois at Urbana-Champaign
Contacts page