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

Avoiding long-running HTTP API requests

How do you handle long-running HTTP requests that take long to complete? For example, how would you design an HTTP API that needs to generate a transcript for a specific video (by ID)? Deeper into that question, you can assume that won’t be a fast request/response, so how can we better manage this? Using asynchronous request/reply with HTTP. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Designing an API Endpoint This video/blog were spurred on by this post I came across on Twitter/X. I didn’t think… Read More »Avoiding long-running HTTP API requests

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

Goodbye, long procedural code! Fix it with workflows

We’ve all written long procedural code with many logic branches that must handle failures because it tries to execute a long business process with many actions. Better alternatives exist than writing a rat’s nest of complex procedural code. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Procedural We’ve all probably written or looked at code similar to the following. It does a few things: first, it adds and saves an order to the database; then, it tries to process the credit card payment; and lastly, it… Read More »Goodbye, long procedural code! Fix it with workflows