7.1 Denition

As of version 1.1, FPC supports interfaces. Interfaces are an alternative to multiple inheritance (where a class can have multiple parent classes) as implemented for instance in C++. An interface is basically a named set of methods and properties: A class that implements the interface provides all the methods as they are enumerated in the Interface denition. It is not possible for a class to implement only part of the interface: it is all or nothing.

Interfaces can also be ordered in a hierarchy, exactly as classes: An interface denition that inherits from another interface denition contains all the methods from the parent interface, as well as the methods explicitly named in the interface denition. A class implementing an interface must then implement all members of the interface as well as the methods of the parent interface(s).

An interface can be uniquely identied by a GUID (GUID is an acronym for Globally Unique Identier, a 128-bit integer guaranteed always to be unique1 . Especially on Windows systems, the GUID of an interface can and must be used when using COM.

The denition of an Interface has the following form:

_________________________________________________________________________________________________________ Interface type
-- --Interface -|-------------------------------------end------------
              |heritage| -['-GUID ']--|- component list|

-- --heritage -(- interface type identi  er -)-------------------------------

-- --            ----              ---------------------------------
     component list 6  meptrohpoedrt dye de nnititioionn -||
                  -------------------|
___________________________________________________________________

Along with this denition the following must be noted: