Skip to content

Sponsor: Using RabbitMQ or Azure Service Bus in your .NET systems? Well, you could just use their SDKs and roll your own serialization, routing, outbox, retries, and telemetry. I mean, seriously, how hard could it be?

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

Static Variables & Methods are Evil?

You might have heard the recommendation to steer clear of static variables or methods. But is that really good advice? Let’s dive into why people say that, with a little nuance, and clarify the topic with some examples. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Deterministic Behavior First off, let’s talk about determinism. I have a method called is18YearsOrOlder, which takes a DateTime argument representing your birth date. The method checks if you’re 18 years or older by adding 18 years to your birth date… Read More »Static Variables & Methods are Evil?

I’d rather read 50 lines than Extract Method Refactoring

Extract Method refactoring is a great way to give names to concepts so code is easier to read and flows. But it can go wrong when you use it, creating a lot of indirection and unexpected behavior from the methods you extract. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. I want to dive into a topic that’s been on my mind: refactoring, specifically the “Extract Method” technique. TLDR: I’d rather read a longer method—maybe around 50 lines—than get tangled up in a web of indirection… Read More »I’d rather read 50 lines than Extract Method Refactoring

Commands or Events: Which One for Workflow?

So, you’re building a system around business processes and workflows. Great! But where does the code go that has to orchestrate all this? This is a common question I’ve received, especially from members of my channel on our private Discord. Let’s dive into the guidelines on process managers, bounded contexts, and clever ways to collocate workflow steps. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Understanding Workflows Often, smaller workflows chain together to create larger workflows. Picture this: we have three different boundaries—sales, shipping, and billing.… Read More »Commands or Events: Which One for Workflow?