Dealing With Optimistic Concurrency Control Collisions

Optimistic Concurrency Control (OCC) is a well-established solution for a rather old problem - handling two (or more) concurrent writes to a single object/resource/entity without losing writes. OCC works (typically) by including a timestamp as part of the record, and during a write, we read the timestamp: Begin: Record timestamp Modify: Read data and make tentative changes Validate: Check to see if the timestamp has changed Commit/Rollback: [Read More]

Respawn 0.3.0-preview1 released for netstandard2.0

Respawn, a small library designed to ease integration testing by intelligently clearing out test data, now supports .NET Core. Specifically, I now target: net45 netstandard1.2 netstandard2.0 I had waited quite a long time because I needed netstandard2.0 support for some SqlClient pieces. With those pieces in place, I can now support running Respawn on full .NET and .NET Core 1.x and 2.0 applications (and tests) [Read More]

Domain Command Patterns - Handlers

In the last post, we looked at validation patterns in domain command handlers in response to a question, "Command objects should [always/never] have return values". This question makes an assumption - that we have command objects! In this post, I want to look at a few of our options for handling domain commands: When I look at command handling, I'm really talking about the actual "meat" of the request [Read More]

Domain Command Patterns - Validation

I don't normally like to debate domain modeling patterns (your project won't succeed or fail because of what you pick), I do still like to have a catalog of available patterns to me. And one thing that comes up often are "how should I model commands?": In general, apps I build follow CQRS, where I split my application architecture into distinct commands and queries. However, no two applications are identical [Read More]

Swagger, the REST Kryptonite

Swagger, a tool to help design, build, document, and consume RESTful APIs is ironically kryptonite for building actual RESTful APIs. The battle over the term "REST" is lost, where "RESTful" simply means "an API over HTTP" but these days is 99% of the time referring to "RPC over HTTP". In a post covering the problems with Swagger, the author outlines some familiar issues I've seen with it (and its progenitors [Read More]