Design Patterns - Behavioral Patterns Summary (20)

Template Patterns define the framework of an algorithm in operation, and defer some steps to subclasses, so that subclasses can redefine certain steps of an algorithm without changing the structure of the algorithm.

Command mode (Command) is a highly cohesive mode that encapsulates a request into an object, so that the client can be parameterized with unreasonable requests, and can provide command revocation and recovery functions for request queuing or request log recording.

The Chain of Responsibility pattern avoids coupling between the sender and receiver of a request by giving multiple objects the opportunity to process a request. Chain these objects together and pass the request down the chain until an object handles it.

Strategy mode (Strategy), also called policy mode, defines a set of algorithms, encapsulates each algorithm, and makes them interchangeable.

The Iterator pattern (Iterator) provides a way to access the elements in a container object without exposing the internal details of the object.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324680398&siteId=291194637