If the logic works with interface elements and not with implementation elements, it is recommended to write an auxiliary method [or extension method].
public IRandom { byte NextByte (); } public static class IRandomExtensions {
If business logic works against implementation members,
public class SomeCommand : ICommand {
then, most likely, we should more rigidly bind this to the implementation class. If this is a fairly common occurrence, then the base class may make sense.
Personally complex hierarchies are more problems than they are worth it, use your own opinion regarding maintainability, legibility and reuse, and you should be fine!
Hope this helps! :)
johnny g
source share