Join the DZone community and get the full member experience.
Join For Free
Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.
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.
The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.
Published at DZone with permission of
Cristian Chiovari, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.