O'Reilly logo

Applied Microsoft® .NET Framework Programming by Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Interfaces

In this chapter, I’ll explain how interfaces identify functionality that can be tacked onto a type. I’ll then show you how a type can implement an interface to offer this well-defined functionality, allowing the type to be used in various scenarios easily. Finally, I’ll demonstrate useful techniques for avoiding problems when you use interfaces—namely, duplication of member names and compromised compiletime type safety.

Interfaces and Inheritance

When programming, it’s useful to think of an object as being of multiple types because the type of an object describes its capabilities and behavior. For example, you could design a SortedList type that maintains a set of objects in a sorted order. You could add any System.Object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required