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 4. Before and after: boundary aspects

This chapter covers

  • What boundaries mean
  • Using PostSharp to bound methods
  • Writing an ASP.NET HttpModule to help detect mobile users
  • The differences (and similarities) of method interception and method bounding
  • Writing a caching aspect with PostSharp

In chapter 3, I covered one of the most common types of method aspects you can write: method interception. These aspects contain code that runs instead of the code that it intercepts.

Another type of aspect you might use is a boundary aspect, which contains code that runs around the code that it’s bounding. (Most commonly, these aspects are methods, but other types of boundaries exist, including page requests, ASP.NET MVC controller actions, ...

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