is it a good pattern to add a parameter object instead of primitive for respecting the Open Close Principle.
Lets say I have this interface
public interface IBar{
void DoSomething(int id);
}
If one day I need to add a parameter, I'll have to change my interface. With this solution
public interface IBar{
void DoSomething(DoSomethingParameter parameters);
}
I can add as many parameters as I need without touching the interface, and I'll be able to create new implementaiton of IBar using the new parameters.
Is it an anti pattern ?