Python Strategy Context Class

Descripción

Context class that uses a strategy


File Template: ✅


Prefix

strategy:context


Scopes

python


Snippet de código

class ${1:Context}:
	def __init__(self, strategy):
		self._strategy = strategy

	def set_strategy(self, strategy):
		self._strategy = strategy

	def execute_strategy(self):
		self._strategy.execute()