Product Information > JADE Development Environment User’s Guide > Chapter 14 - Adding and Maintaining Interfaces > Overview

Overview

An interface is a mechanism that provides a set of methods that are guaranteed to be available on any implementing class. When a class implements an interface, it agrees to implement all of the methods as defined by the interface. With this contract in place, the implementing classes can participate in useful type-safe callback mechanisms.

Exposing a class via its interface effectively hides the implementation details of the class, as the user is forced to communicate only through the public interface methods.

Classes that implement an interface can be grouped by that interface type; for example, a collection can have a membership of a specified interface.

Using interfaces, non-related classes can be grouped to capture their similarities, without the need to artificially force a class relationship. Think of this as allowing a class to perform multiple roles outside of the role dictated by its class hierarchy.