State Pattern
The State pattern is a behavioral object-oriented design pattern that lets an object alter its behavior when its internal state changes, by delegating state-specific behavior to separate state objects rather than using large conditional statements, making the object appear to change its class at runtime.
8 resources across 3 libraries
Glossary Terms(5)
State Pattern
The State pattern is a behavioral object-oriented design pattern that lets an object alter its behavior when its internal state changes, by delegating state-sp…
Template Method Pattern
The Template Method pattern is a behavioral design pattern in which a base class defines the overall skeleton of an algorithm as a sequence of steps, while def…
Abstract Factory Pattern
The Abstract Factory pattern is a creational design pattern that provides an interface for creating families of related or dependent objects without specifying…
Prototype Pattern
The Prototype pattern is a creational design pattern in which new objects are created by copying (cloning) an existing, fully initialized object — the prototyp…
Null Object Pattern
The Null Object pattern is a behavioral design pattern that replaces the use of null references with a special object implementing the expected interface but e…
Study Notes(1)
Interview Questions(2)
What is the State Pattern?
The State pattern is a behavioral design pattern that lets an object change its behavior when its internal state changes, by delegating state-specific logic to…
Strategy vs State Pattern
The Strategy pattern lets a client choose an interchangeable algorithm at will and injects it into a context, while the State pattern lets an object change its…