0

[workflow] - which design pattern is best for it?

Wang Mengyu 1 month ago updated 2 weeks ago 3
hi ,  I recently want to finish a workflow project .
It's steps can configured by backend adminer. 
for example : 
   [
    if condition1 :
         then do_something_1
   if condition 2 : 
        then do_something_2 
   end 
  ]
ps. 
do_something_1 and do_something_2  can set in a list of operation, every operation has its own logical . send a mail or send an site message and so on . 

which design pattern is the best choice for the workflow? 
Thanks
 

    

is there any overlap in the behavior of the "do somethings"?

+1

if not each condition is implementation of an interface as per strategy pattern perhaps?

+1

thx , I will try it.