Skip to content

Liskov: Subclass shouldn't weaken post-conditions #11

@ResponsiblyUnranked

Description

@ResponsiblyUnranked

A subclass also shouldn’t weaken post-conditions:

  • A superclass method might close all database connections
  • If an overriding subclass method changes this behaviour to leave the connections open, then you won’t be able to interchange super and subclasses without the possibility of leaving lots of open DB connections, as the client code will expect them to always be closed

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions