O'Reilly logo

AOP in .NET: Practical Aspect-Oriented Programming by Matthew D. Groves, Foreword by Phil Haack

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 5. Get this instead: intercepting locations

This chapter covers

  • What is a location?
  • Using PostSharp to intercept locations
  • Writing lazy-loading aspects
  • How noisy INotifyPropertyChanged makes your code
  • Using AOP to make INotifyPropertyChanged clean and easy

In chapter 3, I wrote about method interception. In this chapter, we’ll look at a different kind of interception: the interception of locations. I’ll start by reviewing what a location is (field or property), then I’ll show you a couple of examples of real-world aspects that you can use on locations. So far, the focus has been mainly on methods. But locations are an important part of your code and can be susceptible to the same types of repetitive boilerplate as methods.

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