Multiple-inheritance, composition and single responsibility principle in .NET
- ๐
- ๐ 854 words
- ๐ 4 minutes
- ๐ฆ .NET
- ๐ท๏ธ C#
- ๐ฌ 5 responses
.NET is often chided by C++ developers for failing to support multiple-inheritance. The reply is often Favor object composition over class inheritance โ a mantra chanted from everywhere including the opening chapters of the Gang of Fourโs Design Patterns book.
If the accepted mantra is that your object should expose interfaces and delegate the implementation of those interfaces elsewhere then it could really do with some better support than .NET currently offers especially where the interface comprises more than a member or two.