Comparing Abstract Classes to Interfaces

Before interfaces existed, abstract classes were used to solve the same kinds of problems interfaces can now solve. How Microsoft elected to invent interfaces when many programmers already used abstract classes is a conversation I was not privy to.

Interestingly enough, abstract classes and interfaces solve similar but orthogonal problems. Abstract classes allow you to define an interface with or without a partial implementation; interfaces do not allow you to provide any implementation. The fact that abstract methods and interface methods have no implementation is where they are identical. Where interfaces and abstract methods are orthogonal is where you will find abstract methods and interface methods. ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.