Aspects revisited

Ken Wing Kuen Lee's An Introduction to Aspect-Oriented Programming is a concise and cogent primer on the subject. By way of example, Lee imagines a development shop where the policy is that methods, in any class, must invoke a logger on entry and exit. AOPers call this kind of requirement a "crosscutting concern," meaning that it affects classes without regard to their kinship in the class hierarchy. You can make a rule that programmers have to call the logger from every class, but there's no easy way to ensure that they'll do it at all, nevermind correctly. The AOP solution is to define a pattern that matches the set of methods that should call the logger, and to rewrite the code automatically so they do. That's what happens under the covers, anyway, but the idea is that the person who'd like to enforce the policy simply declares it, and tools make it so -- without requiring the cooperation or even the knowledge of the programmers responsible for the affected classes.
Full story at []

Former URL: