News
AOP Modularizes Crosscutting Concerns
- By John K. Waters
- March 19, 2001
PALO ALTO, CA—A new generation of software development tools supporting a
new approach to programming is sliding down the birth canal. As early as this
summer, coders can expect to see the first Aspect Oriented Programming (AOP)
products becoming generally available.
AOP allows global properties of a program to determine how it is compiled
into an executable program. Traditional units of modularity in programming languages
include objects, functions, modules, and procedures. But some functions can't
be encapsulated in single modules; instead, their implementations end up scattered
across the class hierarchy. AOP programming deals with new units of modularity,
called "aspects," which involve more than one functional component, such as
synchronization, integrity control, persistency, and interaction. Aspects can't
be neatly separated using traditional units of modularity.
Put another way, code relating to aspects is often expressed as small code
fragments tangled and scattered throughout several functional components. Because
of the way they cross module boundaries, it is said that aspects "crosscut"
the program's hierarchical structure. Aspects encapsulate crosscutting concerns.
AOP can also be seen as a complementary design and implementation technique
to object-oriented programming. In fact, one of the early AOP development tools,
AspectJ, is specifically designed to work with one of the leading OO languages:
Java.
"AspectJ doesn't replace Java," says Gregor Kiczales, professor of computer
sciences at the University of British Columbia, and a principle scientist at
Xerox Palo Alto Research Center. "It makes Java even more powerful by solving
some of those problems that Java doesn't handle well."
AspectJ is a general purpose AOP extension to Java. It enables the modularization
of such crosscutting concerns as: system wide error-checking strategies, design
patterns, synchronization policies, resource sharing, distribution concerns,
and performance optimizations. An open source project, AspectJ is the product
of years of research at Xerox PARC. The project is partially supported by the
Defense Advanced Research Projects Agency (DARPA).
Another promising AOP tool is IBM's HyperJ, currently distributed through
the alphaWorks Web site. IBM doesn't us the AOP moniker, but says that HyperJ
"...supports advanced, 'multi-dimensional' separation and integration of concerns
in standard Java software..." which "... facilitates improved modularization,
adaptation, composition, integration, and even non-invasive remodularization
of Java software components."
This first HyperJ release is a file-driven, batch version. Some key features
planned for future releases include: an interactive GUI, support for composition
of Java library classes, and more convenient ways to specify a number of common
compositions.
The implications for developers of the emergence of real-world AOP tools is
simple: if it works the way it's supposed to, AOP could become a powerful means
of coping with the staggering complexity that increasingly characterizes software
applications. AOP tools hold the potential for simplifying and all but eliminating
some of the most time consuming, frustrating, and difficult aspects of OO development.
"AOP is an idea whose time has come," says Kiczales. "It solves one of this
generation's biggest programming problems."
Expect to see the official 1.0 release of AspectJ this summer, but evaluation
copies are available now for download from the Web site (http://aspectj.org).
"It's ready for early adopters to beat on it," says Kiczales.
About the Author
John K. Waters is a freelance writer based in Silicon Valley. He can be reached
at [email protected].