Patterns_State - super-idesign/designpatternrecognizer Wiki

state

State node:

  1. Check if the node is an abstract class or has an interface
  2. Check if the class contains a method that:
    • returns type void
    • has an empty body
  3. Check if the class is used by at least one other class

Concrete state node:

  1. Check if the class inherits or implements the state class
  2. Check if the class contains a method that:
    • returns type void
    • makes a new state that's different than itself

Context node:

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