Interface

Your help file can.

Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.

An interface represents a contract, in that a class that implements an interface must implement every aspect of that interface exactly as it is defined.

With interfaces, you can define features as small groups of closely related members. You can develop enhanced implementations for your interfaces without jeopardizing existing code, thus minimizing compatibility problems. You can also add new features at any time by developing additional interfaces and implementations.

Although interface implementations can evolve, interfaces themselves cannot be changed once published. Changes to a published interface may break existing code. If you think of an interface as a contract, it is clear that both sides of the contract have a role to play. The publisher of an interface agrees never to change that interface, and the implementer agrees to implement the interface exactly as it was designed.

[mshelp]ms-help://MS.VSCC/MS.MSDNQTR.2002APR.1033/vbcn7/html/vaconInterfacesInVisualBasic70.htm[/mshelp]
 
Also, programming against an interface allows you to be totally independent of the "real" object that implements the interface.

As long as an object implements the required interface, you can ignore all its other features. Thus you handle a bunch of object in the same manner, however different they are, as long as they all implement the same interface.
 
Back
Top