Design pattern for default implementation with empty methods

前端 未结 9 1305
余生分开走
余生分开走 2021-02-02 11:32

Is there a specific design pattern that describes the scenario where a non-abstract default implementation is provided that implements all or some of the method

9条回答
  •  隐瞒了意图╮
    2021-02-02 12:12

    You should follow different design principle : interface-segregation principle

    The Interface Segregation Principle states that clients should not be forced to implement interfaces they don't use. Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one sub module.

    You should not implement MORE And you should not implement LESS

    Have a look at related SE questions for more details.

    The Interface Segregation Principle

    Interface Segregation Principle- Program to an interface

提交回复
热议问题