Showing posts with label OOP. Show all posts
Showing posts with label OOP. Show all posts

Wednesday, 20 May 2015

State and Strategy patterns

http://en.wikipedia.org/wiki/State_pattern

The state pattern, which closely resembles Strategy Pattern, is a behavioral software design pattern, also known as the objects for states pattern. This pattern is used incomputer programming to encapsulate varying behavior for the same object based on its internal state. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements[1]:395 and thus improve maintainability.