Go Beyond Inheritance
With object-oriented languages such as C#, we can derive our types from other types and we can also implement contracts (interfaces) and make them fulfill that contract. Implementing interfaces and making an implementation fulfill these is really one of the great things about a type-safe language. With the compiler, we get everything checked to make sure we implement the contract, while at runtime, we can leverage the interface type to be a representation rather than having to know the actual implementor.
Sometimes, however, the verbosity of having to implement an interface can be too much. It can also be limited to what you’re trying to achieve.
In this chapter, we will cover the following topics:
- Method signature conventions
- By the end of the chapter, you will have an idea of how conventions can let you go beyond having to inherit from a base type or an interface and how that sometimes caters to a cleaner code base.