Please explain in a few words what the meaning of this template is and what it does. I read the wiki, I did not understand a damn thing. I read it here: http://articles.javatalks.ru/articles/3 It seems I understood a little, but I did not understand the meaning of this template, what it does. The article says about the classes "light" and "TV" (you can turn it on and off) and says that using the template does not need to change the old class. But in fact, in the end, separate on-off methods are created for TV and everything else, just like with Light ..
Switcherclass, if it is written once for working with commands. We simply create the "turn on / off the fridge", "turn on / off the radio" commands, andSwitcherwill work with them without changes. - Nofate ♦execute(). - Nofate ♦