Manning releases portions of books while it's still a work in progress in order to get early feedback and improve the end result. They call this the the Manning Early Access Program or "MEAP".
My book, Aspect-Oriented Programming in .NET will soon be available as a MEAP. So if you are interested, please keep an eye on the MEAP page for my book.
There will also be a "Author Online" (AO) forum available for you to ask questions, leave comments, and give feedback about the book, so I encourage you to participate so that the book is as helpful and as useful as possible.
I have just signed a contract with Manning to write a book. Working title: Aspect Oriented Programming in .NET.
I am very pleased to be working with Manning, who not only has a good reputation in the developer community, but is also the same publisher who put out AspectJ in Action, by Ramnivas Laddad, which is definitely one of the top books on AOP to this day (albeit with a Java focus).
I hope to keep putting out some good blog posts on this site, but with this book and some other projects coming up, I probably won't be writing near the quantity of blog posts.
For those who helped me get this far, (you know who you are), whether it be a large contribution or small, family, friend, or one of my 140-character mentors, you have my eternal gratitude. But I probably won't see you for a while, since I now have to chain myself to a radiator near my computer in order to get this book written, written well, and written on time.
AOP is best used for cross-cutting concerns, which are often non-functional requirements. But what's the difference between functional requirements and non-functional requirements?
A functional requirement is a requirement about what an application should do. This is manifested in a form that the user can easily observe. Business rules, UI logic, etc.
A non-functional requirement is a requirement about how an application should work. This is stuff that a user typically doesn't see (and probably doesn't care about). Logging, caching, threading, etc.
So here's a quick exercise for you:
Which of these are functional and which are non-functional? Why?
- Addresses should be US-only, ZIP Codes must be five digits
- Every method call should log its own name and arguments to a text file.
- When returning a list of Customers, only Customers the current user is authorized to see should be returned.
- When submitting a new Customer, it must be put in a pending queue for approval by an administrator.
I'll post my answers in a later post, but feel free to leave your answers in a comment.
Maybe this series will turn into an Every-Other-Weekly Concerns?
- The Ruby Rogues podcast discussed AOP in a recent episode (episode 46). It's a good idea to listen to the whole podcast for context, but they don't really start discussing AOP directly until about 28 minutes in.
- The proxy/decorator pattern gives some of the same benefits that AOP can give you. Derick Bailey blogged about using proxies and decorators in JavaScript.
- A couple of white papers for you:
- FeatureC++ and AOP - What's feature-oriented programming?
- AOP is Quantification and Obliviousness - "obliviousness" often has a negative connotation, but I believe AOP in a team setting on a properly architected application can free up developers to concentrate on adding business value without having function requirements slowing them down
That's it for this week. Have a great weekend.
Attributes in .NET are classes that derive from the Attribute class. Here's an example of an attribute as seen in ASP.NET MVC:
Attributes themselves don't actually do anything: they are strictly meta data. It's up to a framework or tool (ASP.NET MVC, WCF, PostSharp, to name a few) to interpret and use any code in or to infer any meaning from those attributes.
Attributes can have contructors, and you can use those constructors when putting an attribute on a class. But you can only use constant values (like a string literal, an integer literal, an enum literal).
You also can't use type parameters on an attribute, but you can use typeof() when using an attribute.
As I stated above, attributes don't actually do anything on their own. To see what attributes are applied, use Reflection. For instance, to get attributes set on a class: