I was wondering if interfaces would give any benefit at run time.
Let’s say i have a manager that handles a extremely large/complex object. If this object needs to interact with many chunk of different logic, would it be beneficial to make it implement an interface for each specific pieces of logic and then pass it as that specific interface. Would this improve performance in any way ?
It won’t be an improvement. You could think of an interface as a different way to represent an instance. Whichever representation (interface) you operate on doesn’t change the characteristics of the instance itself. A lot of classes, for example, implement
IDisposable. Passing such an instance around as IDisposable doesn’t change the rest of the object’s behavior and doesn’t make its Dispose() logic any more efficient.