The FacetHandle class

In this example we will again meet the FacetHandle class mentioned in Section [*]. Recall that a FacetHandle is just a facet implementation plus the facet name. When the FacetProvider is asked for an IHelloFacet it actually returns a MessageGiver together with the name of the IHelloFacet interface, both bundled together as a FacetHandle.

When the FacetProvider class returns the MessageGiver it is returning an object which implements an IHelloFacet. What the client netlet gets is the IHelloFacet as requested, but it's not the MessageGiver--it's a proxy object which implements IHelloFacet and which links back to the MessageGiver. This is all for the security we talked about, because every netlet must be protected from alien code. Since the node creates the proxy and mediates the client/provider link it must be told which bits of the MessageGiver are important. So by returning a FacetHandle--which is just the facet implementation plus the facet name--the node can see that it's what interface its proxy must implement, and what implemenation to link back to.

Nik Silver 2002-03-09