Compare
Symptom
Human

A subclass inherits methods or fields it doesn't actually use — overriding to no-ops, throwing 'unsupported', or just ignoring the inheritance.

Agent

A subclass overrides parent methods with no-ops or 'unsupported' throws; code generated against the parent's interface that calls the inherited method against this subclass produces a runtime failure the type checker accepted.

Goal
Human

Sharing happens through composition (a delegate object) rather than forced inheritance.

Agent

Behavior reuse runs through a held collaborator instead of through inheritance; generated code that calls a method on a reference type runs the method the type's signature promises.

Smellier version

class Animal { fly() {} swim() {} }
class Dog extends Animal {
fly() { throw new Error('no'); }
}

Fresher version

class Dog {
// composes a Mover delegate that knows it's a swimmer
}
Example source: Illustrative example written for this site, not a quotation from any source.
Pressure
Human

Liskov violations: callers can't trust subclass instances to honor the parent contract; polymorphism becomes a trap.

Agent

Liskov violations: the agent cannot trust subclass instances to honor the parent contract, so polymorphism becomes a trap that the agent must defensively check at every call site.

Tradeoff
Human

Replacing inheritance with composition is more verbose at construction sites and removes the syntactic polymorphism inheritance provided; consumers that rely on `instanceof` checks or shared base methods need explicit migration.

Agent

Composition is more verbose at construction; the agent loses syntactic polymorphism and must verify behavior through explicit delegation calls instead of relying on inheritance dispatch.

Relief
Human

Each class has only what it needs; surprises in polymorphic use disappear.

Agent

Code generated against a reference type's interface executes the methods that type defines; calls dispatched against the type signature do not silently fall through to no-op overrides.

Trap
Human

Replacing every inheritance relationship with composition, including ones where the Liskov contract genuinely holds — pays construction-site verbosity for no real fit improvement.

Agent

Replacing inheritance with composition on hierarchies where every subclass honors the parent's contract adds forwarding methods at every site without changing what the agent's generated calls do; the tokens spent on the rewrite buy no behavioral guarantee the inheritance did not already provide.