Extension Methods

  • Trey Nash


Using extension methods, you can declare methods that appear to augment the public interface, or contract, of a type. At first glance, they may appear to provide a way to extend classes that are not meant to be extended. However, it’s very important to note that extension methods cannot break encapsulation. That’s because they’re not really instance methods at all and thus cannot crack the shell of encapsulation on the type they are extending.


Functional Programming Extension Method Instance Method Static Void Visitor Pattern 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 5.
    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