Shared calling protocol, shared data sub-structures, fixed compile-time equivalence hierarchy, all clumped together.
Go gets it right. Cut the linkage between composition and equivalence. Composition handles inclusion/merging of existing objects. Interfaces handle equivalence of objects. Interfaces can have hierarchies, but there's no one true hierarchy baked into the objects they describe.
Shared calling protocol, shared data sub-structures, fixed compile-time equivalence hierarchy, all clumped together.
Go gets it right. Cut the linkage between composition and equivalence. Composition handles inclusion/merging of existing objects. Interfaces handle equivalence of objects. Interfaces can have hierarchies, but there's no one true hierarchy baked into the objects they describe.