Patterns_Strategy - super-idesign/designpatternrecognizer Wiki

strategy

The Strategy pattern broadcasts communication. A subject automatically broadcasts notifications to all of its observers. The subject doesn't know how many independent objects there are. Its only responsibility is to broadcast these notifications.

Strategy class:

  1. Check if the node is an interface or an abstract class
  2. Check if the node contains a method with an empty body
  3. Check if the class is being used by at least one other class

Concrete strategy class:

  1. Check if the class inherits or implements the strategy class
  2. Check if the class doesn't use the context class
  3. Check if the class doesn't instantiate or declare any objects from another class

Context class:

  1. Check if the class has a private field or property that has a strategy class as type