Relative Content

Tag Archive for inheritance

Does non-virtual-by-default lead us to composition-over-inheritance?

There are some design guidelines about testable code in “The Art of Unit Testing”. The first one is “Make methods virtual by default”. I’m curious to know your idea about non-virtual-by-default behavior in C#. I’ve read about Hejlsberg opinions but I think one the most important reasons could be that it may lead us to “composition over inheritance” principal.