jeudi 24 novembre 2016

Should I combine interface implementations using reflection (C#)?

I'll present a simplified case of my situation.

So, I'm making some transformations within MyClass type

public interface ITransformer
{
  List<MyClass> Transform(MyClass item);
}

Because the transformations are really different, it makes perfect sense to provide them as different implementations of ITransformer.

However, now there is a need to have a combined result of all possible transformations. Something like GlobalTransformer : ITransformer whose Transform method calls all other implementations and combines their results...

Does it make sense? Should I use reflection for it? Or should I approach the problem differently somehow?





Aucun commentaire:

Enregistrer un commentaire