Square-rectangle problem

From CSSEMediaWiki
Jump to: navigation, search

This problem is also known as the Circle-ellipse problem and is an antipattern. It occurs for example when Square inherits from Rectangle or Circle inherits from Ellipse. While these inheritance relationships may make sense conceptually (and mathematically), they constitute a violation of the Liskov substitution principle.

For more information about this problem, see Circle-ellipse problem.

Personal tools