SystemVerilog OOP Mastery · All levels

Interface Classes and `implements`: Concept Explained

Concept Explained for Interface Classes and `implements`.

Concept

In short: An `interface class` defines role contracts independent of inheritance tree; concrete classes adopt those roles with `implements`.

Use interface classes when multiple unrelated classes must expose the same API shape. This decouples capability contracts from base-class lineage, so you avoid forcing everything under one deep inheritance hierarchy.

A class can `extend` one base class and `implements` one or more interface classes. That is the key mechanism SystemVerilog provides for role-based polymorphism without multiple class inheritance.

Related topics