Ok, so I am designing a class here and I have two options. I can either write multiple methods or a single method which takes say an Enum.
I'm trying to figure out the best way to do this.
Lets take an example:
public class myClass
{ ...
public void DoStuff1()
{ ... Do Stuff ... }
public void DoStuff2()
{ ... Do Stuff ... }
public void DoStuff3()
{ ... Do Stuff ... }
}
Ok, all makes sence, now an alternative way would be:
public class myClass
{ ...
public Enum Option
{
Option1,
Option2,
Option3
}
public void DoStuff(Option option)
{ ... Do Stuff ... }
}
In terms of DRY, they are not that bad becaues the code pretty much calls internal methods anyhow, so it's only what is visible to the user for them to choose.
So which do you prefer an why and are there any guidelines around this already?