getFacets()

This getFacets() method allows us to tell the node what facets we can offer it. That is, it returns a list of netlet facets. In our case we don't offer any netlet facets and we say as much.

Note that this getFacets() method is what we, the netlet, offer our node. Do not confuse this what facets a service might offer. This getFacets() method is part of the INetlet interface, and as such talks about facets belonging to the netlet.

By contrast, look at the hello world service we use in the initialise() method above. That service presents itself to us as an IService interface and, as we mentioned there, we could have called a getFacets() method on that. But that would have told us what facets the service offers. Netlets offer facets to nodes and they offer services to other netlets. Services offer facets to netlets.

One might think that we would want to have different method names to avoid confusion, such as getNetletFacets() and getServiceFacets(). However, the approach in use is logically correct. Netlets and services both offer collections of facets, so they use the same interface, IFacetCollection, with the same method. Other things are also facet collections (for example, nodes), so this interface is usefully general.

Nik Silver 2002-03-09