You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Interface

Definition

  • An interface "is a set of named operations that can be invoked by clients" (Component Software, p. 40).
  • An interface is given by a contract that completely specifies the operations within the interface and any pre-conditions and post-conditions that may exist for those operations.
  • An interface can be provided by either a component (as with traditional libraries) or an object made available by a component.

Notation

The symbol for an interface is a line segment with a circle at the end:

The line segment may begin at any of four other symbols. If the interface is connected to an object symbol, it indicates that the object supports that interface:

If the interface is connected to a class symbol, it indicates that objects instantiated for that class will support that interface:

If the interface is connected to a component it means that the component supports that interface. This typically requires the component to instantiate a singleton object that supports the interface and maintains some knowledge about the component as a whole:

If the interface is connected to a module it means that the module supports that interface. This typically requires the module to instantiate a singleton object that supports the interface and maintains some knowledge about the module as a whole: