I have to agree with Jason Bock and Tom Barnaby, the authors of Applied .NET Attributes—it’s somewhat difficult to explain what .NET attributes are and what they are for. I think MSDN’s definition is a pretty good start.
The common language runtime allows you to add keyword-like descriptive declarations, called attributes, to annotate programming elements such as types, fields, methods, and properties. Attributes are saved with the metadata of a Microsoft .NET Framework file and can be used to describe your code to the runtime or to affect application behavior at run time. While the .NET Framework supplies many useful attributes, you can also design and deploy your own.
This is exactly what the book teaches you: what attributes are, why they appear all over the place in .NET, and how to create your own attributes to add metadata to your code.
Personally, I love custom attributes. They are a great way to make your code more descriptive. In and of themselves, attributes are unobtrusive—they mean nothing unless you mine them. What I mean is, if you develop a custom attribute and apply it to a class/field/property/etc, it won’t do anything until you write more code to act on this attribute.
The book, Applied .NET Attributes, is only 200 or so pages long, which makes it a quick read. Both authors are top-of-the-line experts in their field. Aficionados of low-level coding will find plenty of coverage of how attributes are compiled and physically stored with binaries (see appendix Physical Representation of Metadata).
The book is written for a wide range of readers—from beginners to hard-core geeks. There’s a chapter on extending the compilation process with CodeDOM (Chapter 5, Applying Custom Attributes) which I loved as it was plenty hard-core.
Chapter 4 has a great (albeit short) discussion of Aspect Oriented Programming (AOP). There’s little written about AOP in the context of .NET, so this was a great segway with a meaningful sample. In my opinion, this chapter alone cost $21.50 I paid Bookpool.
As much as I enjoyed Applied .NET Attributes, I think it might’ve been organized better. The discussion of Remoting is too long and out of place. If I wanted to brush up on remoting, I’d re-read Ingo Rammer’s classic book. If I needed a refresher on Enterprise Services (COM+) I would pick up a copy of… You get my drift. One can argue that attributes are an inalienable part of both Remoting and Enterprise Services (and they are), but they are also essential in server control development and lots of other areas. Plugging a discussion of each of those areas would be neither reasonable nor feasible.
Conclusion
Attributes are first-class citizens in .NET. It’s crucial that you understand their purpose and extensibility possibilities, which makes Applied .NET Attributes a must-read for every .NET developer (given that there are no other books specifically on this subject).