Aspected Oriented Programming
Aspect-oriented programming (AOP) is the idea of decoupling and modularizing cross-cutting concerns. Cross-cutting concerns are concerns that span over multiple objects in object oriented programming. Common examples are tracing, logging, and auditing, but there are many different cross-cutting concerns.
Using Aspect-oriented programming is made simple by the libraries that exist. For Java, there is AspectJ. For C#, there is PostSharp.
Java
Aspectj
- AOP – Adding Advice before or after main() in Java with AspectJ
- AOP – Logging all method calls and executions in Java with AspectJ
- AOP – Logging method execution time in Java with AspectJ
- AOP – Encrypting with AspectJ
- AOP – Encrypting with AspectJ using an Annotation
- AOP – Implementing Role Based Security in Java with AspectJ
C#
PostSharp
Note: PostSharp has discount or free license available for educationaly, blogging, open source, or other purposes. See this link: http://www.sharpcrafters.com/purchase/discounts
- AOP – Tracing methods in C# with PostSharp
- AOP – Logging method execution time in C# with PostSharp
- AOP – Implementing try catch in C# with PostSharp
- AOP – Implementing a lazy loading property in C# with PostSharp
- AOP Contracts with PostSharp
- AOP Custom Contract: ListNotEmptyAttribute