Liskov Substitution Principle

It formally states that

-the preconditions of a subclass’s behaviour (methods) cannot be strengthened, meaning (among other things) that a sub-method cannot accept a narrower range of inputs than the original method.

-The post conditions of a sub-method cannot be weakened, meaning that the sub-method cannot have a broader range of effect than the original method.

Java-Liskov Substitution Principle

WEAKER ==== WIDER; STRONGER ==== NARROWER.

For the LSP to be preserved, the sub-method should be smiling! (we don’t care about the super method, because it is what it is)

相关文章:

  • 2021-08-22
  • 2021-05-05
  • 2021-05-20
  • 2021-08-12
  • 2022-12-23
  • 2022-02-05
  • 2021-10-19
  • 2021-12-14
猜你喜欢
  • 2021-06-18
  • 2022-01-10
  • 2022-01-19
  • 2022-01-23
  • 2022-02-06
  • 2021-06-05
  • 2022-02-19
相关资源
相似解决方案