Let me try to answer that. Rate your options:
1) If the interface below
public interface MyInterface { IData GetData(string p1, char p2, double p3); }
:
a) and should not be used at all, then you should force developers to rewrite it. Therefore, change the definition of the method.
public interface MyInterface { IData GetData(something else); }
b), but you only need to encourage users to use the new definition, then you can create a new overload by indicating that the first one is out of date.
public interface MyInterface { //xml to tell them this is deprecated. IData GetData(string p1, char p2, double p3); IData GetData(string p1, char p2, double p3, and whatever); }
There is no decision about your new definition that no one can give without knowing about the model, but you ask yourself,
I) "Can the parameters themselves represent a single entity, if they are combined? Does it mean something in the real world to have one unit of your parameters?" If so, do so. If not, do not do this. I think you should rely on thoughts in such abstract levels when you are in such a dilemma. I'm not sure what the point is in bool p4 and DateTime p5 . You should be in the club of those parameters that themselves represent something in real life. If no combination of them makes sense, leave it as such. You will have more success in leaving such a club in such a logical way of thinking. Keep in mind that you leave your definition to other programmers, and to make their work easier, your method signature should be very logical.
II) Can a class do more things than just contain a data set? The class should be here.
III) Do I need to control only the definition of the class, and not its implementation? In this case, just define the open interface of your inputs and leave the implementation to the client.
IV) Should future modifications of my interface not violate the existing implementation? Overload is your way.
Suppose you have two options: leave the signature aligned or in the club.
1) Without clubs:
a) Less code, reduction of another layer.
b) No need to publish another class.
2) With a club:
a) Provides a better understanding of the model for entering the function - your intention is clear.
b) Scales easily in the future if you need to add additional data to build a newly created class. Let's say you have a class
class Input { string p1; char p2; double p3; public Input(string p1, char p2, double p3){ } }
and interface
public interface MyInterface { IData GetData(Input p1); }
Now you can add additional data such as bool and DateTime. Since they are optional, you do not need to force it into the constructor. You can still have the same constructor and give the user the right to change, if necessary, outside the constructor.
class Input { string p1; char p2; double p3; bool p4; DateTime p5; public Input(string p1, char p2, double p3){ } }
The interface may be the same. As I said, the incentive to derive something from this kind of sadly depends on your model. In short, if a grouping can mean something, make it a class or an interface (depending on who will control the logic).