next up previous contents index
Next: Interface Relations/Roles Up: Component Developer (OLD) Previous: Limitations of protocol state   Contents   Index

Interface Inheritance

The possible inheritance structure of interfaces are quite simple in the PCM. Every interfaces can inherit 0..* other interfaces. Hence, one can create a hierarchy of interfaces.

If interface A inherits from B, A is a sub-interface of B and B is a super-interface of A. A inherits all signatures defined on B. The protocol of B must be a sub-protocol of A - the protocol of A has to include the protocol of B.

This definition of interface inheritance is required to support contra-variance - cases in which not the original interface is used, but a super- or sub-type. A sub-type can replace a super-type at the provided side of a component, while a super-type can be used instead of a sub-type at the required side (cf. section 3.2.6 and 3.2.6.1).

Loops are not allowed in the inheritance structure of interfaces. For example interface A cannot inherit B, which in turn inherits from A.



Snowball 2007-03-16