I’m writing a program where each component has an inheritance structure has three levels… ui, logic, and data… where each of these levels has an interface of defined functionality that all components must implement. Each of these levels also has some functionality that could be written generically for the whole interface, rather than repeatedly for each component.
In my mind, the best approach would be an abstract class in between the interface and the component implementation that does all the generic functionality (as in the linked class diagram here)… but the inheritance rules for C# only let me have the multiple inheritance from unimplemented interfaces. What would be a best practices design to achieve this type of behavior?
Why not have each one of the components (UI, logic and data) in a different class and then have the UI using the logic class then have the logic class use the data class.
That way you could have each class inherit from the appropriate generic class.
Remember, you should prefer composition over inheritance