I'm constructing a set of filter-classes which will all have the same method 'Applyfilter'.
How should I define the interface which contains apply filter? The only issue is that apply filter can take a second argument of various types e.g. int, string, Lists. Some pseudo code.
Current Interface method:
Data ApplyFilter(input-data, object value);
Example:
public *data* ApplyFilter(input-data, ***string color***) {
// Do something with to data with the color string
}
public *data* ApplyFilter(input-data, ***List<int> size***) {
// Do something with to data with the size list
}
If I defined the type of argument two as an 'object'. I can do some validation within the ApplyFilter function. As mentioned here: Check if Object is Dictionary or List but is there a better way to do this?