Summary of presentation "AOP & Policy Injection" that was part of Dot.Net group meeting.
Motivation:
- Mixing of business logic with supported mechanisms like logging, transaction, security
- Code duplication
- Same implementation patterns without reuse
- Hard maintenance
- Lack of modularity
Aspect-oriented programming (AOP) concept:
Separate business logic (functional requirements) from supporting mechanisms (non-functional requirements) like security, exception handling, tracing, monitoring, transactions, caching, validation.
The way is to encapsulate supporting mechanisms into Aspects or Policies and to address them declaratively to business logic code.
AOP implementation: