next up previous
Next: Type converters Up: The box Previous: Copying boxes

Sharing boxes

Sharing is also a well-understood operation. If a box is being shared, those who share it may look inside and handle its contents.

Boxes provide a share operation which, once invoked, makes the involved boxes behave as a single box. (In figure 1, after share, the box is the same no matter the open-top used.)

Although similar to the link operation on typical file systems, share is somewhat different: it can be applied to inner boxes, it can trigger converter execution (see section 2.3), and it can be used to maintain generated boxes up-to-date. Moreover, boxes do not need to be ``on disk'' to be shared (or copied).

To give more intuition, some share-usage examples follow. Making a box persistent is a matter of sharing it with another, which already persists. Box contents could be made highly available by sharing the box with others on different nodes. Cooperative editing of a single section within a LATEX document can be done by either sharing just the section, or by sharing the whole LATEX document. Non-shared sections would be different boxes.

Different specific implementations can be used for the share operation. The per-box implementation of box operations allows different data to be shared in different ways. Moreover, dynamic adaptation of the share implementation could be done, as [6] suggests.

Thus, boxes could fit more naturally than files do within mobile environments, which are common these days (and will be more in the future). To further justify this claim, consider a mobile environment supporting disconnected operation. On such environment, users are likely to require different ``sharing'' mechanisms for different pieces of data: some items should be shared among different hosts by remote referencing (e.g. data from big, highly-available, databases), others should be fully replicated to be highly available (e.g. some OS binaries or any data considered to be crucial for the user), yet others should simply use caching (e.g. most of the data not usually accessed by the user). Boxes, by delegating the implementation of share to the box being shared, can integrate the most adequate mechanism for a given box.

Comparing boxes with files, even when files can be shared employing different techniques or mechanisms, it is not clear how to apply a given one to any piece of data which is not a file (e.g. an entire directory hierarchy or a small part of a file.)

In this section we have discussed the use of the share operation between type-compatible boxes. In the next section we will revisit the use of share to consider sharing between boxes which are not type-compatible.

next up previous
Next: Type converters Up: The box Previous: Copying boxes