CQRS Matching Events and Commands

.net, cqrs, event-sourcing

Solution

You wouldn't normally use CQRS for CRUD scenarios. There are way simpler tools and patterns to create CRUDy applications.

CQRS brings many advantages to behavior-rich scenarios, where the verbs are not Create, Read, Update, Delete, but rather resemble real behavior. Like PromoteEmployee or BlacklistVendor.

Once you start modelling a behavior-rich domain, there might still be many corelating commands/events - which isn't a bad thing -, but you will also find that commands and the resulting events can be very different both in size (data contained) and in numbers.

Problem

I'm getting started with CQRS and I'm finding that my Event class definitions match my Command definitions almost 1 to 1. Aside from the obvious code repetition, I'm trying to figure out what I'm doing wrong. There are certainly some cases where the events don't match the commands....but not many. Take the simple CUD scenario: Command Classes: - CreatePost - UpdatePost - DeletePost Event Classes: - CreatedPost - UpdatedPost - DeletedPost Any advice on this? I'm using an event store, if that makes any difference. Thanks.

Original source