Closed schmengler closed 7 years ago
Instead of separating definitions and executable implementations, we'll create lazy loading versions of the objects that might be expensive to instantiate due to dependencies (actions, triggers). Lazy loading will be implemented via Magento Proxy or Factory:
final class LazyLoadingAction implements Action
{
public function execute()
{
return $this->action()->execute();
}
private function action()
{
if (! $this->action) {
$this->action = $this->factory->create($this->type, $this->parameters);
}
}
}
State machine definition / configuration:
State machine implementation: