Using PostSharp and SOLID principles, part 1
The first of my 5 part series on using PostSharp to implement SOLID principles is now live. Here’s a little preview:
How many times have you written something like this:
This is a piece of code that you might write dozens or more times to be able to use a repository to return some data to use in your application. If you’re in a hurry, it’s a quick way to get something that works, and also an easy way to get some lazy loading in place so that the repository doesn’t instantiate until you need it to. Unfortunately, this piece of code incurs technical debt. And the more you use this boilerplate elsewhere in your code, the more technical debt you incur.
There are two things in this code that are incurring the debt: hardwired dependencies and boilerplate code.
To find out how to ‘pay off’ this debt with PostSharp’s help, keep reading: 5 Ways That Postsharp Can SOLIDify Your Code: Lazy Loading of Dependencies, and keep an eye out for the next four posts.