blob: 674265d9d94c91bb072c28e43efc7cc59fd1cf8a [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 1. Getting Started with AspectJ</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="up" href="index.html" title="The AspectJTM Programming Guide"><link rel="previous" href="preface.html" title="Preface"><link rel="next" href="starting-aspectj.html" title="Introduction to AspectJ"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Getting Started with AspectJ</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="preface.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="starting-aspectj.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="starting"></a>Chapter 1. Getting Started with AspectJ</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="starting.html#starting-intro">Introduction</a></dt><dt><a href="starting-aspectj.html">Introduction to AspectJ</a></dt><dd><dl><dt><a href="starting-aspectj.html#d0e181">The Dynamic Join Point Model</a></dt><dt><a href="starting-aspectj.html#d0e194">Pointcuts</a></dt><dt><a href="starting-aspectj.html#d0e304">Advice</a></dt><dt><a href="starting-aspectj.html#d0e422">Inter-type declarations</a></dt><dt><a href="starting-aspectj.html#d0e491">Aspects</a></dt></dl></dd><dt><a href="starting-development.html">Development Aspects</a></dt><dd><dl><dt><a href="starting-development.html#d0e513">Tracing</a></dt><dt><a href="starting-development.html#d0e541">Profiling and Logging</a></dt><dt><a href="starting-development.html#d0e586">Pre- and Post-Conditions</a></dt><dt><a href="starting-development.html#d0e624">Contract Enforcement</a></dt><dt><a href="starting-development.html#d0e658">Configuration Management</a></dt></dl></dd><dt><a href="starting-production.html">Production Aspects</a></dt><dd><dl><dt><a href="starting-production.html#d0e671">Change Monitoring</a></dt><dt><a href="starting-production.html#d0e742">Context Passing</a></dt><dt><a href="starting-production.html#starting-production-consistentBehavior">Providing Consistent Behavior</a></dt></dl></dd><dt><a href="starting-conclusion.html">Conclusion</a></dt></dl></div><div class="sect1"><a name="starting-intro"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="starting-intro"></a>Introduction</h2></div></div><p>
Many software developers are attracted to the idea of aspect-oriented
programming (AOP) but unsure about how to begin using the
technology. They recognize the concept of crosscutting concerns, and
know that they have had problems with the implementation of such
concerns in the past. But there are many questions about how to adopt
AOP into the development process. Common questions include:
<div class="itemizedlist"><ul compact><li><p><a name="d0e80"></a>Can I use aspects in my existing code?</p></li><li><p><a name="d0e83"></a>
What kinds of benefits can I expect to get from using aspects?
</p></li><li><p><a name="d0e86"></a>How do I find aspects in my programs?</p></li><li><p><a name="d0e89"></a>How steep is the learning curve for AOP?</p></li><li><p><a name="d0e92"></a>What are the risks of using this new technology?</p></li></ul></div>
</p><p>
This chapter addresses these questions in the context of AspectJ: a
general-purpose aspect-oriented extension to Java. A series of
abridged examples illustrate the kinds of aspects programmers may
want to implement using AspectJ and the benefits associated with
doing so. Readers who would like to understand the examples in more
detail, or who want to learn how to program examples like these, can
find more complete examples and supporting material linked from the
AspectJ web site ( <a href="http://eclipse.org/aspectj" target="_top">http://eclipse.org/aspectj</a> ).
</p><p>
A significant risk in adopting any new technology is going too far
too fast. Concern about this risk causes many organizations to be
conservative about adopting new technology. To address this issue,
the examples in this chapter are grouped into three broad categories,
with aspects that are easier to adopt into existing development
projects coming earlier in this chapter. The next section, <a href="starting-aspectj.html">Introduction to AspectJ</a>, we present the core of AspectJ's
features, and in <a href="starting-development.html">Development Aspects</a>, we present
aspects that facilitate tasks such as debugging, testing and
performance tuning of applications. And, in the section following,
<a href="starting-production.html">Production Aspects</a>, we present aspects that
implement crosscutting functionality common in Java applications. We
will defer discussing a third category of aspects, reusable aspects,
until <a href="language.html">The AspectJ Language</a>.
</p><p>
These categories are informal, and this ordering is not the only way
to adopt AspectJ. Some developers may want to use a production aspect
right away. But our experience with current AspectJ users suggests
that this is one ordering that allows developers to get experience
with (and benefit from) AOP technology quickly, while also minimizing
risk.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="preface.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="starting-aspectj.html">Next</a></td></tr><tr><td width="40%" align="left">Preface&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;Introduction to AspectJ</td></tr></table></div></body></html>