DEV Community

Discussion on: Using the Strategy Pattern (Examples in C#)

Collapse
 
boumboumjack profile image
Boumboumjack

I used to do similar things, but for task that have a very similar output/process, I tend to use a "DeleteOption" argument to keep the process centralised. I find it easier to then save the parameters with a DataContract.

I guess you use a dictionnary to select the correct function? I usually do this for very unrelated tasks:

IDictionnary <myEnum.MethodName, myIAction>

. Then it is as well quite easy to save it.