Check out the new USENIX Web site. next up previous
Next: Reflection-Based Publish/Subscribe Up: Approaches to Content-Based Publish/Subscribe: Previous: Arguments

Template Objects

The JAVASPACE specification [Sun99b] (inspired by LINDA's TUPLE SPACE [Gel85]) adopts an approach based on template objects.

When subscribing to a JAVASPACE, a subscriber provides a template object t. A message object m is only delivered to that subscriber if m conforms to the type of t, and if every attribute of t which is not null references an object equal to the corresponding attribute of m (cf. Figure 3). Equality is tested by comparing byte-wise the two objects in marshalled form. As shown by [FHA99], this approach represents a very convenient subscription scheme which can be put to work easily. However, encapsulation is violated, and there are certain limitations in expressiveness:

Limited comparisons:
Attributes are compared for strict equality, and it is not straightforward to express a range (discrete or not) of possible values for an attribute.
Limited granularity:
In JAVA, an attribute can reference an object, which itself has attributes, etc. Attributes of JAVASPACE entries are however matched as a whole. This limitation is also found with most of the previous approaches based on subscription languages.
Limited combinations:
By providing a template object t, a subscriber will receive every object m whose attributes all match the attributes of t. It is thus difficult to express alternatives (or) on different attributes.
Limited values:
Since null is chosen to play the role of wildcard, attributes can not be of native types, and null can not be easily used as a concrete value for an attribute. For each such attribute [Sun99c] proposes to add an additional boolean attribute to indicate a null value.

 
Message m public class ChatMsg {

public String from;

...
}
Criteria ``message sent by Tom''
Argument ChatMsg mt = new ChatMsg();
t.from = "Tom";
Evaluation m.from.equals(t.from)

Figure 3: Template Object
  


next up previous
Next: Reflection-Based Publish/Subscribe Up: Approaches to Content-Based Publish/Subscribe: Previous: Arguments
Patrick Eugster
12/10/2000