Thursday, February 17, 2005

Aspect limits

Aspect Oriented Programming (as most of people interested in LOP already know) enriches the world of languages with cross-cutting concerns. Although the idea is not new, it is still being heavily researched.
Typical use cases of AOP are logging, debugging and error handling, these examples can be found in every reference to AOP. But, isn't it too little? What are the other use cases of AOP? What are the real production use cases? Even though error handling is used in products, hardly can it be considered as the main feature of a product. Transaction handling, synchronization in multi-threaded environments, lazy initialization, security; all these fields are certainly other areas where AOP can be used appropriately, but what else?
The lack of AOP use cases may result from little usability of AOP features. Look at the logging - AOP can log any call or return of a method but it can't log other branch instructions (if/else, switch/case) - scarcely it can be used for full logging of a program flow.
Similar limitation exists for AOP usability in synchronization - AOP cannot handle monitor lock/unlock (entering into/leaving from a critical section) - this keeps automatic deadlock prevention tools from being implemented.
Although the main two AOP projects have joined recently to work on new releases together, many things still remain to improve.