Design pattern for default implementation with empty methods

前端 未结 9 1364
余生分开走
余生分开走 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 11:56

    To me this seems closest to the Special Case or Null Object pattern.

    Your updates suggest something similar to Template Method expect that you don't have a single method that calls each template method e.g.

    public void doEverything()
    {
      doThis();
      doThat();
      done();
    }
    

提交回复
热议问题