Things should not be called *as* their interfaces, it's better to call them *according to* their interfaces. When calling on the abstraction directly (e.g. a parameter is "ISomeType", instead of hinting"where T is ISomeType") it typically means boxing and dynamic dispatch. The perfect combo is using interfaces as a means of duck-typing/generic typing (i.e. according to/"where"). It means it gets resolved at compile time.
Пікірлер: 1