Posts Tagged ‘C# 3.0’

Contextual composition (2009-3-19)

Today I would like to talk a little bit about something I’ve witnessed in software development over and over again. Actually, I’ve seen this more or less in every commercial codebase I’ve worked with so far. I’m talking about giant switch statements, the misuse of inheritance and code that is so entangled that it’s a [...]

Beat the It (2009-2-9)

. . . or how one could implement the It-Syntax introduced by MSpec. If you don’t know what the hell I’m talking about take a look at this code. (I don’t know if that’s the current MSpec syntax but I think you’ll get where I’d like to take you . . . )

[Description]
public class Transferring_between_from_account_and_to_account
{
[...]

Glue code for validation (2008-11-10)

Wouldn’t it be nice to be able to just call

var report = myDto.Validate();

without sacrificing extensibillity, testabillity, etc? What about at this,

public static class ObjectExtensions
{
public static ValidationReport Validate<Subject>(this Subject subject)
{
[...]

Some thoughts about validation logic (2008-11-8)

The design of validation in software is one of those strange topics you can discuss endlessly about. Some of the major questions concerning validation:

In which Layer should validation logic reside? Is it part of the Domain Layer, part of the Presentation Layer, or is it somehow part of both?
Who is responsible for validation? [...]

Using Extensionmethods in .NET 2.0 projects . . . (2008-7-28)

While reading “C# in depth” by Jon Skeet I discovered a little gem. It is possible to use extension methods in .NET 2.0 projects when you’re using VS2008 and its multitargeting abillities.
Extension methods are essentially only static methods in utillity classes with some constraints around them (the utility class has to be static too for [...]