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

Software Design

Enums aren’t evil. Conditional statements everywhere are

Are you seeing the same conditional statements (if/switch) against enums littered everywhere? There are different ways of handling that, but a lot of it comes down to your context. Conditionals around type checking, extension methods, Inheritance, and Polymorphism are all options. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Enums The original examples of this problem come from a video by Nick Cosentino, which he tagged me in. The gist is that there are a lot of conditional, in this case “if statements,” throughout a codebase… Read More »Enums aren’t evil. Conditional statements everywhere are

Locking In On Concurrency Control

Concurrency in a multi-user collaborative environment can be challenging. However, understanding the use case is crucial in picking a solution for handling concurrency. Let’s dive into different solutions for concurrency control in various situations. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Last Write Wins The first strategy is that there is no strategy. That might sound odd, but not all situations require concurrency controls. “Last write wins” means whatever the client writes to the database will succeed. If you’re using a relational database, this means… Read More »Locking In On Concurrency Control

Not everything is a service.

I need to create an email service within my system. The service’s responsibility is to send out customer emails for things like Order Confirmation or when Billing information is changed. But how do we communicate with this email service when we need to send an email? There’s another intuitive option that starts when you realize that not everything is a service. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Event-Driven The first option would be using an event-driven architecture and the publish-subscribe pattern. In this scenario… Read More »Not everything is a service.