Design Patterns - correction mode

background

  1. Sometimes when doing business, the need for business success, the callback function will be operating.
  2. For the needs of the scene, how to design it

achieve

Here Insert Picture Description

  1. Task: abstract class, two methods, which use a assigned to the client, a method for performing service operations, the callback function is required. execute () is an abstract method to be implemented subclass
  2. SimpleTask: implementation of a specific service logic execution
  3. Callback: callback function
Published 377 original articles · won praise 349 · views 940 000 +

Guess you like

Origin blog.csdn.net/ZHOUCHAOQIANG/article/details/103962664