What is the State pattern?

  • A creational design pattern that provides a way to instantiate an object in a superclass, but allow subclasses to alter the type of objects that will be created.
  • A design pattern used to ensure a class has only one instance, while providing a global access point to this instance for the entire system.
  • A software design pattern that enables an object to be passed around as a value.
  • The State pattern is a behavioral design pattern that allows an object to alter its behavior when its internal state changes. It appears as if the object changed its class.
The State pattern is a behavioral design pattern that allows an object to alter its behavior when its internal state changes. It appears as if the object changed its class.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *