Subtype Knowledge

In this antipattern [1], types have uses relationships to their subtypes. The presence of STK instances compromises separability of sub- and supertypes. In particular, it implies that there are circular dependencies between the name spaces containing sub- and supertype. Instability in the (generally less abstract) subtype will cause instability in the supertype, and the supertype cannot be used and understood without its subtype.

This antipattern is implemented as graph query (motif) as follows:

motif stk
select type,supertype
connected by inherits(type>supertype) and uses(supertype>type)
where "inherits.type=='extends' || inherits.type=='implements'" and "uses.type=='uses'"
group by "supertype"


  1. A. J. Riel. Object-Oriented Design Heuristics. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1996.