This post was originally published at Caching and Connection Handling in .NET: An Aspect-Oriented Programming Tutorial

We reduce boilerplate with common OOP patterns, but often, the code overhead of using patterns is almost the same—if not bigger—than if we’d used boilerplate code in the first place.

In aspect-oriented programming tutorial, we implement two functions (aspects) that allow for generic database connection management and caching. These allow us to mark methods that, when called, will automatically have the required functionally present in through IL weaving.

Read this article: 

This post was originally published at Caching and Connection Handling in .NET: An Aspect-Oriented Programming Tutorial