rdingwall

Stories submitted by rdingwall

The Fat ViewModel(richarddingwall.name)

submitted by rdingwallrdingwall(323) 1 year, 5 months ago

Description of a common problem in WPF, and why DelegateCommands are evil. read more...

add a comment |category: |Views: 24

tags: another

Powershell to recursively strip C# regions from files(richarddingwall.name)

submitted by rdingwallrdingwall(323) 1 year, 9 months ago

Here’s a super quick little powershell snippet to strip regions out of all C# files in a directory tree. Useful for legacy code where people hide long blocks in regions rather than encapsulate it into smaller methods/objects. read more...

add a comment |category: |Views: 3

tags: another

DDD eXchange 2010 highlights(richarddingwall.name)

submitted by rdingwallrdingwall(323) 1 year, 11 months ago

On Friday I attended DDD eXchange 2010, a one-day software conference here in London on Domain Driven Design. This years conference focused on two themes — architectural innovation and process — and I saw talks by Eric Evans, Udi Dahan, Greg Young, Ian Cooper and Gojko Azdic discussing their various aspects. Here are some of my highlights. read more...

add a comment |category: |Views: 5

tags: another

Guard Methods(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 1 month ago

In defensive programming, guard clauses are used to protect your methods from invalid parameters. In design by contract, guard clauses are known as preconditions, and in domain driven design, we use them to protect invariants — unbreakable rules that form assumptions about our model. read more...

add a comment |category: |Views: 14

tags: another

Reactive Extensions and Prism: LINQ to your Event Aggregator(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 1 month ago

A lot of people have been talking about the Reactive Extensions for .NET, a flash new library from Devlabs which lets you do LINQ to .NET events just like you can with collections. My team at work has started using it pretty heavily, and today I wrote an adapter that allows you to use Rx over events published on the event aggregator in a Prism/Composite WPF application. read more...

add a comment |category: |Views: 151

tags: another

Back to basics: What is state?(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 1 month ago

A short introduction to the concept of state, and how it is applied to a few design and testing principles. read more...

add a comment |category: |Views: 13

tags: another

Factory factory pattern: easier than using a container(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 2 months ago

Here’s a simple example of a class that creates file transfers using different protocols, which can be combined into a big queue later. It’s based loosely on something I wrote last week at work, and you can see some pretty classic examples of the Strategy and Abstract Factory patterns here. read more...

add a comment |category: |Views: 30

tags: another

Domain-Driven Documentation(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 5 months ago

Here’s a couple of real-life documentation examples from a system I’ve been building for a client... read more...

add a comment |category: |Views: 10

tags: another

The trouble with soft delete(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 6 months ago

Today I would like to write about a very common pattern seen in database-driven business applications — soft delete — why it fails in large applications, and some better alternative strategies. read more...

add a comment |category: |Views: 22

tags: another

Domain-Driven Design and OOP: friction = traction(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 7 months ago

A few days ago I read a really great post by Seth Godwin about Traction and Friction. He’s not a programmer (as far as I know), but writes a lot of insightful articles about strategy and value that can be applied to everyday subjects. This particular article struck a chord in me as a good metaphor for the benefits domain-driven design brings to object-oriented code. read more...

add a comment |category: |Views: 5

tags: another

Richard Dingwall » SOLID ugly code(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 8 months ago

Today we are working on a system that, among other things, sends notification e-mails to employees when their attention is required. Getting an employee’s e-mail address is normally pretty simple, but this organisation has are around 10,000 staff out in the field, many of whom don’t have access to a computer let alone a work e-mail account. To counter this problem we use some simple chain-of-command rules:If the Employee has an e-mail address, send it to that.If he doesn’t have one, send it to his immed... read more...

2 comments |category: |Views: 6

tags: another

Law of Demeter is easy to spot when you need extra mocks(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 9 months ago

In this example, DoSomething() knows intimate details about what an IFoo’s insides look like. This is bad because it’s additional coupling that will bog us down later — if we ever want to change the internal composition of IFoo, we will have to also update all pervert methods like DoSomething() that depend on it. read more...

add a comment |category: |Views: 10

tags: another

ASP.NET MVC, TDD and AutoMapper(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 9 months ago

This post is in response to a question on a recent article I wrote about mapping domain entities to presentation models with AutoMapper, an object-object mapper for .NET. Today I will give a brief example of how we can tie it all together in an ASP.NET MVC application using dependency injection and application services. read more...

add a comment |category: |Views: 322

tags: another

Real-life DDD: organise code by responsibility layers(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 9 months ago

Here is a screenshot from Visual Studio from a project for a client that I have been lead developer on for the past few months. The domain (actually a bounded context within a larger ERP system) is training for an emergency services department, where staff are required to be proficient in all sorts of skills like using rescue equipment and performing first aid. On the left is what the domain layer looked like when we began several months ago. On the right is how it looks today. read more...

add a comment |category: |Views: 35

tags: another

A programmers secret weapon: the humble to-do list(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 10 months ago

A while ago I wrote a post how to lose traction on a personal software project, based on mistakes I have made myself in the past that have slowed down or even completely stopped progress. Today I want to share a tip that has greatly improved my time management since I’ve started doing it, and helped combat many “programmer’s block” moments I am notorious for. read more...

add a comment |category: |Views: 12

tags: another

Using NUnit to check your IoC container is set up right(richarddingwall.name)

submitted by rdingwallrdingwall(323) 2 years, 11 months ago

One small problem I encountered when getting into Dependency Injection (DI) and Inversion of Control (IoC) was that even though all my services were now beautifully SOLID and test-driven, quite often it was all wasted because I forgot to register them in my IoC container, causing massive errors that wouldn’t be detected until runtime (oops). read more...

add a comment |category: |Views: 6

tags: another