Skip to content

Sponsor: Do you build complex software systems? See how NServiceBus makes it easier to design, build, and manage software systems that use message queues to achieve loose coupling. Get started for free.

Learn more about Software Architecture & Design.
Join thousands of developers getting weekly updates to increase your understanding of software architecture and design concepts.


Follow @CodeOpinion

.NET

Organize by Feature

This post is about how I organize by feature.  Features being my commands and queries. If you have not familiar with CQRS, it may be worth a look at some of my other posts to get some Context. Thin Controllers with CQRS and MediatR Query Objects instead of Repositories Mediator Pattern using MediatR and Unity  Layers What I found interesting was as I moved from thinking about layers to thinking about features and vertical slices, I didn’t immediately organize my code that way.  I would still organize my code by what it represented (eg layer). My project structure would look something like this:… Read More »Organize by Feature

Idempotent Aggregates

This blog post will cover creating Idempotent Aggregates and is apart of a series of posts related. Please take a look any previous posts as they may give more context to the code samples below. Thin Controllers with CQRS and MediatR Identify Commands & Events Idempotent Commands Follow @codeopinion Idempotence Idempotence is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application. In my previous post Idempotent Commands, I looked at creating idempotency at the persistence level if you are using an ACID compliance database. But what happens… Read More »Idempotent Aggregates

Idempotent Commands

Idempotence is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application. When you click the “Place Order” button on magical unicorn e-commerce site, you expect your order to be submitted only once.  You also expect that your credit card on on the order you just placed shouldn’t happen more than once. There are different ways to handle idempotency at various levels of your application. Persistence Context is important.  In my context, I’m using a ACID compliant database (MySQL) for storing my current state. I’m also using… Read More »Idempotent Commands