Aspect Oriented Programming is an extension to Object Oriented Programming that recognizes crosscutting nature of certain program features. Implementation of such fetures in OOP applications is scattered throughout codebase of multiple modules. In AOP such features are extracted into lexical units called aspects that are woven together with core features during program compilation.
http://aosd.net provides links to a host of AOP-related software project.
Implementations
- AspectJ - an AOP extension of Java http://eclipse.org/aspectj
Typical crosscutting concerns
- authentication/authorization
- transaction management
- object instance pooling
- information caching
Automtatic identification of crosscutting concerns
In an application developed using OOP, crosscutting features are present in a form of code that is 1) scattered across multiple modules 2) entangled with core features. Before an AOP refactoring of the application can be made in order to extract & modularize these features, the crosscutting features themselves need to be identified.
It would be most useful if this step could be machine assisted. A simple technique that comes to my mind is analyzing the number of afferent couplings of a class. The greater the number is the more likely the class is a part of in a crosscutting feature implementation.
- CME http://eclipse.org/cme promissing, but slow progress. Still builds against Eclipse 2.1
- Aspect Mining Tool http://www.cs.ubc.ca/~jan/amt/ discontinued?
AOP specific design patterns
Patterns defined by Ramnivas Laddad in 'AspectJ in Action'
- Worker
- Wormhole
- Participant
- Exception introduction
Reusable aspect libraries
Since some of the cross cutting concerns may be abstracted as reusable aspects it makes sense to create libraries of these. I haven't found much about libraries already existing, so creating one in ObjectLedge looks like an interesting idea at this point.
- GoF design patterns in Java http://www.cs.ubc.ca/labs/spl/projects/aodps.html is a result of research work of Gregor Kiczales - one of AOP inventors. The library is MPL licensed, so fragments of it might be included in our library, with due credit of course.
- aTrack project https://atrack.dev.java.net/ contains aspects library called ajee - I haven't been able to get any details yet.
- JBoss provides an aspect library http://docs.jboss.org/aop/aspect-library/ along with their custom AOP solution
