Foreword
Like many great advances in our industry, the explicit concept of aspect-oriented programming (AOP) was developed at what is now known as PARC, a Xerox Company. Soon after, in 2001, the AspectJ extensions brought AOP to Java. Aspects have enjoyed a long history in the Java community, but for many .NET developers, aspects are still considered new and exotic. Even so, many .NET developers have been using them without knowing it.
Aspects provide a means of separating cross-cutting concerns from your core implementation code into separate modules. Rather than having every method contain logging code, for example, a logging aspect can be applied to methods external to the method implementation. It’s a powerful technique to help employ the principle of separation of concerns within code.
In AOP in .NET, Matthew D. Groves deftly shines a light on the many ways developers can take advantage of aspects in .NET. He begins with an approachable introduction to AOP and builds on that with an example of an application written without aspects, which is then cleaned up with aspects. Subsequent chapters dig deeper into the various types of aspects and how to apply them using PostSharp and Castle DynamicProxy.
Each chapter builds on the previous one in a distinct, understandable style, each with sample code that clarifies the concepts covered in the chapter. Great care was obviously put into the code samples.