I have logic groups that consist of static classes, such as:
static class A { static int mutate(int i) { }; static double prop(double a, double b) { }; } static class B { static int mutate(int i) { }; static double prop(double a, double b) { }; }
In this case, A and B are static classes that implement the same behavior using a group of functions (e.g. mutate). I would like to use something like an interface for this template, however, since static classes cannot implement interfaces, I'm not sure what to do. What is the best way to implement this type of behavior?
EDIT:
Here is an example of what I'm doing now. Classes have no state, so I would make them static.
Interface IMutator { int mutate(int i); } class A : IMutator { int mutate(int i) { }; } class B : IMutator { int mutate(int i) { }; } class C { public List<IMutator> Mutators; public C(List<IMutator> mutators) { Mutators = mutators; } }
source share