Image for post
Image for post
Waterfall at Jewel of Changi, Singapore

In part 2 we will be building a dotnet CLI tool which follows the CQRS and Mediator patterns to auto generate commands, queries, responses and handlers in the domain layer using Roslyn API for code generation. Git Repo

Series

Problem

The most glaring challenge of the CQRS pattern is to overcome the number of classes a developer is required to create and can become cumbersome when constantly creating queries, commands, handlers, and response objects. …


Image for post
Image for post

This post looks at why I chose the CQRS and mediator patterns, which libraries to use, multi-layered project structure, setup and how to apply them in a microservice context. Git Repo

Series

Context

But why though I hear you ask? Having worked with bloated domain classes where multiple functions are used to modify state and implement domain rules became increasingly difficult to debug, extend and review. Often I found that a business rule function implements multiple sub-rules that are repeated somewhere in the domain. Multiple layers of complex abstraction in an attempt to share the functionality or multiple developers implemented their strategies each advocating for different patterns and practices. …

About

Armand Jordaan

A dynamic and creative full stack software developer with 7+ years of experience based in South Africa. https://www.linkedin.com/in/armandjordaan/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store