Week of PostSharp, Day 2 - Aspect-Oriented Programming

by Gael Fraiteur on 20 Aug 2013

The 'Week of PostSharp' is a joint promotion with Manning Publications where we highlight a new book each day that is special to us and hand-picked by the PostSharp team – with a small introduction about how it connects to what we are doing. We also collaborated with Manning to select a second book for each day of the week, and will be offering our choices at a 50% discount on their site! You can even read excerpts from some of the books online for free by clicking on the links below.

We hope you enjoy the deals! We’ll be adding new posts with the daily discount code throughout the week, so stay tuned.

There are times when OOP won’t let us achieve a nice separation of concerns (assembly > namespace > class > method). Think of INotifyPropertyChanged, logging, performance monitoring, transaction handling, undo/redo, caching… Way too often, we have to duplicate tons of infrastructure code. This is why aspect-oriented programming (AOP) has been engineered. With AOP, you can encapsulate cross-cutting features into a special class called an aspect, and apply the aspect to a large number of classes or methods without actually modifying your business source code. As a result, you get rid of most of your boilerplate.

PostSharp has long been the most complete and the most popular AOP framework for .NET but PostSharp is not limited to AOP, and AOP is not limited to .NET. Today we’re recommending two books: AOP in .NET, which gives you an excellent introduction to AOP not only using PostSharp, and AspectJ in Action, whose outstanding quality makes it a must-read for anyone interested in aspect-oriented programming and offers deep insights that are directly applicable to PostSharp. You can now purchase these books with a 50% discount using the discount code pswkd2! But hurry, the offering is only valid until August 21st 12 midnight EST!

AOP in .NET introduces aspect-oriented programming and provides guidance on how to get the most practical benefit from this technique. The book's many examples concentrate on modularizing non-functional requirements that often sprawl throughout object-oriented projects. You'll appreciate its straightforward introduction using familiar C#-based examples.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the discount code pswkd2

 

AspectJ in Action, Second Edition is a fully updated, major revision of Ramnivas Laddad's best-selling first edition. It's a hands-on guide for Java developers. After introducing the core principles of AOP, it shows you how to create reusable solutions using AspectJ 6 and Spring 3. You'll master key features including annotation-based syntax, load-time weaver, annotation-based crosscutting, and Spring-AspectJ integration. Building on familiar technologies such as JDBC, Hibernate, JPA, Spring Security, Spring MVC, and Swing, you'll apply AOP to common problems encountered in enterprise applications.

Download Free Chapter (PDF)   |   Purchase with 50% discount using the code pswkd2