How to avoid long switch ..need help refactoring
i needed help refactoring the following class, Following is a class Operation with variety of Operations in switch : i want to avoid the switch statement.I read few articles on using polymorphism and state pattern .but when i refactor the classes i dont get access to many variables,properties Im confused on whether to use operation as abstract class or to implement an interface. Just wanted to know which type of refactoring will help in this case polymorphism or state pattern? And when to use them? public class Operation { public enum OperationType { add, update, delete, retrieve } public enum