Header Interfaces vs Role Interfaces

In some languages such as C++ you must define header interfaces. These constructs define how a public type is exposed in terms of its public interface. Other languages take a different route. C# or Java do not require headers but they are still very much in circulation. This unfortunately brings along some unwanted side effects.

Header Interfaces

Header interfaces are a one to one mapping of public methods that match the type it is defining. In other words, they are recreating the overhead of headers in languages that do not need them.

Role Interfaces

Role interfaces define the role an object plays. Due to various roles having different responsibilities they are usually grouped by functionality. Role interfaces are usually combined with composition or interface inheritance.

The role of a Developer has now been introduced. This is a separate concept from the rest of the object.

More