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

Abstractions to easily swap implementations? Not so fast.

Why do you create an abstraction? One reason is to simplify the underlying concept and API. Another reason, probably more common, is that the internal implementation might change. While this can be true, it’s not always as straightforward as you’d think. I will give a couple of examples of things to think about when you’re designing an API. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Expected Behavior I will use a Repository as the example in most of this post since it’s pretty common and… Read More »Abstractions to easily swap implementations? Not so fast.

“I NEED data from another service!”… Do you really?

How do you share data between services? This is one of the most common questions when you have a system composed of many different services, and each service owns a data set. For example, you may need data from another service for validation or to send data to another service as part of a workflow. I will explain a few situations where you could share data between services, but more importantly, when you shouldn’t. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Data Ownership A common… Read More »“I NEED data from another service!”… Do you really?

Testing WITHOUT Mocks or Interfaces!

A common approach people take with testing is mocking. Specifically defining interfaces for dependencies which are then typically mocked so you can test in isolation. While interfaces can be helpful for mocking as well as fakes and stubs, there can be other approaches taken. Meaning you don’t need to create an interface for everything. 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 Let’s start with a method in an OrderService for creating an Order. To test this method, there are a few dependencies involved. The… Read More »Testing WITHOUT Mocks or Interfaces!