
OneMaton: The 1LoC Automata Pattern That Changes Everything
OneMaton Software Design Pattern the OneMaton software design pattern enables the construction of Automata (state machines) by adding each state (Automaton) with 1 line of code. Merits capsulation of states clean code modular reusable states Lego like algorithm construction the skill is only attentive to the triggers of the active automaton (current state) in the python version automatons are methods or functions. How This Differs Than Using The AlgPart Objects To Construct An Algorithm? 1. activation triggers do not affect the active automata whereas with algparts you end up calling an additional algorithm while the older one runs unless you run an extra step to manage that. 2. the algorithmic queue is free because only short immediate actions are sent, run and done. whereas running an automata via a algparts keeps an algorithm actively listening for triggers while its in the algorithm que. Example Use class AutomataTest ( Automata ): def __init__ ( self ): super (). __init__ () self
Continue reading on Dev.to Python
Opens in a new tab



