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

Derek Comartin

Background Tasks in .NET

It seems like every application I’ve ever written, at some point needs to run a task in the background that is to be scheduled at some point in the future. My need for tasks as reoccurring batch jobs has decreased significantly over the years because of my applications being more event driven. Nowadays, I will often use Event Stores Persistent Subscriptions with my event stream as a queue.  However, I’m not event sourcing all parts of the application and not always using Event Store. If you have any questions, please follow me on Twitter. https://www.youtube.com/watch?v=UAWDMYKy8PMVideo can’t be loaded because JavaScript is disabled: Running… Read More »Background Tasks in .NET

Validating Commands with the Decorator Pattern

This post is how I have manged to handle validating commands and queries and belongs to a series about different aspects of applying CQRS Although these examples are demonstrating usage in commands, they are aslo applicable to queries. Examples are using using MediatR to handle our requests. If you are unfamiliar with CQRS or MediatR, here are some other relevant posts: Organize by Feature Thin Controllers with CQRS and MediatR Query Objects instead of Repositories Mediator Pattern using MediatR and Unity Feature First let’s take a look at our feature for Changing a Customers Pricing Level.  In this example I’ve organized… Read More »Validating Commands with the Decorator Pattern

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