I don't know if the title makes sense, but in the app I am writing there are lots of (extension) methods. A simple example:
Objects:
Matter (Burn, Explode, Destroy, Freeze, Heat, Cool)
Atom (Attach, Detach)
<many more>
And a custom collection like:
ImmutableList<T>
And methods like these:
public static class Burner
{
public static Matter Burn ( this Matter matter )
{
// matter is burning ...
}
}
var matters = new ImmutableList<Matter>();
matters.Burn();
As you can see, Burn works on a single entity, but still appears on ImmutableList. That way I want to manage paralellization (burn in parallel) myself.
How do I do this the most performant way, or the cleanest, or the most maintainable way, or combined?
Firstly I would rather not define another extension method that takes ImmutableList inside each class (Burner, etc), because there are hundreds upon hundreds like these and they are probably gonna look the same. But I am open to ideas.
Also all code is mine, so I can change/add anything in any part of the code, not just the extension methods.