Join the DZone community and get the full member experience.
Join For Free
Learn more about the advantages of moving from a monolithic to microservices architecture. Brought to you in partnership with IBM.
The State pattern allows an object to alter its behavior when its internal state changes
- Localizes state-specific behavior and partitions behavior for different states
- Makes state transitions explicit
When to use:
- An object’s behavior depends on its state, and it must change its behavior at run-time depending on that state.
- Operations have large, multipart conditional statements thatdepend on the object’s state.
From Idea to Application gives you the architecture to quickly build, manage and run a range of applications (web, mobile, big data, new smart devices, etc.) on an open-standard, cloud-based platform. See why developers are using IBM Bluemix. Brought to you in partnership with IBM.
Published at DZone with permission of
Cristian Chiovari, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.