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

Stop throwing Exceptions! Start being Explicit

If you’re writing a library for other developers to consume on NuGet or if you’re creating an API within your own project, stop throwing exceptions and start being explicit. Exceptions are like landmines. Consuming callers have absolutely no idea what exceptions you might throw or how/when/why they will step on one. C# is dishonest when it comes to looking at method signatures. YouTube Check out my YouTube channel where I created a video that accompanies this blog post. Honesty I first heard of the concept of honesty in programming languages from a video of Erik Meijer discussing functional programming. Take for example… Read More »Stop throwing Exceptions! Start being Explicit

Thread Safety & Scoped Lifetime in Dependency Injection Containers

If you’re using Scoped Lifetime in a Dependency Injection containers, beware! You may be run into race conditions due to a lack of thread safety. I was doing a live stream on Domain Events over on my YouTube Channel where I was taking advantage of Scoped Lifetime. After the stream, I realized Scoped Lifetime and thread safety isn’t mentioned much and I’m not sure why? It could be because developers aren’t using multiple threads within the top-level request (HTTP request or service bus message invocation). Or it’s because developers are writing thread-safe code by default. I tend to think it’s… Read More »Thread Safety & Scoped Lifetime in Dependency Injection Containers

NuGet Package Alternatives when Migrating to .NET Core

Migrating from .NET Framework to .NET Core requires all of your NuGet Package dependencies to also be compliant with .NET Core. But what happens when you find a dependency that only targets .NET Framework? Here are a few NuGet package alternatives that I’ve run into during my own migration. Migrating from .NET Framework to .NET Core This post is in a blog series for migrating from .NET Framework to .NET Core. Here’ are some earlier post if you need to catch up: Migrating from .NET Framework to .NET Core Overview Migrating to ASP.NET Core .NET Portability Analyzer Multi-Targeted NuGet Package… Read More »NuGet Package Alternatives when Migrating to .NET Core