This article describes how to apply aspect-oriented programming (AOP) to portlet development to address requirements that span multiple portlets (crosscutting concerns) such as logging or sharing data. Portlet developers can download, install, and run the JSR 168 examples to learn how to code and employ aspects. You see how to use AspectJ in an IDE such as Rational Application Developer to create aspects, and then you test the aspects with the WebSphere Portal Test Environment.
Aspect-oriented software development (AOSD, another name for AOP) enables developers to create common code once, and then to apply that code across an application dynamically, when and where needed. You create a construct called an aspect and then you define behavior as advice which specifies how and when to apply the aspect. The AspectJ runtime weaves the aspect code into the application, following the advice you specify.
This article shows portlet developers how to take advantage of AOP in portlets they implement to the Java Portlet Specification (JSR 168). It describes and provides examples in a download which implement crosscutting portlet functionality. The combination of JSR 168, AOP, and AspectJ technologies provides powerful and flexibility capabilities to portlet developers.
| Description | Name | Size | Download method |
|---|---|---|---|
| Article in PDF format | 0604_zoerner-AspectJ-JSR168portlets.pdf | 500 KB | FTP |
| Code samples | portletaspects.zip | 32 KB | FTP |
Information about download methods Get Adobe® Reader®

Stefan Zoerner is an Advisory IT Architect at IBM e-business Innovation Center in Hamburg, Germany. Since 1996, he has been occupied intensively with Java technologies. In 2006, Stefan published a German Portlet book for Java developers. You can reach him at szoerner@de.ibm.com.
