I'm not sure which design pattern might help me solve this issue.I have a class, 'Coordinator', which determines which Worker class should be used - without having to know about all the different types of Workers there are - it just calls a WorkerFactory and acts upon the common IWorker interface.It then sets the appropriate Worker to work and returns the result of its 'DoWork' method.This has been fine... up until now; we have a new requirement for a new Worker class, WorkerB which requires an additional amount of information i.e. an additional input parameter, in order for it to do its work.Its like we need an overloaded DoWork method with the extra input parameter...but then all the existing Workers would have to implement that method - which seems wrong as those Workers really dont need that method.How can I refactor this to keep the Coordinator unaware of which Worker is being used and still allowing each Worker to get the information it requires to do its job but not have any Worker do things it doesn't need to?There are a lot of existing Workers already.I don't want to have to change any of the existing concrete Workers to accommodate the requirements of the new WorkerB class.I thought maybe a Decorator pattern would be good here but I haven't seen any Decorators decorate an object with the same method but different parameters before...Situation in code:public class Coordinator{    public string GetWorkerResult(string workerName, int a, List<int> b, string c)    {        var workerFactor = new WorkerFactory();        var worker = workerFactor.GetWorker(workerName);        if(worker!=null)            return worker.DoWork(a, b);        else            return string.Empty;    }}public class WorkerFactory{    public IWorker GetWorker(string workerName)    {        switch (workerName)        {            case WorkerA:                return new ConcreteWorkerA();            case WorkerB:                return new ConcreteWorkerB();            default:                return null;        }    }}public interface IWorker{    string DoWork(int a, List<int> b);}public class ConcreteWorkerA : IWorker{    public string DoWork(int a, List<int> b)    {        // does the required work        return some A worker result;    }}public class ConcreteWorkerB : IWorker{    public string DoWork(int a, List<int> b, string c)    {        // does some different work based on the value of 'c'        return some B worker result;    }    public string DoWork(int a, List<int> b)    {        // this method isn't really relevant to WorkerB as it is missing variable 'c'        return some B worker result;    }    }
C# Design Pattern for workers with different input parameters
c#;design patterns
I have re-engineered the solution based on @Dunk's comment:...you already know all the parameters needed before the IWorker instance is created. Thus, you should have passed those arguments to the constructor and not the DoWork method. IOW, make use of your factory class. Hiding the details of constructing the instance is pretty much the main reason for the factory class's existence.So I have shifted all the possible arguments required to create an IWorker into the IWorerFactory.GetWorker method and then each worker already has what it needs and the Coordinator can just call worker.DoWork();    public interface IWorkerFactory    {        IWorker GetWorker(string workerName, int a, List<int> b, string c);    }    public class WorkerFactory : IWorkerFactory    {        public IWorker GetWorker(string workerName, int a, List<int> b, string c)        {            switch (workerName)            {                case WorkerA:                    return new ConcreteWorkerA(a, b);                case WorkerB:                    return new ConcreteWorkerB(a, b, c);                default:                    return null;            }        }    }    public class Coordinator    {        private readonly IWorkerFactory _workerFactory;        public Coordinator(IWorkerFactory workerFactory)        {            _workerFactory = workerFactory;        }        // Adding 'c' breaks Open/Closed principal for the Coordinator and WorkerFactory; but this has to happen somewhere...        public string GetWorkerResult(string workerName, int a, List<int> b, string c)        {            var worker = _workerFactory.GetWorker(workerName, a, b, c);            if (worker != null)                return worker.DoWork();            else                return string.Empty;        }    }    public interface IWorker    {        string DoWork();    }    public class ConcreteWorkerA : IWorker    {        private readonly int _a;        private readonly List<int> _b;        public ConcreteWorkerA(int a, List<int> b)        {            _a = a;            _b = b;        }        public string DoWork()        {            // does the required work based on 'a' and 'b'            return some A worker result;        }    }    public class ConcreteWorkerB : IWorker    {        private readonly int _a;        private readonly List<int> _b;        private readonly string _c;        public ConcreteWorkerB(int a, List<int> b, string c)        {            _a = a;            _b = b;            _c = c;        }        public string DoWork()        {            // does some different work based on the value of 'a', 'b' and 'c'            return some B worker result;        }    }