Advertisement

Interfaces and Contracts

  • Trey Nash

Abstract

During your years as a software developer, you’ve likely come across the notion of interface-based programming. If you’re familiar with the seminal book, Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (known as the “Gang of Four”), 1 then you know that many design patterns employ interface-style “contracts.” If you’re not familiar with that book and its concepts, I urge you to read it. In this chapter, it is my goal to show you how you can model well-defined, versioned contracts using interfaces. In this context, a contract is an agreement by a type to support a set of functionality.

Keywords

Interface Type Concrete Type Interface Method Public Contract Public Class 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Boston, MA: Addison-Wesley Professional, 1995), is cited in the references at the end of this book.Google Scholar

Copyright information

© Trey Nash 2010

Authors and Affiliations

  • Trey Nash

There are no affiliations available

Personalised recommendations