Skip to main content

Interfaces and Contracts

  • Chapter
Accelerated C# 2008
  • 394 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 39.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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 

Download references

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Weldon W. Nash, III

About this chapter

Cite this chapter

(2007). Interfaces and Contracts. In: Accelerated C# 2008. Apress. https://doi.org/10.1007/978-1-4302-0338-4_5

Download citation

Publish with us

Policies and ethics