|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Features AOP Technology Update
A framework comparison and internals tour
By: Patrick Fendt
Aug. 10, 2005 09:00 AM
Aspect-Oriented Programming (AOP) is undeniably one of the coolest things to happen in the software technology in a long time. AOP has been called the "third dimension of programming" (copyright by Frank Sauer, Technical Resource Connection, Inc.) and has tremendous power in dynamically inserting logic into pre-existing programs. It can help solve some of the key problems (technology gaps, so to speak) still facing IT organizations. More specifically, AOP is now beginning to bridge the gap in three areas of software technology:
The purpose of this article is to give the reader an understanding of the various AOP technologies available today and put AOP in perspective so it's judiciously used. But first let me give you a brief overview of AOP and AOP terminology. The source code for this article can be downloaded from www.jdj.sys-con.com.
AOP Overview and Terminology AOP takes this concept a step further and lets this separation of concerns be applied easily to a class of functions that tend to permeate a software system; examples are logging, security, transactions, exception handling, and monitoring. These are examples of what we call crosscutting concerns, and they tend to be extremely critical to the success of a software system - especially over its lifetime. Yet, until AOP came on the scene, these crosscutting concerns caused enormous inefficiencies, inconsistencies, and bugs, and as a result, these systems typically fell short of expectations on quality, manageability, and extensibility. AOP technology introduces several new terms to our software technology vocabulary. In essence, it allows completely independent Java methods (advice) to intercede transparently and be executed while running pre-existing Java application code - at well-defined points called join points. Examples of join points are before and after method calls, or when a particular object is instantiated, or when a particular member variable is referenced. The way developers specify which join points are relevant is via a pointcut expression that refers to one or more join points in a particular software system or subsystem. A pointcut could, for example, apply to a collection of Java classes in a directory hierarchy, a JAR, or an EAR, and the expression typically takes advantage of your class naming conventions and uses a regular-expression-like syntax. Finally, an aspect is a more general term referring to one or more related advice functions. An aspect can then also serve as a focal point for specifying the pointcut(s) that relate to the aspect. What follows are some commonly used AOP terms: Join point: a well-defined point in programs where AOP functions (advice) can intercede and affect execution Advice: the action taken by the AOP framework at a particular join point. This functionality (implemented via a Java method) will transparently intercede and be executed while executing your Java application code. Examples of different types of advice are: before, after, and around Aspect: a general term referring to a collection of one or more related advice methods, typically implemented in a single Java class, and class, and potentially accepting join point context information as a parameter to those advice methods Pointcut: the expression that specifies which join points will be affected by one or more aspects Introductions: a more intrusive type of intercession that modifies the structure/type of your (Java application) classes, for example, by implementing a new interface or adding a new member variable Mixin: a mixin refers to adding new class(es) to a pre-existing class Weaving: the application/activation of an advice across one or more pointcuts so that the advice will be executed when the join points are encountered Target: the application object being advised (affected by the aspects) at any point in time Interceptor: an aspect with only one advice method named "invoke"
AOP Use-Cases
Reader Feedback: Page 1 of 1
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News
|
|||||||||||||||||||||||||||||||||||||||||||||||||