Quote
As the saying goes, workers are good, and must first make a tool. To learn AOP (aspect programming) and Aspectj must first know how to install and configure your development environment, this article will guide you how to get out of the study.
Aspectj installation and setting
Download the latest version of AspectJ from the AspectJ download page, you can decompress it into the specified directory after downloading. Then perform the following steps:
· Copy
· Create a directory
· Use
• Copy
Figure 1: Aspectj graphic editing compilation window
Note:
Aspectj for JBuilder installation and settings for open tools
Aspectj for jbuilder is an open tool that supports JBuilder to use AspectJ, you can download its latest version in the AspectJ4JBuilder download page and uncompatched to the specified directory, then perform the following steps:
• Copy all .jar files under the "Aspectj for JBuilder Dir> / lib / EXT directory to the LIB / EXT directory of jbuilder. If you want to delete it, delete the three files in the LIB / EXT of JBuilder.
· Then start JBUIDER to find more than one option in the toolbar
: Figure 2: Toolbar of Aspectj for JBuilder
There are four icons in the figure in the figure "1", press the first to start the AspectJ browser, the second press will provide the function of navigation and class browsing, the third column is compiled, and finally A class that will be compiled after pressing the class in the ".lst" file.
Figure 3: Reservoir setting required by the project
Note: The Aspect rutime library must be added to the project's library, as shown in Figure 3. In addition, because the ASPECTJ's AJC compiler does not automatically search the engineering path, you need to add all the necessary ".lst" files to the current project so that the AJC compiler compiles all files, otherwise it is only compiled The class in the ".lst" file.
Open tool bug
From now on, there are tools for designing IDEs such as Eclipse, Emacs, NetBean. However, these tools or less bug, especially some projects, clearly using the command line AJC directly can succeed, but the AJC compiler in these integrated environments can not run, so if you are confident, you can't Compiling in the IDE, when you have some strange compilation errors, you can now compile, you may be able to compile. For example, an example of Observer, an AspectJ-110 version cannot be successfully compiled in the JBuilder ID, but can be successfully compiled successfully in the command line. Disclaimer This article is reserved by Starchu1981, if you need to pay, please write the author and source.