Study notes (4): Chapter 1 Software Architecture Design Principles-4.Interface Segregation Principle Interface Segregation Principle

Learn now: https://edu.csdn.net/course/play/28942/403591?utm_source=blogtoedu

  1. Use multiple specialized interfaces instead of using a single general interface; try to refine the interface and have as few methods as possible
  2. Achieve high cohesion, low coupling, improve readability, scalability, and maintainability
  3. For example: If there is eating, drinking and sleeping in an interface, the practical implementation class does not need to [sleep], so if eating and drinking and sleeping are all a single interface, the implementation class can inherit and implement different interfaces according to their needs
  4. Feels similar to single responsibility

Guess you like

Origin blog.csdn.net/qq_28500837/article/details/111660915