[cap-talk] Objects and Facets

David Hopwood david.nospam.hopwood at blueyonder.co.uk
Thu Aug 3 12:56:08 EDT 2006


Neal H. Walfield wrote:
> I understand the terms object and facet in the following way: an
> object encapsulates some state which can be sensed or manipulated
> through capability invocations; a facet presents an object with
> diminished authority, e.g. a read-only facet.

My understanding is that the facet pattern
(http://c2.com/cgi/wiki?FacetPattern) is a particular simple kind of
authority diminishment, in which the facet presents a subset of the
interface of the object to which authority is to be diminished.

For example a read-only facet presents only the methods that perform
read accesses, but does not change the behaviour of those methods
(except possibly that methods that would return a subobject, may
instead return a read-only facet to that subobject).

> On the Hurd, we have the following: a file consists of its contents
> and some meta-data.  When a user calls "open", the file server doesn't
> simply return a capability naming this state; it first allocates some
> memory to hold, among other things, the position of the cursor in the
> file and returns a capability naming that state.  This state is
> private to each open.
> 
> In the language of capabilities, what would be the file object here?

The file is a "composite". The file stream objects are externally accessible
objects of the composite.

In MarkM's thesis, external objects are called "facets", but I think this
is mildly confusing, and that the term "facet" should be limited to subsetting
of interfaces as described above. This is of course a special case of a
composite.

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>




More information about the cap-talk mailing list