O'Reilly logo

Design Patterns in C# by Steven John Metsker

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 2. Introducing Interfaces

A class's interface, speaking abstractly, is the collection of methods and fields that a class permits objects of other classes to access. This interface usually represents a commitment that the methods will perform the operation implied by their names and as specified by code comments and other documentation. A class's implementation is the code that lies within its methods.

C# elevates the notion of interface to be a separate construct, expressly separating interface (what an object must do) from implementation (how an object fulfills this commitment). C# interfaces allow several classes to provide the same functionality, and they open up the possibility that a class can implement more than one interface.

Several ...

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