Category : c#

Inspired Web Development

Tim Sommer
Thread-safe singletons in .NET

Thread-safe singletons in .NET

Lets take a look at (static) constructors, thread-safety and static singletons.

Field initialization

Let's start by examining how field initialization works in .NET.

Let's say you have the following code:

public class Program 
{
  // field declaration and initialization
  private int i = 5;

  public Program () 
  {
    // do ctor
Read More
Tim Sommer
WageCalculator - a SOLID approach

WageCalculator - a SOLID approach

One of my clients has recently asked me to implement a Wage Calculator.
Calculating the wage of an employee could be really complicated and was likely to change quite often. And on top of that, I was given 5 days to implement the entire backend.

Read More
Tim Sommer
Sharing development settings

Sharing development settings

I recentely started doing all my development work in Virtual Machines. I have one optimized for web-development, another for windows development, and a couple more for special cases. This approach has a lot of advantages, but one of the real problems I experienced in maintaining

Read More