© James E. McDonough 2017

James E. McDonough, Object-Oriented Design with ABAP, 10.1007/978-1-4842-2838-8_22

22. State Design Pattern

James E. McDonough

(1)Pennington, New Jersey, USA

The next stop on our voyage through the Design Patterns galaxy takes us to the State design pattern , another of the design patterns found in the GoF catalog. We will find this design pattern useful when we need to make an object behave differently based on its internal state.

One aspect of an entity is its current condition. A person can be healthy or sick. A door can be open or closed. Water can exist as solid, liquid, or gas. Another name for this condition is the state of the entity. Often we refer to the entity as being “in a state” to describe its condition, ...

Get Object-Oriented Design with ABAP: A Practical Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.