Aspect-oriented software development is a broad area, with many examples of and ways in which the technology is used. These are most often depicted as use cases — and at heart, they are all about the cross-cutting concerns of a system. Though still a young programming technique, aspect-oriented software development, AOSD, already has several established areas of application in software development. Below are the many ways AOSD is used.
Use case 01Security
The security issue is crucial in any software and in any software development process. For this reason, the application of security in a system must be treated as a global concern and applied consistently. Using aspect-oriented software development, you can develop a Security Manager class for the program. If the security concern is left out in any area, it can result in a system flaw. AOSD deals with this by ensuring security concerns are specified in modular form and implemented in the main program in a unified manner.
Use case 02Logging
Logging in software is necessary to expose the internal information of execution — for the purpose of understanding software behaviour, debugging, testing, and other requirements. Logging presents a textbook cross-cutting concern, since every logged part of the system is affected. Aspect-oriented software development takes care of this using a non-intrusive method: the logging lives in one aspect, not in a thousand scattered calls.
Use case 03Authentication And Authorization
Authentication is about whether or not a user is given access to particular software at all. Authorization governs which functions are available to that user within the system. Authorization policies cover groups of roles, systems, users, and commands. The benefit of using aspect-oriented software development here is the ability — and the real possibility — of putting corporate-based authorization in place. This lets the corporate view be mapped directly onto the corporate system infrastructure. Once implemented, any modification can be done centrally.
Use case 04Performance Monitoring
Today's applications are usually complex, with many threads and distributed systems that lean on third-party components. Such systems make it genuinely difficult to detect the root cause of reliability and performance issues. AOSD allows you to define point cuts that match the join points where performance is to be monitored. You can then write advice that updates performance records — invoked automatically any time execution enters or exits any of those join points.
There are many other applications of AOSD aside from the ones discussed above:
- Performance optimization
- Synchronization
- Tracing
- Design patterns
- Exception detection and handling
- Coordination protocols in middleware
Go deeper: start with the basics every programmer should know about AOSD.