Simpler error handling in .NET applications using Polly

Just think how many times you had to write some code to handle errors, and that handling required more than just logging and proceed with life as if nothing happened. If retries are required, or a cool down time, that’s a good amount of logic to roll for those situations. Well, there’s a NuGet for that (I guess that’s our version of there’s an app for that). Polly is a “library that allows developers to express transient exception and fault handling policies such as Retry, Retry Forever, Wait and Retry, or Circuit Breaker in a fluent manner....

November 8, 2016 · 5 min · 942 words · João Antunes

Boilerplate hunting with Castle DynamicProxy

Castle Core is a library that provides some utilities but I’ll just talk about using one of them, the DynamicProxy. If the post on BenchmarkDotNet was in the race for golden shovel award, a post on Castle DynamicProxy is a sure winner, but I feel like it :) Castle DynamicProxy is a a “lightweight runtime proxy generator”, that enables you to do a kind of aspect oriented programming, allowing for some code to be executed before or after a method is invoked on a proxied interface....

November 1, 2016 · 8 min · 1665 words · João Antunes

BenchmarkDotNet - Library for benchmarking .NET code

This will probably earn me what some friends of mine call a golden shovel (an award for finding out something everyone already knows) but since I just recently found out about it, I’ll write about it anyway. Several times I felt the need to benchmark some portions of code so I could see if a way of doing something could be a slow down cause for an application (many of those times were when I wanted to use some reflection to simplify the code and some colleagues were afraid reflection was going to have a negative impact on performance)....

October 24, 2016 · 4 min · 804 words · João Antunes