lundi 29 novembre 2021

Command Pattern: Executing multiple commands in sequence from different place of system

I need undo system which can execute single or multiple commands. If its multiple commands i need to have opportunity to add commands to the list and in end point execute all commands. Example: Class A, Class B, Class C, Class D: A(add command to list then send it to class B) -> B(add command to list then send it to class D) -> D(add command to list then execute all commands); A(add command to list then send it to class C) -> C(add command to list then send it to class B) -> B(add command to list then execute all commands A)->A(add command to list then execute all commands) Then i can do undo and i want to get this result: A<-C<-B<-A

Aucun commentaire:

Enregistrer un commentaire